* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class XmlAnnouncementAnswerTemplateEngine extends BaseXmlTemplateEngine implements CompileableTemplate, Registerable {
+class XmlAnnouncementAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine implements CompileableTemplate, Registerable {
/**
* Some XML nodes must be available for later data extraction
*/
const ANNOUNCEMENT_DATA_NODE_STATUS = 'my-status';
const ANNOUNCEMENT_DATA_EXTERNAL_IP = 'my-external-ip';
const ANNOUNCEMENT_DATA_INTERNAL_IP = 'my-internal-ip';
- const ANNOUNCEMENT_DATA_TCP_PORT = 'my-tcp-port';
- const ANNOUNCEMENT_DATA_UDP_PORT = 'my-udp-port';
- const ANNOUNCEMENT_DATA_ANSWER_STATUS = 'answer-status';
+ const ANNOUNCEMENT_DATA_LISTEN_PORT = 'my-listen-port';
/**
* Protected constructor
// Data from *this* node
self::ANNOUNCEMENT_DATA_EXTERNAL_IP,
self::ANNOUNCEMENT_DATA_INTERNAL_IP,
- self::ANNOUNCEMENT_DATA_TCP_PORT,
- self::ANNOUNCEMENT_DATA_UDP_PORT,
+ self::ANNOUNCEMENT_DATA_LISTEN_PORT,
self::ANNOUNCEMENT_DATA_NODE_STATUS,
self::ANNOUNCEMENT_DATA_SESSION_ID,
// Data from other node
'your-external-ip',
'your-internal-ip',
'your-session-id',
- // Answer status (code)
- self::ANNOUNCEMENT_DATA_ANSWER_STATUS
+ // Answer status (generic field)
+ self::ANSWER_STATUS,
);
}
*
* @return void
*/
- protected function startMyTcpPort () {
+ protected function startMyListenPort () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_TCP_PORT);
- }
-
- /**
- * Starts the my-udp-port
- *
- * @return void
- */
- protected function startMyUdpPort () {
- // Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_UDP_PORT);
+ $this->getStackerInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_LISTEN_PORT);
}
/**
$this->getStackerInstance()->popNamed('node_announcement_answer');
}
- /**
- * Finishes the my-udp-port
- *
- * @return void
- */
- protected function finishMyUdpPort () {
- // Pop the last entry
- $this->getStackerInstance()->popNamed('node_announcement_answer');
- }
-
/**
* Finishes the my-tcp-port
*
* @return void
*/
- protected function finishMyTcpPort () {
+ protected function finishMyListenPort () {
// Pop the last entry
$this->getStackerInstance()->popNamed('node_announcement_answer');
}
$this->getStackerInstance()->popNamed('node_announcement_answer');
}
- /**
- * Starts the answer-status
- *
- * @return void
- */
- protected function startAnswerStatus () {
- // Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('node_announcement_answer', self::ANNOUNCEMENT_DATA_ANSWER_STATUS);
- }
-
- /**
- * Finishes the answer-status
- *
- * @return void
- */
- protected function finishAnswerStatus () {
- // Pop the last entry
- $this->getStackerInstance()->popNamed('node_announcement_answer');
- }
-
/**
* Finishes the announcement-answer
*