private $hubIsAnnounced = false;
/**
- * Whether this hub is active
+ * Whether this hub is active (default: false)
*/
private $isActive = false;
+ /**
+ * Whether this node accepts announcements (default: false)
+ */
+ private $acceptAnnouncements = false;
+
/**
* Protected constructor
*
public function activateNode (Requestable $requestInstance, Responseable $responseInstance) {
// Checks whether a listener is still active and shuts it down if one
// is still listening.
- if (($this->determineIfListenerIsActive()) && ($this->getIsActive())) {
+ if (($this->determineIfListenerIsActive()) && ($this->isNodeActive()())) {
// Shutdown them down before they can hurt anything
$this->shutdownListenerPool();
} // END - if
*
* @return $isActive Whether the hub is active
*/
- public final function getIsActive () {
+ public final function isNodeActive() () {
return $this->isActive;
}
$this->isActive = (bool) $isActive;
}
+ /**
+ * Checks whether this node accepts announcements
+ *
+ * @return $acceptsAnnouncements Whether this node accepts announcements
+ */
+ public final function isAcceptingAnnouncements () {
+ // Check it (this node must be active and not shutdown!)
+ $acceptsAnnouncements = (($this->acceptsAnnouncements === true) && ($this->isNodeActive()());
+
+ // Return it
+ return $acceptsAnnouncements;
+ }
+
+ /**
+ * Enables whether this node accepts announcements
+ *
+ * @param $acceptsAnnouncements Whether this node accepts announcements (default: true)
+ * @return void
+ */
+ protected final function enableAcceptingAnnouncements ($acceptsAnnouncements = true) {
+ $this->acceptAnnouncements = $acceptsAnnouncements;
+ }
+
+
/**
* "Getter for address:port combination
*