3 namespace Org\Mxchange\CoreFramework\Handler;
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
7 use Org\Mxchange\CoreFramework\Handler\DataSet\HandleableDataSet;
8 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
13 * @author Roland Haeder <webmaster@shipsimu.org>
15 <<<<<<< HEAD:framework/main/classes/handler/class_BaseHandler.php
16 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
18 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
19 >>>>>>> Some updates::inc/main/classes/handler/class_BaseHandler.php
20 * @license GNU GPL 3.0 or any newer version
21 * @link http://www.shipsimu.org
23 * This program is free software: you can redistribute it and/or modify
24 * it under the terms of the GNU General Public License as published by
25 * the Free Software Foundation, either version 3 of the License, or
26 * (at your option) any later version.
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
33 * You should have received a copy of the GNU General Public License
34 * along with this program. If not, see <http://www.gnu.org/licenses/>.
36 abstract class BaseHandler extends BaseFrameworkSystem implements HandleableDataSet {
40 private $handlerName = 'invalid';
43 * Protected constructor
45 * @param $className Name of the class
48 protected function __construct ($className) {
49 // Call parent constructor
50 parent::__construct($className);
54 * Getter for handler name
56 * @return $handlerName Name of this handler
58 public final function getHandlerName () {
59 return $this->handlerName;
63 * Setter for handler name
65 * @param $handlerName Name of this handler
68 protected final function setHandlerName ($handlerName) {
69 $this->handlerName = $handlerName;
73 * Adds all required elements from given array into data set instance
75 * @param $dataSetInstance An instance of a StoreableCriteria class
76 * @param $messageData An array with all message data
78 * @todo Rewrite this to use DHT
80 public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData) {
81 // Add some generic data all messageData arrays provide
83 $dataSetInstance->addCriteria(NodeListDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $messageData[BaseXmlAnswerTemplateEngine::ANSWER_STATUS]);
84 $dataSetInstance->addCriteria(NodeListDatabaseWrapper::DB_COLUMN_MESSAGE_TYPE , $messageData[NetworkPackage::MESSAGE_ARRAY_TYPE]);