// 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()
));
// 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
* 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);
/**
* Content message
*/
- private $contentMessage;
+ private $rawXml;
/**
* Content checksum
* @param $packageContent Package content
* @return void
*/
- public function setPackageContent ($packageContent) {
+ public function setPackageContent (string $packageContent) {
$this->packageContent = $packageContent;
}
* @param $senderAddress Sender id
* @return void
*/
- public function setSenderAddress ($senderAddress) {
+ public function setSenderAddress (string $senderAddress) {
$this->senderAddress = $senderAddress;
}
* @param $senderId Sender id
* @return void
*/
- public function setSenderId ($senderId) {
+ public function setSenderId (string $senderId) {
$this->senderId = $senderId;
}
* @param $senderPort Sender port
* @return void
*/
- public function setSenderPort ($senderPort) {
+ public function setSenderPort (string $senderPort) {
$this->senderPort = $senderPort;
}
* @param $recipientType Recipient type
* @return void
*/
- public function setRecipientType ($recipientType) {
+ public function setRecipientType (string $recipientType) {
$this->recipientType = $recipientType;
}
* @param $recipientId Recipient id
* @return void
*/
- public function setRecipientId ($recipientId) {
+ public function setRecipientId (string $recipientId) {
$this->recipientId = $recipientId;
}
* @param $recipientUnl Recipient UNL
* @return void
*/
- public function setRecipientUnl ($recipientUnl) {
+ public function setRecipientUnl (string $recipientUnl) {
$this->recipientUnl = $recipientUnl;
}
* @param $status Status
* @return void
*/
- public function setStatus ($status) {
+ public function setStatus (string $status) {
$this->status = $status;
}
* @param $contentHash Content hash
* @return void
*/
- public function setContentHash ($contentHash) {
+ public function setContentHash (string $contentHash) {
$this->contentHash = $contentHash;
}
/**
* 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;
}
/**
* @param $contentChecksum Content checksum
* @return void
*/
- public function setContentChecksum ($contentChecksum) {
+ public function setContentChecksum (string $contentChecksum) {
$this->contentChecksum = $contentChecksum;
}
* @param $senderPrivateKeyHash The new private key hash
* @return void
*/
- public final function setSenderPrivateKeyHash ($senderPrivateKeyHash) {
+ public final function setSenderPrivateKeyHash (string $senderPrivateKeyHash) {
$this->senderPrivateKeyHash = $senderPrivateKeyHash;
}
* @param $compressorExtension Compressor extension
* @return void
*/
- public function setCompressorExtension ($compressorExtension) {
+ public function setCompressorExtension (string $compressorExtension) {
$this->compressorExtension = $compressorExtension;
}