public class UserServer.BitToUserConnection extends AbstractServerConnection<UserServer.BitToUserConnection> implements UserClientConnection
UserSession
which stores all session related information like
session options changed over the lifetime of this connection. There is a
1:1 mapping between a BitToUserConnection and a UserSession. This
connection object is also used to send query data and result back to the
client submitted as part of the session tied to this connection.saslCodec
Modifier and Type | Method and Description |
---|---|
void |
channelClosed(RpcException ex)
Called from the RpcBus's channel close handler to close all remaining
resources associated with this connection.
|
void |
close()
Connection consumer wants to close connection.
|
void |
decConnectionCounter() |
void |
finalizeSaslSession() |
io.netty.util.concurrent.Future<Void> |
getClosureFuture()
Returns the
Future which will be notified when this
channel is closed. |
protected org.slf4j.Logger |
getLogger() |
SocketAddress |
getRemoteAddress() |
UserSession |
getSession() |
void |
incConnectionCounter() |
void |
sendData(RpcOutcomeListener<GeneralRPCProtos.Ack> listener,
QueryDataPackage data)
Send query data to client.
|
void |
sendResult(RpcOutcomeListener<GeneralRPCProtos.Ack> listener,
UserBitShared.QueryResult result)
Send query result outcome to client.
|
changeHandlerTo, disposeSaslServer, getAllocator, getCurrentHandler, getSaslServer, initSaslServer, setEncryption, setMaxWrappedSize
addSecurityHandlers, blockOnNotWritable, createNewRpcListener, getAndRemoveRpcOutcome, getChannel, getEncryptionCtxtString, getMaxWrappedSize, getName, getWrapSizeLimit, inEventLoop, isActive, isEncryptionEnabled, recordRemoteFailure, setAutoRead, setWrapSizeLimit
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addSecurityHandlers, blockOnNotWritable, createNewRpcListener, getAndRemoveRpcOutcome, getChannel, getName, inEventLoop, isActive, recordRemoteFailure
setAutoRead
getEncryptionCtxtString, getMaxWrappedSize, getWrapSizeLimit, isEncryptionEnabled, setWrapSizeLimit
public void finalizeSaslSession() throws IOException
finalizeSaslSession
in interface ServerConnection<UserServer.BitToUserConnection>
finalizeSaslSession
in class AbstractServerConnection<UserServer.BitToUserConnection>
IOException
public UserSession getSession()
getSession
in interface UserClientConnection
protected org.slf4j.Logger getLogger()
getLogger
in class AbstractServerConnection<UserServer.BitToUserConnection>
public void sendResult(RpcOutcomeListener<GeneralRPCProtos.Ack> listener, UserBitShared.QueryResult result)
UserClientConnection
listener
.sendResult
in interface UserClientConnection
listener
- The listenerresult
- The query result to be sentpublic void sendData(RpcOutcomeListener<GeneralRPCProtos.Ack> listener, QueryDataPackage data)
UserClientConnection
listener
.sendData
in interface UserClientConnection
listener
- The listenerdata
- The data to be sentpublic io.netty.util.concurrent.Future<Void> getClosureFuture()
UserClientConnection
Future
which will be notified when this
channel is closed. This method always returns the same future instance.getClosureFuture
in interface UserClientConnection
public SocketAddress getRemoteAddress()
getRemoteAddress
in interface RemoteConnection
getRemoteAddress
in interface UserClientConnection
getRemoteAddress
in class AbstractRemoteConnection
public void channelClosed(RpcException ex)
AbstractRemoteConnection
channelClosed
in interface RemoteConnection
channelClosed
in class AbstractServerConnection<UserServer.BitToUserConnection>
ex
- The exception that caused the channel to close.public void close()
AbstractRemoteConnection
The check for isActive is not required here since channel can be in OPEN state without being active. We want to close in both the scenarios. A channel is in OPEN state when a socket is created for it before binding to an address.
close
in interface AutoCloseable
close
in interface RemoteConnection
close
in class AbstractRemoteConnection
public void incConnectionCounter()
incConnectionCounter
in class AbstractRemoteConnection
public void decConnectionCounter()
decConnectionCounter
in class AbstractRemoteConnection
Copyright © 1970 The Apache Software Foundation. All rights reserved.