/**
* Query connector instance
*/
- private $queryInstance = null;
+ private $connectorInstance = null;
/**
* Listener pool instance
return $this->nodeId;
}
+ /**
+ * Setter for listener pool instance
+ *
+ * @param $listenerPoolInstance Our new listener pool instance
+ * @return void
+ */
+ private final function setListenerPoolInstance (PoolableListener $listenerPoolInstance) {
+ $this->listenerPoolInstance = $listenerPoolInstance;
+ }
+
+ /**
+ * Getter for listener pool instance
+ *
+ * @return $listenerPoolInstance Our current listener pool instance
+ */
+ public final function getListenerPoolInstance () {
+ return $this->listenerPoolInstance;
+ }
+
/**
* Setter for session id
*
*
* @return $sessionId Our new session id
*/
- private final function getSessionId () {
+ public final function getSessionId () {
return $this->sessionId;
}
/**
* Setter for query instance
*
- * @param $queryInstance Our new query instance
+ * @param $connectorInstance Our new query instance
* @return void
*/
- private final function setQueryInstance (Queryable $queryInstance) {
- $this->queryInstance = $queryInstance;
+ private final function setQueryConnectorInstance (Connectable $connectorInstance) {
+ $this->connectorInstance = $connectorInstance;
}
/**
* Getter for query instance
*
- * @return $queryInstance Our new query instance
+ * @return $connectorInstance Our new query instance
+ */
+ public final function getQueryConnectorInstance () {
+ return $this->connectorInstance;
+ }
+
+ /**
+ * Getter for boot IP/port combination
+ *
+ * @return $bootIpPort The IP/port combination of the boot node
*/
- protected final function getQueryInstance () {
- return $this->queryInstance;
+ protected final function getBootIpPort () {
+ return $this->bootIpPort;
}
/**
$this->debugOutput('BOOTSTRAP: Created new session-id: ' . $this->getSessionId() . '');
}
- /**
- * Getter for boot IP/port combination
- *
- * @return $bootIpPort The IP/port combination of the boot node
- */
- protected final function getBootIpPort () {
- return $this->bootIpPort;
- }
-
/**
* Initializes queues which every node needs
*
$this->debugOutput('BOOTSTRAP: Initialize queues: START');
// Set the query connector instance
- $this->setQueryInstance(ObjectFactory::createObjectByConfiguredName('query_connector_class', array($this)));
+ $this->setQueryConnectorInstance(ObjectFactory::createObjectByConfiguredName('query_connector_class', array($this)));
// Run a test query
- $this->getQueryInstance()->doTestQuery();
+ $this->getQueryConnectorInstance()->doTestQuery();
// Debug message
$this->debugOutput('BOOTSTRAP: Initialize queues: FINISHED');
}
-
+
+ /**
+ * Publish our hub descriptor to the upper hub(s)
+ *
+ * @return void
+ * @todo This should be implemented in a generic way to keep things easy.
+ */
+ protected function publishHubDescriptor () {
+ $this->partialStub('Unfinished method.');
+ }
+
/**
* Adds hub data elements to a given dataset instance
*
$controllerInstance = Registry::getRegistry()->getInstance('controller');
// Run all filters for the hub activation
- $controllerInstance->executeHubActivationFilters($requestInstance, $responseInstance);
+ $controllerInstance->executeActivationFilters($requestInstance, $responseInstance);
// ----------------------- Last step from here ------------------------
// Activate the hub. This is ALWAYS the last step in this method
$this->debugOutput('HUB: Initialize listener: START');
// Get a new pool instance
- $this->listenerPoolInstance = ObjectFactory::createObjectByConfiguredName('listener_pool_class', array($this));
+ $this->setListenerPoolInstance(ObjectFactory::createObjectByConfiguredName('listener_pool_class', array($this)));
// Get an instance of the low-level listener
$listenerInstance = ObjectFactory::createObjectByConfiguredName('tcp_listener_class', array($this));
$decoratorInstance = ObjectFactory::createObjectByConfiguredName('hub_tcp_listener_class', array($listenerInstance));
// Add this listener to the pool
- $this->listenerPoolInstance->addListener($decoratorInstance);
+ $this->getListenerPoolInstance()->addListener($decoratorInstance);
// Get a decorator class
$decoratorInstance = ObjectFactory::createObjectByConfiguredName('client_tcp_listener_class', array($listenerInstance));
// Add this listener to the pool
- $this->listenerPoolInstance->addListener($decoratorInstance);
+ $this->getListenerPoolInstance()->addListener($decoratorInstance);
// Get an instance of the low-level listener
$listenerInstance = ObjectFactory::createObjectByConfiguredName('udp_listener_class', array($this));
$decoratorInstance = ObjectFactory::createObjectByConfiguredName('hub_udp_listener_class', array($listenerInstance));
// Add this listener to the pool
- $this->listenerPoolInstance->addListener($decoratorInstance);
+ $this->getListenerPoolInstance()->addListener($decoratorInstance);
// Get a decorator class
$decoratorInstance = ObjectFactory::createObjectByConfiguredName('client_udp_listener_class', array($listenerInstance));
// Add this listener to the pool
- $this->listenerPoolInstance->addListener($decoratorInstance);
+ $this->getListenerPoolInstance()->addListener($decoratorInstance);
// Debug output
$this->debugOutput('HUB: Initialize listener: FINISHED.');
if ($resultInstance->next()) {
$this->partialStub('Do something for restoring the list.');
// Output message
- //$this->debugOutput('BOOTSTRAP: ');
- } // END - if
+ //$this->debugOutput('HUB: ');
+ } else {
+ // No previously saved node list found!
+ $this->debugOutput('HUB: No previously saved node list found. This is fine.');
+ }
// Debug output
$this->debugOutput('HUB: Restore node list: FINISHED.');