+ /**
+ * Generates a session id which will be sent to the other hubs and clients
+ *
+ * @return void
+ */
+ public function bootstrapGenerateSessionId () {
+ // Get an RNG instance
+ $rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class');
+
+ // Generate a pseudo-random string
+ $randomString = $rngInstance->randomString(255) . ':' . $this->getBootIpPort() . ':' . $this->getRequestInstance()->getRequestElement('mode');
+
+ // Get a crypto instance
+ $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+
+ // Hash and encrypt the string so we become a "node id" aka Hub-Id
+ $this->setSessionId($cryptoInstance->hashString($cryptoInstance->encryptString($randomString)));
+
+ // Get a wrapper instance
+ $wrapperInstance = ObjectFactory::createObjectByConfiguredName('node_info_db_wrapper_class');
+
+ // Register the node id with our wrapper
+ $wrapperInstance->registerNodeId($this, $this->getRequestInstance());
+
+ // Output message
+ $this->debugOutput('BOOTSTRAP: Created new session-id: ' . $this->getSessionId() . '');
+ }
+