]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 7 Nov 2020 16:46:44 +0000 (17:46 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 7 Nov 2020 16:48:26 +0000 (17:48 +0100)
- re-added $databaseInstance from monolithic BaseFrameworkSystem
- BaseFrameworkSystem->hex2dec() has moved to StringUtils::hex2dec()
- updated core framework

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/compressor/decorator/class_NetworkPackageCompressorDecorator.php
application/hub/classes/handler/package/class_NetworkPackageHandler.php
application/hub/classes/package/fragmenter/class_PackageFragmenter.php
core

index d2a5ac585739963eba9a5ac3e3f445075e331c2c..927947d1a87be0a34349054327ee51a67577bc0d 100644 (file)
@@ -32,6 +32,11 @@ use Org\Mxchange\CoreFramework\Compressor\Compressor;
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 class NetworkPackageCompressorDecorator extends BaseHubSystem implements Compressor {
+       /**
+        * A Compressor instance
+        */
+       private $compressorInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -59,6 +64,25 @@ class NetworkPackageCompressorDecorator extends BaseHubSystem implements Compres
                return $compressorInstance;
        }
 
+       /**
+        * Setter for compressor instance
+        *
+        * @param       $compressorInstance             An instance of a Compressor class
+        * @return      void
+        */
+       protected final function setCompressorInstance (Compressor $compressorInstance) {
+               $this->compressorInstance = $compressorInstance;
+       }
+
+       /**
+        * Getter for compressor instance
+        *
+        * @return      $compressorInstance             An instance of a Compressor class
+        */
+       private final function getCompressorInstance () {
+               return $this->compressorInstance;
+       }
+
        /**
         * A compression stream
         *
index ab25ee0157bdede6f52a6d2389f3b2dfc5fc98f4..8c6388360b8acbce88129b694e3805b2b287a3e1 100644 (file)
@@ -309,6 +309,11 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
        const EXCEPTION_UNEXPECTED_PACKAGE_STATUS = 0xff00;
        const EXCEPTION_INVALID_DATA_CHECKSUM     = 0xff01;
 
+       /**
+        * A Compressor instance
+        */
+       private $compressorInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -380,6 +385,25 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                return $packageInstance;
        }
 
+       /**
+        * Setter for compressor instance
+        *
+        * @param       $compressorInstance             An instance of a Compressor class
+        * @return      void
+        */
+       protected final function setCompressorInstance (Compressor $compressorInstance) {
+               $this->compressorInstance = $compressorInstance;
+       }
+
+       /**
+        * Getter for compressor instance
+        *
+        * @return      $compressorInstance             An instance of a Compressor class
+        */
+       private final function getCompressorInstance () {
+               return $this->compressorInstance;
+       }
+
        /**
         * Initialize all stackers
         *
index 5bfde6e7d736cd3600c176aaa0e01e02d11a731c..87ca2eb7fa9427011ee567008d411e2ee9f4dc5c 100644 (file)
@@ -13,6 +13,7 @@ use Org\Mxchange\CoreFramework\Assertion\AssertionException;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\Utils\String\StringUtils;
 
 /**
  * A PackageFragmenter class to fragment package data into smaller chunks for
@@ -154,7 +155,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
                $this->chunkSize = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('package_chunk_size');
 
                // - Maximum serial number
-               $this->maxSerialNumber = $this->hex2dec(str_repeat('f', self::MAX_SERIAL_LENGTH));
+               $this->maxSerialNumber = StringUtils::hex2dec(str_repeat('f', self::MAX_SERIAL_LENGTH));
 
                // Trace message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER: EXIT!');
@@ -474,7 +475,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
 
                // Encode the current serial number
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER: serialNumber[' . $finalHash . ']=' . $this->serialNumber[$finalHash]);
-               $encodedSerialNumber = $this->dec2Hex($this->serialNumber[$finalHash], self::MAX_SERIAL_LENGTH);
+               $encodedSerialNumber = StringUtils::dec2hex($this->serialNumber[$finalHash], self::MAX_SERIAL_LENGTH);
 
                // Count one up
                $this->serialNumber[$finalHash]++;
diff --git a/core b/core
index 3b182d1633e936618e118773da67fa41b24a6109..dd1cef3878259d544e9853b1c0f5abca1f0d99b1 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 3b182d1633e936618e118773da67fa41b24a6109
+Subproject commit dd1cef3878259d544e9853b1c0f5abca1f0d99b1