Package septogeddon.pluginquery.api
Interface QueryConnection
- All Known Implementing Classes:
DispatcherQueryConnection
,InjectedQueryConnection
,PreparedQueryConnection
public interface QueryConnection
Connection instance
- Author:
- Thito Yalasatria Sunarya
-
Method Summary
Modifier and TypeMethodDescriptionconnect()
Connect to the remote addressDisconnect the connection.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.Get the connection remote addressio.netty.channel.Channel
Get the channel wrapped by this connectionEvent HandlerGet the messengerMetadata Storageboolean
Check if the connection is connectedboolean
Check if both connection already handshaken and ready to useSend query to this connectionSend query to this connection
-
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
QueryFuture<QueryConnection> connect()Connect to the remote address- Returns:
- QueryFuture for future handling
-
disconnect
QueryFuture<QueryConnection> 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
Send query to this connection- Parameters:
channel
-message
-- Returns:
- QueryFuture for future handling
-
sendQuery
Send query to this connection- Parameters:
channel
-message
-queue
-- Returns:
- QueryFuture for future handling
-