Package septogeddon.pluginquery
Class DispatcherQueryConnection
java.lang.Object
septogeddon.pluginquery.DispatcherQueryConnection
- All Implemented Interfaces:
QueryConnection
-
Constructor Summary
ConstructorDescriptionDispatcherQueryConnection
(SocketAddress address, InjectedQueryConnection delegated) -
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
-
Constructor Details
-
Method Details
-
getChannel
public io.netty.channel.Channel getChannel()Description copied from interface:QueryConnection
Get the channel wrapped by this connection- Specified by:
getChannel
in interfaceQueryConnection
- Returns:
- Netty Channel
-
getAddress
Description copied from interface:QueryConnection
Get the connection remote address- Specified by:
getAddress
in interfaceQueryConnection
- Returns:
- Connection Socket Address
-
fetchActiveConnections
Description copied from interface:QueryConnection
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.- Specified by:
fetchActiveConnections
in interfaceQueryConnection
- Returns:
- QueryFuture that results a set of active connection addresses
-
isConnected
public boolean isConnected()Description copied from interface:QueryConnection
Check if the connection is connected- Specified by:
isConnected
in interfaceQueryConnection
- Returns:
- true if its connected
-
isHandshaken
public boolean isHandshaken()Description copied from interface:QueryConnection
Check if both connection already handshaken and ready to use- Specified by:
isHandshaken
in interfaceQueryConnection
- Returns:
- true if the connection already send a handshake packet
-
getMessenger
Description copied from interface:QueryConnection
Get the messenger- Specified by:
getMessenger
in interfaceQueryConnection
- Returns:
- QueryMessenger instance
-
connect
Description copied from interface:QueryConnection
Connect to the remote address- Specified by:
connect
in interfaceQueryConnection
- Returns:
- QueryFuture for future handling
-
disconnect
Description copied from interface:QueryConnection
Disconnect the connection. Won't get removed from connection pool, allows you to re-use this connection.- Specified by:
disconnect
in interfaceQueryConnection
- Returns:
- QueryFuture for future handling
-
getMetadata
Description copied from interface:QueryConnection
Metadata Storage- Specified by:
getMetadata
in interfaceQueryConnection
- Returns:
- the storage
-
getEventBus
Description copied from interface:QueryConnection
Event Handler- Specified by:
getEventBus
in interfaceQueryConnection
- Returns:
- the event handler
-
sendQuery
Description copied from interface:QueryConnection
Send query to this connection- Specified by:
sendQuery
in interfaceQueryConnection
- Parameters:
channel
-message
-- Returns:
- QueryFuture for future handling
-
sendQuery
Description copied from interface:QueryConnection
Send query to this connection- Specified by:
sendQuery
in interfaceQueryConnection
- Parameters:
channel
-message
-queue
-- Returns:
- QueryFuture for future handling
-