Package septogeddon.pluginquery
Class PreparedQueryConnection
java.lang.Object
septogeddon.pluginquery.PreparedQueryConnection
- All Implemented Interfaces:
QueryConnection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnect()Connect to the remote addressconnect(int currentTime) protected voidprotected voidstatic io.netty.buffer.ByteBufcreateHandshake(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.voidfinalize()voidGet the connection remote addressio.netty.channel.ChannelGet the channel wrapped by this connectionEvent HandlerGet the messengerMetadata Storagevoidhandshake(QueryCompletableFuture<QueryConnection> future, int currentTime) static voidhandshakenConnection(QueryProtocol protocol, io.netty.channel.ChannelPipeline pipeline) booleanCheck if the connection is connectedbooleanCheck if both connection already handshaken and ready to useprotected voidSend query to this connectionSend query to this connectionsendQuery(QueryMessage message, boolean queue)
-
Constructor Details
-
PreparedQueryConnection
-
-
Method Details
-
fetchActiveConnections
Description copied from interface:QueryConnectionGet 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:
fetchActiveConnectionsin 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:QueryConnectionCheck if both connection already handshaken and ready to use- Specified by:
isHandshakenin 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:QueryConnectionGet the messenger- Specified by:
getMessengerin interfaceQueryConnection- Returns:
- QueryMessenger instance
-
handshake
-
connect
Description copied from interface:QueryConnectionConnect to the remote address- Specified by:
connectin interfaceQueryConnection- Returns:
- QueryFuture for future handling
-
connect
-
flushQueue
public void flushQueue() -
disconnect
Description copied from interface:QueryConnectionDisconnect the connection. Won't get removed from connection pool, allows you to re-use this connection.- Specified by:
disconnectin interfaceQueryConnection- Returns:
- QueryFuture for future handling
-
finalize
public void finalize() -
getMetadata
Description copied from interface:QueryConnectionMetadata Storage- Specified by:
getMetadatain interfaceQueryConnection- Returns:
- the storage
-
getEventBus
Description copied from interface:QueryConnectionEvent Handler- Specified by:
getEventBusin interfaceQueryConnection- Returns:
- the event handler
-
getAddress
Description copied from interface:QueryConnectionGet the connection remote address- Specified by:
getAddressin interfaceQueryConnection- Returns:
- Connection Socket Address
-
isConnected
public boolean isConnected()Description copied from interface:QueryConnectionCheck if the connection is connected- Specified by:
isConnectedin interfaceQueryConnection- Returns:
- true if its connected
-
sendQuery
Description copied from interface:QueryConnectionSend query to this connection- Specified by:
sendQueryin interfaceQueryConnection- Parameters:
channel-message-- Returns:
- QueryFuture for future handling
-
sendQuery
-
sendQuery
Description copied from interface:QueryConnectionSend query to this connection- Specified by:
sendQueryin interfaceQueryConnection- Parameters:
channel-message-queue-- Returns:
- QueryFuture for future handling
-
getChannel
public io.netty.channel.Channel getChannel()Description copied from interface:QueryConnectionGet the channel wrapped by this connection- Specified by:
getChannelin interfaceQueryConnection- Returns:
- Netty Channel
-