From: Roland Häder Date: Tue, 21 Aug 2012 14:14:43 +0000 (+0000) Subject: Typo in node-mode in XML, adding missing methods, class constant, array element X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=82599f5c47414a313750ed338c5e78fc0e1e7cdb;p=hub.git Typo in node-mode in XML, adding missing methods, class constant, array element --- diff --git a/application/hub/exceptions/announcement/class_AnnouncementNotAcceptedException.php b/application/hub/exceptions/announcement/class_AnnouncementNotAcceptedException.php index 1879cef23..072f86ade 100644 --- a/application/hub/exceptions/announcement/class_AnnouncementNotAcceptedException.php +++ b/application/hub/exceptions/announcement/class_AnnouncementNotAcceptedException.php @@ -32,7 +32,7 @@ class AnnouncementNotAcceptedException extends FrameworkException { */ public function __construct (array $messageArray, $code) { // Construct the message - $message = sprintf("[%s:%d] This node (%s) is not accepting announcements, but got one from session-id=%s,ip=%s/%s,tcp.port=%s,udp.port=%s,status=%s.", + $message = sprintf("[%s:%d] This node (%s) is not accepting announcements, but got one from session-id=%s,ip=%s/%s,tcp.port=%s,udp.port=%s,status=%s,mode=%s", $messageArray[0]->__toString(), $this->getLine(), $messageArray[1]->__toString(), @@ -41,7 +41,8 @@ class AnnouncementNotAcceptedException extends FrameworkException { $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP], $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT], $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT], - $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS] + $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS], + $messageArray[2][XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_MODE] ); // Call parent exception constructor diff --git a/application/hub/main/filter/tags/class_PackageAnnouncementTagFilter.php b/application/hub/main/filter/tags/class_PackageAnnouncementTagFilter.php index c17b23939..3593f5236 100644 --- a/application/hub/main/filter/tags/class_PackageAnnouncementTagFilter.php +++ b/application/hub/main/filter/tags/class_PackageAnnouncementTagFilter.php @@ -36,6 +36,7 @@ class PackageAnnouncementTagFilter extends BaseNodeFilter implements FilterableP XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => '', XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => '', XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS => '', + XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_MODE => '', XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID => '', XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT => 9060, XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT => 9060 diff --git a/application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php b/application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php index cefe09168..357f9e372 100644 --- a/application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php +++ b/application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php @@ -39,6 +39,7 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP, XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP, XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS, + XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_MODE, XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID, XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT, XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT diff --git a/application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php b/application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php index 224014728..0f56e9bcf 100644 --- a/application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php +++ b/application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php @@ -28,6 +28,7 @@ class XmlAnnouncementTemplateEngine extends BaseTemplateEngine implements Compil */ const ANNOUNCEMENT_DATA_SESSION_ID = 'session-id'; const ANNOUNCEMENT_DATA_NODE_STATUS = 'node-status'; + const ANNOUNCEMENT_DATA_NODE_MODE = 'node-mode'; const ANNOUNCEMENT_DATA_EXTERNAL_IP = 'external-ip'; const ANNOUNCEMENT_DATA_INTERNAL_IP = 'internal-ip'; const ANNOUNCEMENT_DATA_TCP_PORT = 'tcp-port'; @@ -352,6 +353,16 @@ class XmlAnnouncementTemplateEngine extends BaseTemplateEngine implements Compil $this->getStackerInstance()->pushNamed('announcement', self::ANNOUNCEMENT_DATA_NODE_STATUS); } + /** + * Starts the node-mode + * + * @return void + */ + private function startNodeMode () { + // Push the node name on the stacker + $this->getStackerInstance()->pushNamed('announcement', self::ANNOUNCEMENT_DATA_NODE_MODE); + } + /** * Starts the listener * @@ -512,6 +523,16 @@ class XmlAnnouncementTemplateEngine extends BaseTemplateEngine implements Compil $this->getStackerInstance()->popNamed('announcement'); } + /** + * Finishes the node mode + * + * @return void + */ + private function finishNodeMode () { + // Pop the last entry + $this->getStackerInstance()->popNamed('announcement'); + } + /** * Finishes the node status * diff --git a/application/hub/templates/xml/announcement/self_announcement.xml b/application/hub/templates/xml/announcement/self_announcement.xml index ce17c7ad2..542e60a48 100644 --- a/application/hub/templates/xml/announcement/self_announcement.xml +++ b/application/hub/templates/xml/announcement/self_announcement.xml @@ -28,7 +28,7 @@ along with this program. If not, see {?node_status?} - {?node_default_mode?} + {?node_default_mode?} {?session_id?} diff --git a/application/hub/templates/xml/requests/node_request_node_list.xml b/application/hub/templates/xml/requests/node_request_node_list.xml index f219b4926..c89e592e3 100644 --- a/application/hub/templates/xml/requests/node_request_node_list.xml +++ b/application/hub/templates/xml/requests/node_request_node_list.xml @@ -23,4 +23,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see //--> + + {?accepted_object_types?}