From: Roland Häder Date: Mon, 23 Nov 2020 03:04:31 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e371c89600f13dc8921586f317262ef43cfbcae1;p=hub.git Continued: - renamed $contentMessage to $rawXml as this is the actual content (raw XML, ...) Signed-off-by: Roland Häder --- diff --git a/application/hub/classes/handler/package/class_NetworkPackageHandler.php b/application/hub/classes/handler/package/class_NetworkPackageHandler.php index f5c103848..779dfad0e 100644 --- a/application/hub/classes/handler/package/class_NetworkPackageHandler.php +++ b/application/hub/classes/handler/package/class_NetworkPackageHandler.php @@ -576,7 +576,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei // Create the hash // @TODO md5() is very weak, but it needs to be fast $hash = md5(sprintf(self::CONTENT_CHECKSUM_MASK, - $packageInstance->getContentMessage(), + $packageInstance->getRawXml(), $packageInstance->getSessionId(), $packageInstance->getCompressorExtension() )); @@ -1492,8 +1492,8 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei // Copy data to package instance $packageInstance->setCompressorExtension($decodedContent[self::INDEX_COMPRESSOR_EXTENSION]); - // Package data (aka "message") in BASE64-decoded form but still compressed - $packageInstance->setContentMessage(base64_decode($decodedContent[self::INDEX_PACKAGE_DATA])); + // Raw XML, being BASE64-decoded, still compressed + $packageInstance->setRawXml(base64_decode($decodedContent[self::INDEX_PACKAGE_DATA])); // Tags as an indexed array for "tagging" the message $packageInstance->setContentTags(explode(self::PACKAGE_TAGS_SEPARATOR, $decodedContent[self::INDEX_TAGS])); // Checksum of the _decoded_ data @@ -1509,7 +1509,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei * The checksum is the same, then it can be decompressed safely. The * original message is at this point fully decoded. */ - $packageInstance->setContentMessage($this->getCompressorInstance()->decompressStream($packageInstance->getContentMessage())); + $packageInstance->setRawXml($this->getCompressorInstance()->decompressStream($packageInstance->getRawXml())); // And push it on the next stack $this->getStackInstance()->pushNamed(self::STACKER_NAME_NEW_MESSAGE, $packageInstance); diff --git a/application/hub/classes/package/deliverable/class_PackageData.php b/application/hub/classes/package/deliverable/class_PackageData.php index 72e2dce22..d80e3e984 100644 --- a/application/hub/classes/package/deliverable/class_PackageData.php +++ b/application/hub/classes/package/deliverable/class_PackageData.php @@ -44,7 +44,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera /** * Content message */ - private $contentMessage; + private $rawXml; /** * Content checksum @@ -154,7 +154,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera * @param $packageContent Package content * @return void */ - public function setPackageContent ($packageContent) { + public function setPackageContent (string $packageContent) { $this->packageContent = $packageContent; } @@ -173,7 +173,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera * @param $senderAddress Sender id * @return void */ - public function setSenderAddress ($senderAddress) { + public function setSenderAddress (string $senderAddress) { $this->senderAddress = $senderAddress; } @@ -192,7 +192,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera * @param $senderId Sender id * @return void */ - public function setSenderId ($senderId) { + public function setSenderId (string $senderId) { $this->senderId = $senderId; } @@ -211,7 +211,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera * @param $senderPort Sender port * @return void */ - public function setSenderPort ($senderPort) { + public function setSenderPort (string $senderPort) { $this->senderPort = $senderPort; } @@ -230,7 +230,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera * @param $recipientType Recipient type * @return void */ - public function setRecipientType ($recipientType) { + public function setRecipientType (string $recipientType) { $this->recipientType = $recipientType; } @@ -249,7 +249,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera * @param $recipientId Recipient id * @return void */ - public function setRecipientId ($recipientId) { + public function setRecipientId (string $recipientId) { $this->recipientId = $recipientId; } @@ -268,7 +268,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera * @param $recipientUnl Recipient UNL * @return void */ - public function setRecipientUnl ($recipientUnl) { + public function setRecipientUnl (string $recipientUnl) { $this->recipientUnl = $recipientUnl; } @@ -287,7 +287,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera * @param $status Status * @return void */ - public function setStatus ($status) { + public function setStatus (string $status) { $this->status = $status; } @@ -306,7 +306,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera * @param $contentHash Content hash * @return void */ - public function setContentHash ($contentHash) { + public function setContentHash (string $contentHash) { $this->contentHash = $contentHash; } @@ -332,20 +332,20 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera /** * Getter for content message * - * @return $contentMessage Content message + * @return $rawXml Content message */ - public function getContentMessage () { - return $this->contentMessage; + public function getRawXml () { + return $this->rawXml; } /** * Setter for content message * - * @param $contentMessage Content message + * @param $rawXml Content message * @return void */ - public function setContentMessage ($contentMessage) { - $this->contentMessage = $contentMessage; + public function setRawXml (string $rawXml) { + $this->rawXml = $rawXml; } /** @@ -363,7 +363,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera * @param $contentChecksum Content checksum * @return void */ - public function setContentChecksum ($contentChecksum) { + public function setContentChecksum (string $contentChecksum) { $this->contentChecksum = $contentChecksum; } @@ -373,7 +373,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera * @param $senderPrivateKeyHash The new private key hash * @return void */ - public final function setSenderPrivateKeyHash ($senderPrivateKeyHash) { + public final function setSenderPrivateKeyHash (string $senderPrivateKeyHash) { $this->senderPrivateKeyHash = $senderPrivateKeyHash; } @@ -439,7 +439,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera * @param $compressorExtension Compressor extension * @return void */ - public function setCompressorExtension ($compressorExtension) { + public function setCompressorExtension (string $compressorExtension) { $this->compressorExtension = $compressorExtension; }