application/hub/main/filter/task/node/.htaccess svneol=native#text/plain
application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php svneol=native#text/plain
application/hub/main/handler/.htaccess -text svneol=unset#text/plain
+application/hub/main/handler/answer-status/.htaccess -text svneol=unset#text/plain
+application/hub/main/handler/answer-status/announcement/.htaccess -text svneol=unset#text/plain
+application/hub/main/handler/answer-status/class_ svneol=native#text/plain
+application/hub/main/handler/answer-status/class_BaseAnserStatusHandler.php svneol=native#text/plain
application/hub/main/handler/chunks/.htaccess -text svneol=unset#text/plain
application/hub/main/handler/chunks/class_ChunkHandler.php svneol=native#text/plain
application/hub/main/handler/class_ svneol=native#text/plain
// CFG: PEER-NO-ROUTE-TO-HOST-STATE-CLASS
$cfg->setConfigEntry('peer_no_route_to_host_state_class', 'NoRouteToHostPeerState');
+///////////////////////////////////////////////////////////////////////////////
+// Message answer-status handler
+///////////////////////////////////////////////////////////////////////////////
+
+// CFG: ANNOUNCEMENT-ANSWER-STATUS-OKAY-HANDLER-CLASS
+$cfg->setConfigEntry('announcement_answer_status_okay_handler_class', 'AnnouncementAnswerOkayHandler');
+
///////////////////////////////////////////////////////////////////////////////
// Cruncher configuration
///////////////////////////////////////////////////////////////////////////////
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A ??? handler
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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 ???Handler extends BaseAnserStatusHandler implements HandleableAnswerStatus, Registerable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set handler name
+ $this->setHandlerName('answer_===');
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $handlerInstance An instance of a HandleableMessage class
+ */
+ public final static function create???Handler () {
+ // Get new instance
+ $handlerInstance = new ???Handler();
+
+ // Return the prepared instance
+ return $handlerInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A general answer-status handler. So called "answer-status handler" are
+ * classes which handles a message field 'answer-status' which is, alongside
+ * many other node-relevant data, the main part of the answer message. These
+ * answer messages, by the way, are never sent unrequested. This, however,
+ * sounds logical because the answer is a reply from a node that has responded
+ * on a message.
+ *
+ * The answer-status field gives information back to the requesting node if the
+ * receiving node could handle the message properly (all verfication steps are
+ * passed, message type was understood, correct receiver, et cetera) and how
+ * it handles it. Some messages may be rejected, e.g. when the requesting node
+ * is blacklisted or its behavour has changed.
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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 BaseAnserStatusHandler extends BaseHandler {
+ /**
+ * Last exception instance from database layer or NULL (default)
+ */
+ private $lastException = NULL;
+
+ /**
+ * Protected constructor
+ *
+ * @param $className Name of the class
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+ }
+
+ /**
+ * Getter for last exception
+ *
+ * @return $lastException Last thrown exception
+ */
+ protected final function getLastException () {
+ return $this->lastException;
+ }
+}
+
+// [EOF]
+?>
*
* @param $messageData A valid answer message data array
* @return void
+ * @todo Handle thrown exception
*/
public function handleAnswerStatusByMessageData (array $messageData) {
- exit('messageData=' . print_r($messageData, true));
+ // Construct configuration entry for handling class' name
+ $classConfigEntry = strtolower($messageData[NetworkPackage::MESSAGE_ARRAY_TYPE] . '_status_' . $messageData[XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_ANSWER_STATUS]) . '_handler_class';
+
+ // Try to get a class
+ $handlerInstance = ObjectFactory::createObjectByConfiguredName($classConfigEntry);
+
+ // Handle it there
+ $handlerInstance->handleAnswerMessageData($messageData);
}
}