]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 21 Aug 2020 18:32:08 +0000 (20:32 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 21 Aug 2020 18:32:08 +0000 (20:32 +0200)
- fixed name for factory and also "imported" it
- added missing properties $contentHash and $packageContent with setters and getters

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/handler/package/class_NetworkPackageHandler.php
application/hub/classes/listener/class_BaseListener.php
application/hub/classes/package/deliverable/class_PackageData.php

index 92259970bf1a131876ffa165f70b78e288d5fe5c..32a52e256e37402e127648162d966e6e5b366d72 100644 (file)
@@ -12,6 +12,7 @@ use Org\Shipsimu\Hub\Factory\Discovery\Socket\SocketDiscoveryFactory;
 use Org\Shipsimu\Hub\Factory\FilterChain\Package\PackageFilterChainFactory;
 use Org\Shipsimu\Hub\Factory\Handler\Message\MessageTypeHandlerFactory;
 use Org\Shipsimu\Hub\Factory\Information\Connection\ConnectionInfoFactory;
+use Org\Shipsimu\Hub\Factory\Network\PackageDataFactory;
 use Org\Shipsimu\Hub\Factory\Node\NodeObjectFactory;
 use Org\Shipsimu\Hub\Handler\BaseHubHandler;
 use Org\Shipsimu\Hub\Handler\Network\RawData\HandleableRawData;
@@ -831,7 +832,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                assert($this->getSessionId() != '');
 
                // Init package instance
-               $packageInstance = PackageDataFactory::createDeliverPackageInstance();
+               $packageInstance = PackageDataFactory::createPackageDataInstance();
 
                // Set all data
                $packageInstance->setSenderAddress($this->getSessionId());
index 82380b976601c32b1059dfc7086d6d95c3455640..da6171ce0472122e2a9810e199a98f9a30358262 100644 (file)
@@ -403,7 +403,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                //* DEBUG-DIE: */ $infoInstance->debugInstance();
 
                // Create a faked package data instance
-               $packageInstance = DeliverPackageFactory::createDeliverPackageInstance();
+               $packageInstance = PackageDataFactory::createPackageDataInstance();
 
                // Set all required data
                $packageInstance->setSenderAddres($peerAddress . $peerSuffix);
index dc938bc618b227dc732f6571e5051d4ad24c4574..a76158e4e97cd407725506bb5d1e2e81313ca582 100644 (file)
@@ -35,6 +35,16 @@ use \SplFileInfo;
  */
 class PackageData extends BaseHubSystem implements DeliverablePackage, Registerable {
 
+       /**
+        * Content hash
+        */
+       private $contentHash;
+
+       /**
+        * Package content
+        */
+       private $packageContent;
+
        /**
         * An instance of a SplFileInfo class
         */
@@ -90,7 +100,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera
        /**
         * Getter for socket type
         *
-        * @return      $socketFile     Stocket type
+        * @return      $socketType             Stocket type
         */
        public function getSocketType () {
                return $this->socketType;
@@ -99,11 +109,49 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera
        /**
         * Setter for socket type
         *
-        * @param       $socketType     Socket type
+        * @param       $socketType             Socket type
         * @return      void
         */
        public function setSocketType ($socketType) {
                $this->socketType = $socketType;
        }
 
+       /**
+        * Getter for package content
+        *
+        * @return      $packageContent         Package content
+        */
+       public function getPackageContent () {
+               return $this->packageContent;
+       }
+
+       /**
+        * Setter for package content
+        *
+        * @param       $packageContent         Package content
+        * @return      void
+        */
+       public function setPackageContent ($packageContent) {
+               $this->packageContent = $packageContent;
+       }
+
+       /**
+        * Getter for content hash
+        *
+        * @return      $contentHash    Content hash
+        */
+       public function getContentHash () {
+               return $this->contentHash;
+       }
+
+       /**
+        * Setter for content hash
+        *
+        * @param       $contentHash    Content hash
+        * @return      void
+        */
+       public function setContentHash ($contentHash) {
+               $this->contentHash = $contentHash;
+       }
+
 }