* shared over the whole hub-network. So if the "tag" (let's better say
* object type) isn't found in that XML the package won't be distributed.
*
- * @param $packageData An instance of a DeliverablePackage class
+ * @param $packageInstance An instance of a DeliverablePackage class
* @return void
* @throws InvalidTagException If a provided tag from the package data is invalid
*/
// "Walk" over all tags
foreach ($this->getTags() as $tag) {
// Debug output
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS: Validating tag ' . $tag . ' ...');
+ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TAGS: Validating tag %s ...', $tag));
// Get an array from this tag
$entry = $objectRegistryInstance->getArrayFromKey(XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_NAME, $tag);
} // END - if
// Now save the last discovered protocol/recipient type
- $this->lastProtocol = ProtocolHandlerFactory::createProtocolHandlerFromPackageInstance($packageData);
+ $this->lastProtocol = ProtocolHandlerFactory::createProtocolHandlerFromPackageInstance($packageInstance);
$this->lastRecipientType = $entry[XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_RECIPIENT_TYPE];
} // END - foreach
}
/**
* Chooses the right protocol from given package data
*
- * @param $packageData An instance of a DeliverablePackage class
+ * @param $packageInstance An instance of a DeliverablePackage class
* @return $lastProtocol An instance of the last used HandleableProtocol class
*/
public function chooseProtocolFromPackageInstance (DeliverablePackage $packageInstance) {
// Extract the tags
- $this->extractTagsFromPackageInstance($packageData);
+ $this->extractTagsFromPackageInstance($packageInstance);
// Now we need to verify every single tag
- $this->verifyAllTags($packageData);
+ $this->verifyAllTags($packageInstance);
// Return the last (and only) found protocol (e.g. 'tcp' is very usual)
return $this->lastProtocol;
/**
* Checks whether the given package data is accepted by the listener
*
- * @param $packageData An instance of a DeliverablePackage class
+ * @param $packageInstance An instance of a DeliverablePackage class
* @param $listenerInstance A Listenable instance
* @return $accepts Whether it is accepted
*/
public function ifPackageDataIsAcceptedByListener (DeliverablePackage $packageInstance, Listenable $listenerInstance) {
// Extract the tags
- $this->extractTagsFromPackageInstance($packageData);
+ $this->extractTagsFromPackageInstance($packageInstance);
// Now every single tag needs to be validated
- $this->verifyAllTags($packageData);
+ $this->verifyAllTags($packageInstance);
// Now simply check it out
$accepts = (($this->lastRecipientType == $listenerInstance->getListenerType()) && ($listenerInstance->getListenerType() != 'invalid'));
* @param $resource XML parser resource (currently ignored)
* @param $characters Characters to handle
* @return void
- * @todo Find something useful with this!
*/
public function characterHandler ($resource, $characters) {
// Trim all spaces away
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TAGS: resource[%s]=%s,characters[%s]=%s - CALLED!', gettype($resource), $resource, gettype($characters), $characters));
$characters = trim($characters);
// Is this string empty?
$nodeName = $this->getStackInstance()->getNamed('node_object_registry');
// Is the node name self::OBJECT_TYPE_DATA_NAME?
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TAGS: Checking nodeName=%s ...', $nodeName));
if ($nodeName == self::OBJECT_TYPE_DATA_NAME) {
// Output debug message
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS: Adding object type ' . $characters . ' to registry.');
+ //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS: Adding object type ' . $characters . ' to registry.');
+ $this->objectRegistryInstance->addEntry($nodeName, $characters);
} // END - if
// Add it to the registry
- $this->objectRegistryInstance->addEntry($nodeName, $characters);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS: EXIT!');
}
/**
// Pop the last entry
$this->getStackInstance()->popNamed('node_object_registry');
}
-}
-// [EOF]
-?>
+}