Interface QueryConnection

All Known Implementing Classes:
DispatcherQueryConnection, InjectedQueryConnection, PreparedQueryConnection

public interface QueryConnection
Connection instance
Author:
Thito Yalasatria Sunarya
  • Method Details

    • getChannel

      io.netty.channel.Channel getChannel()
      Get the channel wrapped by this connection
      Returns:
      Netty Channel
    • getAddress

      SocketAddress getAddress()
      Get the connection remote address
      Returns:
      Connection Socket Address
    • fetchActiveConnections

      QueryFuture<Set<QueryConnection>> fetchActiveConnections()
      Get the active connection addresses from the other side of this connection as dispatcher connections, where you can send query directly to the connection without having to redirect it on this connection.
      Returns:
      QueryFuture that results a set of active connection addresses
    • isConnected

      boolean isConnected()
      Check if the connection is connected
      Returns:
      true if its connected
    • isHandshaken

      boolean isHandshaken()
      Check if both connection already handshaken and ready to use
      Returns:
      true if the connection already send a handshake packet
    • getMessenger

      QueryMessenger getMessenger()
      Get the messenger
      Returns:
      QueryMessenger instance
    • connect

      Connect to the remote address
      Returns:
      QueryFuture for future handling
    • disconnect

      Disconnect the connection. Won't get removed from connection pool, allows you to re-use this connection.
      Returns:
      QueryFuture for future handling
    • getMetadata

      QueryMetadata getMetadata()
      Metadata Storage
      Returns:
      the storage
    • getEventBus

      QueryEventBus getEventBus()
      Event Handler
      Returns:
      the event handler
    • sendQuery

      QueryFuture<QueryConnection> sendQuery(String channel, byte[] message)
      Send query to this connection
      Parameters:
      channel -
      message -
      Returns:
      QueryFuture for future handling
    • sendQuery

      QueryFuture<QueryConnection> sendQuery(String channel, byte[] message, boolean queue)
      Send query to this connection
      Parameters:
      channel -
      message -
      queue -
      Returns:
      QueryFuture for future handling