* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class BaseHubNode extends BaseHubSystem implements Updateable {
+ /**
+ * Node types
+ */
+ const NODE_TYPE_BOOT = 'boot';
+ const NODE_TYPE_MASTER = 'master';
+ const NODE_TYPE_LIST = 'list';
+ const NODE_TYPE_REGULAR = 'regular';
+
// Exception constants
const EXCEPTION_HUB_ALREADY_ANNOUNCED = 0xe00;
break;
} elseif ($ipPortArray[0] == $this->getConfigInstance()->getConfigEntry('node_listen_addr')) {
// IP matches listen address. At this point we really don't care
- // if we can also listen on that address!
+ // if we can really listen on that address
$isFound = true;
// Remember the port number
* @param $responseInstance A Responseable class
* @return void
*/
- public function bootstrapAcquireHubId (Requestable $requestInstance, Responseable $responseInstance) {
+ public function bootstrapAcquireNodeId (Requestable $requestInstance, Responseable $responseInstance) {
// Get a wrapper instance
$wrapperInstance = ObjectFactory::createObjectByConfiguredName('node_info_db_wrapper_class');
// Get a crypto instance
$cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
- // Hash and encrypt the string so we become a "node id" aka Hub-Id
+ // Hash and encrypt the string so we become a node id (also documented as "hub id")
$this->setNodeId($cryptoInstance->hashString($cryptoInstance->encryptString($randomString)));
// Register the node id with our wrapper
* @param $responseInstance A Responseable class
* @return void
*/
- public function activateHub (Requestable $requestInstance, Responseable $responseInstance) {
+ public function activateNode (Requestable $requestInstance, Responseable $responseInstance) {
// Checks wether a listener is still active and shuts it down if one
// is still listening.
if (($this->determineIfListenerIsActive()) && ($this->getIsActive())) {