]> git.mxchange.org Git - hub.git/commitdiff
Typo in node-mode in XML, adding missing methods, class constant, array element
authorRoland Häder <roland@mxchange.org>
Tue, 21 Aug 2012 14:14:43 +0000 (14:14 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 21 Aug 2012 14:14:43 +0000 (14:14 +0000)
application/hub/exceptions/announcement/class_AnnouncementNotAcceptedException.php
application/hub/main/filter/tags/class_PackageAnnouncementTagFilter.php
application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php
application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php
application/hub/templates/xml/announcement/self_announcement.xml
application/hub/templates/xml/requests/node_request_node_list.xml

index 1879cef238b5399954d0afbb25ea65a286b36dd7..072f86ade0d2384c33694b599e05afba8cdb5f4c 100644 (file)
@@ -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
index c17b239394173d38db3b22e58c1bdf21eb6249c1..3593f52368cfc768da7ae2214ad9ed0b70dc98e0 100644 (file)
@@ -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
index cefe0916810a29755e1f42462499e416ec7e7877..357f9e372fac24ffad2df632cb1fa2f86ecab69d 100644 (file)
@@ -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
index 224014728671107eff9233ecd792eae0eaead2bf..0f56e9bcfd7ecf1f897e1865a7c17607df324d1b 100644 (file)
@@ -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
         *
index ce17c7ad2a98550e157baa6147206b057522b137..542e60a48acd62814609dd98341d2babcc680880 100644 (file)
@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
                <!-- Status of this node, see node_status.xml for details. //-->
                <node-status>{?node_status?}</node-status>
                <!-- Node mode: regular, master, list, boot again //-->
-               <node-status>{?node_default_mode?}</node-status>
+               <node-mode>{?node_default_mode?}</node-mode>
                <!-- The session id. This should be announced to all other hubs. //-->
                <session-id>{?session_id?}</session-id>
                <!-- Data from our listeners (e.g. which port) //-->
index f219b4926d5ac9a417dec129f5b17883509afa88..c89e592e3a40b3122b5ed86d1fb18c5487e64041 100644 (file)
@@ -23,4 +23,9 @@ You should have received a copy of the GNU General Public License
 along with this program. If not, see <http://www.gnu.org/licenses/>
 //-->
 <node-request-node-list>
+       <!--
+       All accepted object types as a comma-separted list this node is accepting
+       to share (even master nodes may not accept all types of objects.
+       //-->
+       <accepted-object-types>{?accepted_object_types?}</accepted-object-types>
 </node-request-node-list>