/**
* Universal node locator of bootstrap node
*/
- private $bootUniversalNodeLocator = '';
+ private $bootUnlInstance = '';
/**
* Whether this node is anncounced (keep on FALSE!)
/**
* Getter for boot IP/port combination
*
- * @return $bootUniversalNodeLocator The IP/port combination of the boot node
+ * @return $bootUnlInstance The IP/port combination of the boot node
*/
protected final function getBootUniversalNodeLocator () {
- return $this->bootUniversalNodeLocator;
+ return $this->bootUnlInstance;
}
/**
$isFound = FALSE;
// Run through all configured IPs
- foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $unl) {
- // Get back an array from the UNL
- $unlArray = HubTools::getArrayFromUniversalNodeLocator($unl);
+ foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $unlArray) {
// @TODO Unfinished
die(__METHOD__ . ':' . print_r($unlArray, TRUE));
// Found it!
$isFound = TRUE;
- // Remember the port number
- $this->bootUniversalNodeLocator = $unl;
+ // Remember the UNL array
+ $this->bootUnlInstance = $unlArray;
// Output message
- self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __METHOD__ . ':' . __LINE__ . ']: IP matches remote address ' . $unl . '.');
+ self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __METHOD__ . ':' . __LINE__ . ']: IP matches remote address ' . $unlArray->__toString() . '.');
// Stop further searching
break;
$isFound = TRUE;
// Remember the port number
- $this->bootUniversalNodeLocator = $unl;
+ $this->bootUnlInstance = $unlArray;
// Output message
- self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __METHOD__ . ':' . __LINE__ . ']: IP matches listen address ' . $unl . '.');
+ self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __METHOD__ . ':' . __LINE__ . ']: IP matches listen address ' . $unlArray->__toString() . '.');
// Stop further searching
break;
}
/**
- * Determines the Universal Node Locator
+ * Determines an instance of a LocateableNode class
*
- * @return $unl A an Universal Node Locator for this node
+ * @return $unlInstance An instance of a LocateableNode class for this node
*/
public function determineUniversalNodeLocator () {
// Determine UNL based on this node:
// 1) Get discovery class
$discoveryInstance = ObjectFactory::createObjectByConfiguredName('unl_discovery_class');
- // 1) "Determine it
- $unl = $discoveryInstance->discoverUniversalNodeLocatorByNode($this);
+ // 2) "Determine it
+ $unlInstance = $discoveryInstance->discoverUniversalNodeLocatorByNode($this);
- // Return it
- return $unl;
+ // 3) Return it
+ return $unlInstance;
}
/**
- * "Getter" for Universal Node Locator array
+ * "Getter" for an array of an instance of a LocateableNode class
*
- * @return $unlArray An array of the Universal Node Locator for this node
+ * @return $unlArray An array from an instance of a LocateableNode class for this node
*/
public final function getUniversalNodeLocatorArray () {
- // Get Universal Node Locator (UNL)
- $unl = $this->determineUniversalNodeLocator();
+ // Get the Universal Node Locator (UNL) instance
+ $unlInstance = $this->determineUniversalNodeLocator();
// @TODO Unfinished
- die(__METHOD__ . ':' . print_r($unl, TRUE));
+ die(__METHOD__ . ':unlInstance[' . gettype($unlInstance) . ']=' . print_r($unlInstance, TRUE));
// Return it
return $unlArray;