Class CouchbaseNode

All Implemented Interfaces:
Node, Stateful<LifecycleState>

public class CouchbaseNode
extends AbstractStateMachine<LifecycleState>
implements Node
The general implementation of a Node. A Node manages one or more Services. When a node gets connected, all currently configured Services are connected. Those can and will also be added and removed on demand. On disconnect, all services will be shut down asynchronously and then the node is determined to be shutdown. A Nodes states is composed exclusively of the underlying Service states.
Since:
2.0
Author:
Michael Nitschinger
  • Constructor Details

  • Method Details

    • send

      public void send​(CouchbaseRequest request)
      Description copied from interface: Node
      Sends a CouchbaseRequest into the node and eventually returns a CouchbaseResponse. The CouchbaseResponse is not returned directly, but is wrapped into a Observable.
      Specified by:
      send in interface Node
      Parameters:
      request - the request to send.
    • hostname

      public String hostname()
      Description copied from interface: Node
      Returns the configured hostname for the Node.
      Specified by:
      hostname in interface Node
      Returns:
      the hostname.
    • connect

      public rx.Observable<LifecycleState> connect()
      Description copied from interface: Node
      Connects all currently enabled Services.
      Specified by:
      connect in interface Node
      Returns:
      the states of the Node after the connect process for all enabled Services.
    • disconnect

      public rx.Observable<LifecycleState> disconnect()
      Description copied from interface: Node
      Disconnects all currently enabled Services.
      Specified by:
      disconnect in interface Node
      Returns:
      the states of the Node after the disconnect process for all enabled Services.
    • addService

      public rx.Observable<Service> addService​(AddServiceRequest request)
      Specified by:
      addService in interface Node
    • removeService

      public rx.Observable<Service> removeService​(RemoveServiceRequest request)
      Specified by:
      removeService in interface Node
    • diagnostics

      public rx.Observable<EndpointHealth> diagnostics()
      Description copied from interface: Node
      Returns endpoint health information for all endpoints this node is currently associated with.
      Specified by:
      diagnostics in interface Node
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • serviceEnabled

      public boolean serviceEnabled​(ServiceType type)
      Description copied from interface: Node
      True if the given ServiceType is currently enabled on this node, false otherwise.
      Specified by:
      serviceEnabled in interface Node