From 9cb3c72a99fe8d5fe4f5413ec98affc68b125f64 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 23 Jul 2009 20:26:10 +0000 Subject: [PATCH] Bootstrap filters filled with some content (basicly...) --- .../class_HubBootstrapAquireHubIdFilter.php | 8 ++++-- .../class_HubBootstrapGenSessionIdFilter.php | 6 +++-- ...lass_HubBootstrapRestoreNodeListFilter.php | 4 +-- .../hub/main/nodes/boot/class_HubBootNode.php | 3 --- .../hub/main/nodes/class_BaseHubNode.php | 27 ------------------- .../hub/main/nodes/list/class_HubListNode.php | 2 -- .../main/nodes/master/class_HubMasterNode.php | 2 -- .../nodes/regular/class_HubRegularNode.php | 2 -- 8 files changed, 12 insertions(+), 42 deletions(-) diff --git a/application/hub/main/filter/bootstrap/class_HubBootstrapAquireHubIdFilter.php b/application/hub/main/filter/bootstrap/class_HubBootstrapAquireHubIdFilter.php index e8147d77e..7d3fed1bb 100644 --- a/application/hub/main/filter/bootstrap/class_HubBootstrapAquireHubIdFilter.php +++ b/application/hub/main/filter/bootstrap/class_HubBootstrapAquireHubIdFilter.php @@ -63,8 +63,12 @@ class HubBootstrapAquireHubIdFilter extends BaseFilter implements Filterable { throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); } // END - if - // Implement this! - $this->partialStub('Please implement this method.'); + // --------------------- Hub-id acquirement phase --------------------- + // Acquire a hub-id. This step generates on first launch a new one and + // on any later launches it will restore the hub-id from the database. + // A passed 'nickname=xxx' argument will be used to add some + // 'personality' to the hub. + $nodeInstance->bootstrapAcquireHubId(); } } diff --git a/application/hub/main/filter/bootstrap/class_HubBootstrapGenSessionIdFilter.php b/application/hub/main/filter/bootstrap/class_HubBootstrapGenSessionIdFilter.php index 7322119d5..7ebe0957f 100644 --- a/application/hub/main/filter/bootstrap/class_HubBootstrapGenSessionIdFilter.php +++ b/application/hub/main/filter/bootstrap/class_HubBootstrapGenSessionIdFilter.php @@ -63,8 +63,10 @@ class HubBootstrapGenSessionIdFilter extends BaseFilter implements Filterable { throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); } // END - if - // Implement this! - $this->partialStub('Please implement this method.'); + // ------------------- More generic bootstrap steps ------------------- + // Generate the session id which will only be stored in RAM and kept for + // the whole "session". + $nodeInstance->bootstrapGenerateSessionId(); } } diff --git a/application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php b/application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php index 23f60f7df..82ad3c92a 100644 --- a/application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php +++ b/application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php @@ -63,8 +63,8 @@ class HubBootstrapRestoreNodeListFilter extends BaseFilter implements Filterable throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); } // END - if - // Implement this! - $this->partialStub('Please implement this method.'); + // Restore a previously downloaded bootstrap-node list. + $nodeInstance->bootstrapRestoreNodeList(); } } diff --git a/application/hub/main/nodes/boot/class_HubBootNode.php b/application/hub/main/nodes/boot/class_HubBootNode.php index 3f2d9465c..ff55bcd77 100644 --- a/application/hub/main/nodes/boot/class_HubBootNode.php +++ b/application/hub/main/nodes/boot/class_HubBootNode.php @@ -58,9 +58,6 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable { * @todo add some more special bootstrap things for this boot node */ public function doBootstrapping () { - // Call generic (parent) bootstrapping method first - parent::bootstrapGenericBootstrapping(); - // Now check if the IP address matches one of the bootstrap nodes if ($this->ifAddressMatchesBootstrappingNodes($_SERVER['SERVER_ADDR'])) { // Get our port from configuration diff --git a/application/hub/main/nodes/class_BaseHubNode.php b/application/hub/main/nodes/class_BaseHubNode.php index 92d794cc4..ff1cf1306 100644 --- a/application/hub/main/nodes/class_BaseHubNode.php +++ b/application/hub/main/nodes/class_BaseHubNode.php @@ -165,33 +165,6 @@ class BaseHubNode extends BaseHubSystem implements Updateable { $this->debugOutput(' '); } - /** - * Do generic things for bootup phase. This can be e.g. checking if the - * right node mode is selected for this hub's IP number. - * - * @return void - * @todo This method is maybe not yet finished. - */ - protected function bootstrapGenericBootstrapping () { - // --------------------- Hub-id acquirement phase --------------------- - // Acquire a hub-id. This step generates on first launch a new one and - // on any later launches it will restore the hub-id from the database. - // A passed 'nickname=xxx' argument will be used to add some - // 'personality' to the hub. - $this->bootstrapAcquireHubId(); - - // ------------------- More generic bootstrap steps ------------------- - // Generate the session id which will only be stored in RAM and kept for - // the whole "session". - $this->bootstrapGenerateSessionId(); - - // Restore a previously downloaded bootstrap-node list. - $this->bootstrapRestoreNodeList(); - - // @TODO Add some generic bootstrap steps - $this->partialStub('Add some generic bootstrap steps here.'); - } - /** * Generic method to acquire a hub-id. On first run this generates a new one * based on many pseudo-random data. On any later run, unless the id diff --git a/application/hub/main/nodes/list/class_HubListNode.php b/application/hub/main/nodes/list/class_HubListNode.php index 3879b78ae..64dd44f4b 100644 --- a/application/hub/main/nodes/list/class_HubListNode.php +++ b/application/hub/main/nodes/list/class_HubListNode.php @@ -58,8 +58,6 @@ class HubListNode extends BaseHubNode implements NodeHelper, Registerable { * @todo Implement this method */ public function doBootstrapping () { - // Call generic (parent) bootstrapping method first - parent::bootstrapGenericBootstrapping(); $this->partialStub('Please implement this method.'); } diff --git a/application/hub/main/nodes/master/class_HubMasterNode.php b/application/hub/main/nodes/master/class_HubMasterNode.php index d67910bee..3e9d399fe 100644 --- a/application/hub/main/nodes/master/class_HubMasterNode.php +++ b/application/hub/main/nodes/master/class_HubMasterNode.php @@ -58,8 +58,6 @@ class HubMasterNode extends BaseHubNode implements NodeHelper, Registerable { * @todo Implement this method */ public function doBootstrapping () { - // Call generic (parent) bootstrapping method first - parent::bootstrapGenericBootstrapping(); $this->partialStub('Please implement this method.'); } diff --git a/application/hub/main/nodes/regular/class_HubRegularNode.php b/application/hub/main/nodes/regular/class_HubRegularNode.php index cb2ff250b..46105f22f 100644 --- a/application/hub/main/nodes/regular/class_HubRegularNode.php +++ b/application/hub/main/nodes/regular/class_HubRegularNode.php @@ -58,8 +58,6 @@ class HubRegularNode extends BaseHubNode implements NodeHelper, Registerable { * @todo Implement this method */ public function doBootstrapping () { - // Call generic (parent) bootstrapping method first - parent::bootstrapGenericBootstrapping(); $this->partialStub('Please implement this method.'); } -- 2.39.2