* Sub nodes in the XML tree
*/
private $subNodes = array(
- // These nodes don't contain any data
- 'my-data',
- 'your-data',
- // Data from *this* node
- 'my-external-ip',
- 'my-internal-ip',
- 'my-tcp-port',
- 'my-udp-port',
- 'my-session-id',
- 'my-status',
- // Data from other node
- 'your-external-ip',
- 'your-internal-ip',
- 'your-session-id',
- // Answer status (code)
- 'answer-status'
);
/**
protected function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
+
+ // Init sub-nodes array
+ $this->subNodes = array(
+ // These nodes don't contain any data
+ 'my-data',
+ 'your-data',
+ // 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_NODE_STATUS,
+ self::ANNOUNCEMENT_DATA_NODE_STATUS,
+ // Data from other node
+ 'your-external-ip',
+ 'your-internal-ip',
+ 'your-session-id',
+ // Answer status (code)
+ self::ANNOUNCEMENT_DATA_ANSWER_STATUS
+ );
}
/**
*/
private function startMyExternalIp () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('announcement_answer', 'my-external-ip');
+ $this->getStackerInstance()->pushNamed('announcement_answer', self::ANNOUNCEMENT_DATA_EXTERNAL_IP);
}
/**
*/
private function startMyInternalIp () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('announcement_answer', 'my-internal-ip');
+ $this->getStackerInstance()->pushNamed('announcement_answer', self::ANNOUNCEMENT_DATA_INTERNAL_IP);
}
/**
*/
private function startMyTcpPort () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('announcement_answer', 'my-tcp-port');
+ $this->getStackerInstance()->pushNamed('announcement_answer', self::ANNOUNCEMENT_DATA_TCP_PORT);
}
/**
*/
private function startMyUdpPort () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('announcement_answer', 'my-udp-port');
+ $this->getStackerInstance()->pushNamed('announcement_answer', self::ANNOUNCEMENT_DATA_UDP_PORT);
}
/**
*/
private function startMySessionId () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('announcement_answer', 'my-session-id');
+ $this->getStackerInstance()->pushNamed('announcement_answer', self::ANNOUNCEMENT_DATA_SESSION_ID);
}
/**
*/
private function startMyStatus () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('announcement_answer', 'my-status');
+ $this->getStackerInstance()->pushNamed('announcement_answer', self::ANNOUNCEMENT_DATA_NODE_STATUS);
}
/**
*/
private function startAnswerStatus () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('announcement_answer', 'answer-status');
+ $this->getStackerInstance()->pushNamed('announcement_answer', self::ANNOUNCEMENT_DATA_ANSWER_STATUS);
}
/**