Class TupleConnections

java.lang.Object
com.streambase.sb.client.TupleConnections

class TupleConnections extends Object
Tuple connections
  • Constructor Details

    • TupleConnections

      TupleConnections(StreamBaseClient client, boolean haModeOn)
      Constructor
      Parameters:
      client - Client
      haModeOn - true if HA enabled, false otherwise
  • Method Details

    • addConnection

      void addConnection(StreamBaseURI uri, StreamProperties props) throws StreamBaseException
      Add a connection
      Parameters:
      uri - URI
      props - Stream properties
      Throws:
      StreamBaseException - Error adding connection
    • close

      void close()
      Close all connections
    • isConnected

      public boolean isConnected()
      Returns true if this TupleConnections has any live connections to a server. Note that a return of "false" doesn't necessarily indicate an error since the TupleConnection's state (e.g., lack of subscriptions) might mean no connections are needed.
      Returns:
      true if connected, false otherwise
    • getConnections

      Return an unmodifiable list of List<StreamConnection>
      Parameters:
      props - Stream properties
      Returns:
      return an unmodifiable list of List<StreamConnection>
      Throws:
      StreamBaseException - error getting connections
    • tupleConnectionConnected

      void tupleConnectionConnected(com.streambase.sb.client.TupleConnection conn)
      Fire connected notifier
      Parameters:
      conn - Connection
    • tupleConnectionDisconnected

      void tupleConnectionDisconnected(com.streambase.sb.client.TupleConnection conn, String reason)
      Fire disconnected notifier
      Parameters:
      conn - Connection
      reason - Disconnect reason
    • getConnectionCount

      int getConnectionCount()
      Get number of connections
      Returns:
      Connection count
    • enableHeartbeating

      public void enableHeartbeating()
      Enable hearbeat
    • setQuiescentLimit

      public void setQuiescentLimit(long timeoutMS) throws StreamBaseException
      Set connection timeout
      Parameters:
      timeoutMS - Timeout in milliseconds
      Throws:
      StreamBaseException - Error setting timeout
    • addConnectionStatusCallback

      public void addConnectionStatusCallback(ConnectionStatusCallback callback)
      Add connection status callback
      Parameters:
      callback - Callback
    • removeConnectionStatusCallback

      public void removeConnectionStatusCallback(ConnectionStatusCallback callback)
      Remove connection callback status
      Parameters:
      callback - Callback
    • enqueueTupleBuffer

      void enqueueTupleBuffer(StreamBaseClient.SerializedTupleBuffer buffer, boolean hasMore) throws StreamBaseException
      Private version of enqueue that does all of the work. Enqueue a collection of Tuples onto a stream. All tuples must be for the same stream
      Parameters:
      buffer - Tuple buffer
      hasMore - true if more tuples, false otherwise
      Throws:
      StreamBaseException - thrown on network or other errors