Package septogeddon.pluginquery
Class PreparedQueryConnection
java.lang.Object
septogeddon.pluginquery.PreparedQueryConnection
- All Implemented Interfaces:
QueryConnection
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconnect()
Connect to the remote addressconnect
(int currentTime) protected void
protected void
static io.netty.buffer.ByteBuf
createHandshake
(io.netty.buffer.ByteBuf buf, QueryConnection conn) 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
finalize()
void
Get the connection remote addressio.netty.channel.Channel
Get the channel wrapped by this connectionEvent HandlerGet the messengerMetadata Storagevoid
handshake
(QueryCompletableFuture<QueryConnection> future, int currentTime) static void
handshakenConnection
(QueryProtocol protocol, io.netty.channel.ChannelPipeline pipeline) boolean
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 connectionsendQuery
(QueryMessage message, boolean queue)
-
Constructor Details
-
PreparedQueryConnection
-
-
Method Details
-
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
-
handshakenConnection
public static void handshakenConnection(QueryProtocol protocol, io.netty.channel.ChannelPipeline pipeline) -
createHandshake
public static io.netty.buffer.ByteBuf createHandshake(io.netty.buffer.ByteBuf buf, QueryConnection conn) -
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
-
prepareChannel
protected void prepareChannel() -
connectionDisconnected
protected void connectionDisconnected() -
connectionConnected
protected void connectionConnected() -
getMessenger
Description copied from interface:QueryConnection
Get the messenger- Specified by:
getMessenger
in interfaceQueryConnection
- Returns:
- QueryMessenger instance
-
handshake
-
connect
Description copied from interface:QueryConnection
Connect to the remote address- Specified by:
connect
in interfaceQueryConnection
- Returns:
- QueryFuture for future handling
-
connect
-
flushQueue
public void flushQueue() -
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
-
finalize
public void finalize() -
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
-
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
-
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
-
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
-
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
-