return $wrapperInstance;
}
+ /**
+ * "Getter" for a LocalSearchCriteria from given package data's sender
+ *
+ * @param $packageData Valid raw package data array
+ * @return $searchInstance An instance of a LocalSearchCriteria class
+ */
+ private function getSenderSearchInstanceFromPackageData (array $packageData) {
+ // Get the instance
+ //* NOISY-DEBUG: */ $this->debugOutput('DATABASE-WRAPPER: Searching for sender ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER]);
+ $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+
+ // Add 'sender' as the peer's IP address
+ $searchInstance->addCriteria(self::DB_COLUMN_PEER_SESSION_ID, $packageData[NetworkPackage::PACKAGE_DATA_SENDER]);
+ $searchInstance->setLimit(1);
+
+ // Return the instance
+ return $searchInstance;
+ }
+
/**
* Getter for index key
*
// Is the package valid?
if (!isset($packageData[NetworkPackage::PACKAGE_DATA_SENDER])) {
// Invalid package found, please report this
- die(__METHOD__ . ': packageData=' . print_r($packageData, true));
+ $this->debugBackTrace(__METHOD__ . ': packageData=' . print_r($packageData, true));
} // END - if
- // Get a search criteria instance
- //* NOISY-DEBUG: */ $this->debugOutput('DATABASE-WRAPPER: Searching for sender ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER]);
- $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
-
- // Add 'sender' as the peer's IP address
- $searchInstance->addCriteria(self::DB_COLUMN_PEER_SESSION_ID, $packageData[NetworkPackage::PACKAGE_DATA_SENDER]);
- $searchInstance->setLimit(1);
+ // Get a search criteria instance from package data
+ $searchInstance = $this->getSenderSearchInstanceFromPackageData($packageData);
// Is the dataset instance set?
if ($dataSetInstance instanceof StoreableCriteria) {
} catch (ClassNotFoundException $e) {
// This exception means, the cruncher mode is invalid.
// @TODO Can we rewrite this to app_die() ?
- die(__METHOD__ . ': cruncher mode ' . $cruncherMode . ' is invalid.' . "\n");
+ $this->debugBackTrace(__METHOD__ . ': cruncher mode ' . $cruncherMode . ' is invalid.' . "\n");
}
// Set the cruncher instance in registry
} catch (ClassNotFoundException $e) {
// This exception means, the node mode is invalid.
// @TODO Can we rewrite this to app_die() ?
- die(__METHOD__ . ': node mode ' . $nodeMode . ' is invalid.' . "\n");
+ $this->debugBackTrace(__METHOD__ . ': node mode ' . $nodeMode . ' is invalid.' . "\n");
}
// Set the node instance in registry
* @return $socketResource Socket resource
*/
public static function createConnectionFromPackageData (array $packageData) {
- die(__METHOD__ . ': Unfinished method, packageData[]=' . count($packageData) . "\n");
+ $this->debugBackTrace(__METHOD__ . ': Unfinished method, packageData[]=' . count($packageData) . "\n");
}
/**
*
* @return void
* @throws SocketShutdownException If the current socket could not be shut down
- * @todo We may want to implement a filter for ease notification of other objects like our pool
+ * @todo Implement a filter for ease notification of other objects like the pool
*/
public function doShutdown () {
$this->partialStub('Please implement this method.');