Package septogeddon.pluginquery
Class InjectedQueryConnection
java.lang.Object
septogeddon.pluginquery.InjectedQueryConnection
- All Implemented Interfaces:
QueryConnection
-
Constructor Summary
ConstructorDescriptionInjectedQueryConnection
(QueryMessenger messenger, io.netty.channel.Channel channel) -
Method Summary
Modifier and TypeMethodDescriptionconnect()
Connect to the remote addressprotected void
protected void
void
consumeQueryConnections
(List<SocketAddress> addresses) Disconnect 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.void
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 useprotected void
Send query to this connectionSend query to this connectionvoid
sendQueryMessage
(QueryMessage msg, QueryCompletableFuture<QueryConnection> future, boolean queue)
-
Constructor Details
-
InjectedQueryConnection
-
-
Method Details
-
consumeQueryConnections
-
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
-
connectionDisconnected
protected void connectionDisconnected() -
connectionConnected
protected void connectionConnected() -
prepareChannel
protected void prepareChannel() -
flushQueue
public void flushQueue() -
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
-
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
-
sendQueryMessage
public void sendQueryMessage(QueryMessage msg, QueryCompletableFuture<QueryConnection> future, boolean queue) -
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
-