public abstract class AbstractSession extends AbstractKexFactoryManager implements Session
The AbstractSession handles all the basic SSH protocol such as key exchange, authentication,
encoding and decoding. Both server side and client side sessions should inherit from this
abstract class. Some basic packet processing methods are defined but the actual call to these
methods should be done from the handleMessage(Buffer)
method, which is dependent on the state and side of this session.
AbstractCloseable.State
Session.AttributeKey<T>, Session.TimeoutStatus
SignatureFactoriesManager.Utils
closeFuture, lock, state
log
DEFAULT_SSH_VERSION_PREFIX
Modifier | Constructor and Description |
---|---|
protected |
AbstractSession(boolean isServer,
FactoryManager factoryManager,
IoSession ioSession)
Create a new session.
|
Modifier and Type | Method and Description |
---|---|
void |
addChannelListener(ChannelListener listener)
Add a channel listener
|
void |
addSessionListener(SessionListener listener)
Add a session listener.
|
static void |
attachSession(IoSession ioSession,
AbstractSession session)
Attach a session to the MINA session
|
protected long |
calculateNextIgnorePacketCount(Random r,
long freq,
int variance) |
protected Pair<Session.TimeoutStatus,String> |
checkAuthenticationTimeout(long now,
long authTimeoutMs)
Checks if authentication timeout expired
|
protected void |
checkForTimeouts()
Checks whether the session has timed out (both auth and idle timeouts are checked).
|
protected Pair<Session.TimeoutStatus,String> |
checkIdleTimeout(long now,
long idleTimeoutMs)
Checks if idle timeout expired
|
protected abstract void |
checkKeys() |
protected void |
checkRekey() |
protected Pair<String,String> |
comparePreferredKexProposalOption(KexProposalOption option) |
Buffer |
createBuffer(byte cmd)
Create a new buffer for the specified SSH packet and reserve the needed space
(5 bytes) for the packet header.
|
Buffer |
createBuffer(byte cmd,
int len)
Create a new buffer for the specified SSH packet and reserve the needed space
(5 bytes) for the packet header.
|
protected Map<KexProposalOption,String> |
createProposal(String hostKeyTypes)
Create our proposal for SSH negotiation
|
protected void |
decode()
Decode the incoming buffer and handle packets as needed.
|
void |
disconnect(int reason,
String msg)
Send a disconnect packet with the given reason and message.
|
protected void |
doHandleMessage(Buffer buffer) |
protected String |
doReadIdentification(Buffer buffer,
boolean server)
Read the remote identification from this buffer.
|
protected IoWriteFuture |
doWritePacket(Buffer buffer) |
protected void |
encode(Buffer buffer)
Encode a buffer into the SSH protocol.
|
void |
exceptionCaught(Throwable t)
Handle any exceptions that occurred on this session.
|
<T> T |
getAttribute(Session.AttributeKey<T> key)
Returns the value of the user-defined attribute of this session.
|
long |
getAuthTimeout() |
ChannelListener |
getChannelListenerProxy() |
CipherInformation |
getCipherInformation(boolean incoming)
Retrieves current cipher information - Note: may change if
key re-exchange executed
|
String |
getClientVersion()
Retrieve the client version for this session.
|
CompressionInformation |
getCompressionInformation(boolean incoming)
Retrieves current compression information - Note: may change if
key re-exchange executed
|
FactoryManager |
getFactoryManager() |
long |
getIdleTimeout() |
protected Closeable |
getInnerCloseable() |
IoSession |
getIoSession() |
KeyExchange |
getKex() |
Object |
getLock() |
MacInformation |
getMacInformation(boolean incoming)
Retrieves current MAC information - Note: may change if
key re-exchange executed
|
String |
getNegotiatedKexParameter(KexProposalOption paramType)
Retrieve one of the negotiated values during the KEX stage
|
PropertyResolver |
getParentPropertyResolver() |
Map<String,Object> |
getProperties()
A map of properties that can be used to configure the SSH server
or client.
|
String |
getServerVersion()
Retrieve the server version for this session.
|
<T extends Service> |
getService(Class<T> clazz)
Get the service of the specified type.
|
protected List<Service> |
getServices() |
static AbstractSession |
getSession(IoSession ioSession)
Retrieve the session from the MINA session.
|
static AbstractSession |
getSession(IoSession ioSession,
boolean allowNull)
Retrieve the session from the MINA session.
|
byte[] |
getSessionId() |
SessionListener |
getSessionListenerProxy() |
Session.TimeoutStatus |
getTimeoutStatus()
Check if timeout has occurred.
|
String |
getUsername() |
protected void |
handleDebug(boolean display,
String msg,
String lang,
Buffer buffer) |
protected void |
handleDebug(Buffer buffer) |
protected void |
handleDisconnect(Buffer buffer) |
protected void |
handleDisconnect(int code,
String msg,
String lang,
Buffer buffer) |
protected boolean |
handleFirstKexPacketFollows(int cmd,
Buffer buffer,
boolean followFlag) |
protected void |
handleIgnore(Buffer buffer) |
protected void |
handleIgnore(byte[] data,
Buffer buffer) |
protected void |
handleKexInit(Buffer buffer) |
protected void |
handleKexMessage(int cmd,
Buffer buffer) |
protected void |
handleMessage(Buffer buffer)
Abstract method for processing incoming decoded packets.
|
protected void |
handleNewKeys(int cmd,
Buffer buffer) |
protected void |
handleServiceAccept(Buffer buffer) |
protected void |
handleServiceAccept(String serviceName,
Buffer buffer) |
protected void |
handleServiceRequest(Buffer buffer) |
protected void |
handleServiceRequest(String serviceName,
Buffer buffer) |
protected void |
handleUnimplemented(Buffer buffer) |
protected void |
handleUnimplemented(int seqNo,
Buffer buffer) |
boolean |
isAuthenticated() |
protected boolean |
isRekeyBlocksCountExceeded() |
protected boolean |
isRekeyDataSizeExceeded() |
protected boolean |
isRekeyPacketCountsExceeded() |
protected boolean |
isRekeyRequired() |
protected boolean |
isRekeyTimeIntervalExceeded() |
protected Map<KexProposalOption,String> |
mergeProposals(Map<KexProposalOption,String> current,
Map<KexProposalOption,String> proposal) |
void |
messageReceived(Readable buffer)
Main input point for the MINA framework.
|
protected Map<KexProposalOption,String> |
negotiate()
Compute the negotiated proposals by merging the client and
server proposal.
|
protected void |
notImplemented()
Send an unimplemented packet.
|
protected void |
preClose()
preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately.
|
Buffer |
prepareBuffer(byte cmd,
Buffer buffer)
Prepare a new "clean" buffer while reserving the needed space
(5 bytes) for the packet header.
|
protected abstract boolean |
readIdentification(Buffer buffer)
Read the other side identification.
|
protected void |
receiveKexInit(Buffer buffer) |
protected byte[] |
receiveKexInit(Buffer buffer,
Map<KexProposalOption,String> proposal)
Receive the remote key exchange init message.
|
protected abstract void |
receiveKexInit(Map<KexProposalOption,String> proposal,
byte[] seed) |
protected void |
receiveNewKeys()
Put new keys into use.
|
KeyExchangeFuture |
reExchangeKeys()
Initiate a new key exchange.
|
protected void |
refreshConfiguration()
Refresh whatever internal configuration is not
final |
void |
removeChannelListener(ChannelListener listener)
Remove a channel listener
|
void |
removeSessionListener(SessionListener listener)
Remove a session listener.
|
Buffer |
request(Buffer buffer,
long timeout,
TimeUnit unit)
Send a global request and wait for the response.
|
protected void |
requestFailure(Buffer buffer) |
protected void |
requestNewKeysExchange() |
protected void |
requestSuccess(Buffer buffer) |
void |
resetIdleTimeout() |
protected byte[] |
resizeKey(byte[] e,
int blockSize,
Digest hash,
byte[] k,
byte[] h)
Method used while putting new keys into use that will resize the key used to
initialize the cipher to the needed length.
|
protected String |
resolveAvailableSignaturesProposal() |
protected abstract String |
resolveAvailableSignaturesProposal(FactoryManager manager) |
protected int |
resolveIgnoreBufferDataLength() |
protected void |
sendIdentification(String ident)
Send our identification.
|
protected byte[] |
sendKexInit() |
protected byte[] |
sendKexInit(Map<KexProposalOption,String> proposal)
Send the key exchange initialization packet.
|
protected void |
sendNewKeys()
Send a message to put new keys into use.
|
protected void |
sendSessionEvent(SessionListener.Event event) |
protected void |
serviceAccept() |
<T,E extends T> |
setAttribute(Session.AttributeKey<T> key,
E value)
Sets a user-defined attribute.
|
void |
setAuthenticated() |
protected abstract void |
setKexSeed(byte... seed) |
protected Map<KexProposalOption,String> |
setNegotiationResult(Map<KexProposalOption,String> guess) |
void |
setUsername(String username) |
String |
toString() |
protected void |
validateKexState(int cmd,
KexState expected) |
IoWriteFuture |
writePacket(Buffer buffer)
Encode and send the given buffer.
|
IoWriteFuture |
writePacket(Buffer buffer,
long timeout,
TimeUnit unit)
Encode and send the given buffer with the specified timeout.
|
getCipherFactories, getCompressionFactories, getKeyExchangeFactories, getKeyPairProvider, getMacFactories, getSignatureFactories, resolveEffectiveFactories, resolveEffectiveProvider, setCipherFactories, setCompressionFactories, setKeyExchangeFactories, setKeyPairProvider, setMacFactories, setSignatureFactories
doCloseGracefully, doCloseImmediately
builder, close, isClosed, isClosing
close, isOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
startService
getCipherFactories, getCompressionFactories, getKeyExchangeFactories, getMacFactories, setCipherFactories, setCompressionFactories, setKeyExchangeFactories, setMacFactories
getKeyPairProvider, setKeyPairProvider
getSignatureFactories, setSignatureFactories
public static final String SESSION
getSession(IoSession, boolean)
and attachSession(IoSession, AbstractSession)
.protected final boolean isServer
protected final IoSession ioSession
protected final Random random
protected boolean authed
protected String username
protected final Collection<SessionListener> sessionListeners
protected final SessionListener sessionListenerProxy
protected final Collection<ChannelListener> channelListeners
protected final ChannelListener channelListenerProxy
protected byte[] sessionId
protected String serverVersion
protected String clientVersion
protected final Map<KexProposalOption,String> serverProposal
protected final Map<KexProposalOption,String> clientProposal
protected final Map<KexProposalOption,String> negotiationResult
protected byte[] i_c
protected byte[] i_s
protected KeyExchange kex
protected Boolean firstKexPacketFollows
protected final AtomicReference<KexState> kexState
protected final AtomicReference<DefaultKeyExchangeFuture> kexFutureHolder
protected Cipher outCipher
protected Cipher inCipher
protected int outCipherSize
protected int inCipherSize
protected Mac outMac
protected Mac inMac
protected byte[] inMacResult
protected Compression outCompression
protected Compression inCompression
protected long seqi
protected long seqo
protected Buffer decoderBuffer
protected Buffer uncompressBuffer
protected int decoderState
protected int decoderLength
protected final Object encodeLock
protected final Object decodeLock
protected final Object requestLock
protected final Map<Session.AttributeKey<?>,Object> attributes
protected long authTimeoutStart
protected long idleTimeoutStart
protected final AtomicReference<Session.TimeoutStatus> timeoutStatus
protected final AtomicLong inPacketsCount
protected final AtomicLong outPacketsCount
protected final AtomicLong inBytesCount
protected final AtomicLong outBytesCount
protected final AtomicLong inBlocksCount
protected final AtomicLong outBlocksCount
protected final AtomicLong lastKeyTimeValue
protected long maxRekyPackets
protected long maxRekeyBytes
protected long maxRekeyInterval
protected final Queue<PendingWriteFuture> pendingPackets
protected Service currentService
protected int ignorePacketDataLength
protected long ignorePacketsFrequency
protected int ignorePacketsVariance
protected final AtomicLong maxRekeyBlocks
protected final AtomicLong ignorePacketsCount
protected AbstractSession(boolean isServer, FactoryManager factoryManager, IoSession ioSession)
isServer
- true
if this is a server session, false
if client onefactoryManager
- the factory managerioSession
- the underlying MINA sessionpublic static AbstractSession getSession(IoSession ioSession)
ioSession
- the MINA sessionpublic static AbstractSession getSession(IoSession ioSession, boolean allowNull)
false
,
an IllegalStateException
will be thrown, else a null
will
be returnedioSession
- the MINA sessionallowNull
- if true
, a null
value may be
returned if no session is attachednull
public static void attachSession(IoSession ioSession, AbstractSession session)
ioSession
- the MINA sessionsession
- the session to attachpublic String getServerVersion()
Session
getServerVersion
in interface Session
public String getClientVersion()
Session
getClientVersion
in interface Session
public KeyExchange getKex()
public byte[] getSessionId()
getSessionId
in interface Session
public IoSession getIoSession()
getIoSession
in interface Session
IoSession
associated to this sessionpublic FactoryManager getFactoryManager()
getFactoryManager
in interface Session
FactoryManager
that has created this session, can not be null
public PropertyResolver getParentPropertyResolver()
getParentPropertyResolver
in interface PropertyResolver
null
if no parentpublic Map<String,Object> getProperties()
PropertyResolver
A map of properties that can be used to configure the SSH server or client. This map will never be changed by either the server or client and is not supposed to be changed at runtime (changes are not bound to have any effect on a running client or server), though it may affect the creation of sessions later as these values are usually not cached.
Note: the type of the mapped property should match the
expected configuration value type - Long, Integer, Boolean,
String
, etc.... If it doesn't, the toString()
result of the
mapped value is used to convert it to the required type. E.g., if
the mapped value is the string "1234" and the expected
value is a long
then it will be parsed into one. Also, if
the mapped value is an Integer
but a long
is expected,
then it will be converted into one.
getProperties
in interface PropertyResolver
Map
containing configuration values, never null
public String getNegotiatedKexParameter(KexProposalOption paramType)
Session
getNegotiatedKexParameter
in interface Session
paramType
- The request KexProposalOption
value - ignored
if null
null
if invalid
parameter or no negotiated valuepublic CipherInformation getCipherInformation(boolean incoming)
Session
getCipherInformation
in interface Session
incoming
- If true
then the cipher for the incoming data,
otherwise for the outgoing dataCipherInformation
- or null
if not negotiated yet.public CompressionInformation getCompressionInformation(boolean incoming)
Session
getCompressionInformation
in interface Session
incoming
- If true
then the compression for the incoming data,
otherwise for the outgoing dataCompressionInformation
- or null
if not negotiated yet.public MacInformation getMacInformation(boolean incoming)
Session
getMacInformation
in interface Session
incoming
- If true
then the MAC for the incoming data,
otherwise for the outgoing dataMacInformation
- or null
if not negotiated yet.public boolean isAuthenticated()
isAuthenticated
in interface Session
public void setAuthenticated() throws IOException
setAuthenticated
in interface Session
IOException
public void messageReceived(Readable buffer) throws Exception
Main input point for the MINA framework.
This method will be called each time new data is received on
the socket and will append it to the input buffer before
calling the decode()
method.
buffer
- the new buffer receivedException
- if an error occurs while decoding or handling the dataprotected void refreshConfiguration()
final
protected void handleMessage(Buffer buffer) throws Exception
buffer
- the buffer containing the packetException
- if an exception occurs while handling this packet.doHandleMessage(Buffer)
protected boolean handleFirstKexPacketFollows(int cmd, Buffer buffer, boolean followFlag)
protected Pair<String,String> comparePreferredKexProposalOption(KexProposalOption option)
protected void handleKexMessage(int cmd, Buffer buffer) throws Exception
Exception
protected void handleIgnore(byte[] data, Buffer buffer) throws Exception
Exception
protected void handleUnimplemented(Buffer buffer) throws Exception
Exception
protected void handleUnimplemented(int seqNo, Buffer buffer) throws Exception
Exception
protected void handleDebug(boolean display, String msg, String lang, Buffer buffer) throws Exception
Exception
protected void handleDisconnect(int code, String msg, String lang, Buffer buffer) throws Exception
Exception
protected void handleServiceRequest(Buffer buffer) throws Exception
Exception
protected void handleServiceRequest(String serviceName, Buffer buffer) throws Exception
Exception
protected void handleServiceAccept(Buffer buffer) throws Exception
Exception
protected void handleServiceAccept(String serviceName, Buffer buffer) throws Exception
Exception
protected void handleNewKeys(int cmd, Buffer buffer) throws Exception
Exception
protected void validateKexState(int cmd, KexState expected)
public void exceptionCaught(Throwable t)
SshException
.exceptionCaught
in interface Session
t
- the exception to processprotected Closeable getInnerCloseable()
getInnerCloseable
in class AbstractInnerCloseable
protected void preClose()
AbstractCloseable
preClose
in class AbstractCloseable
public <T extends Service> T getService(Class<T> clazz)
Session
getService
in interface Session
T
- The generic Service
typeclazz
- The service classpublic IoWriteFuture writePacket(Buffer buffer) throws IOException
writePacket
in interface Session
buffer
- the buffer to encode and sendIOException
- if an error occurred when encoding sending the packetpublic IoWriteFuture writePacket(Buffer buffer, long timeout, TimeUnit unit) throws IOException
Session
IoWriteFuture
will be set with a
TimeoutException
exception to indicate a timeout.writePacket
in interface Session
buffer
- the buffer to encode and spendtimeout
- the timeoutunit
- the time unit of the timeout parameterIOException
- if an error occurred when encoding sending the packetprotected IoWriteFuture doWritePacket(Buffer buffer) throws IOException
IOException
protected int resolveIgnoreBufferDataLength()
protected long calculateNextIgnorePacketCount(Random r, long freq, int variance)
public Buffer request(Buffer buffer, long timeout, TimeUnit unit) throws IOException
Session
SSH_MSG_GLOBAL_REQUEST
with a result expected, else it will time outrequest
in interface Session
buffer
- the buffer containing the global requesttimeout
- The number of time units to wait - must be positiveunit
- The TimeUnit
to wait for the responsenull
otherwise.IOException
- if an error occurred when encoding sending the packetpublic Buffer createBuffer(byte cmd)
Session
createBuffer
in interface Session
cmd
- the SSH commandpublic Buffer createBuffer(byte cmd, int len)
Session
createBuffer
in interface Session
cmd
- The SSH command to initialize the buffer withlen
- Estimated number of bytes the buffer will hold, 0 if unknown.Session.prepareBuffer(byte, Buffer)
public Buffer prepareBuffer(byte cmd, Buffer buffer)
Session
prepareBuffer
in interface Session
cmd
- The SSH command to initialize the buffer withbuffer
- The Buffer
instance to initializeprotected void encode(Buffer buffer) throws IOException
buffer
- the buffer to encodeIOException
- if an exception occurs during the encoding processprotected void decode() throws Exception
Exception
- If failed to decodeprotected void sendIdentification(String ident)
ident
- our identification to sendprotected abstract boolean readIdentification(Buffer buffer) throws IOException
doReadIdentification(Buffer, boolean)
and
store the result in the needed property.buffer
- the buffer containing the remote identificationtrue
if the identification has been fully read or
false
if more data is neededIOException
- if an error occurs such as a bad protocol versionprotected String doReadIdentification(Buffer buffer, boolean server)
null
value will be returned. Else the identification
string will be returned and the data read will be consumed from the buffer.buffer
- the buffer containing the identification stringserver
- true
if it is called by the server session,
false
if by the client sessionnull
if more data is neededprotected Map<KexProposalOption,String> createProposal(String hostKeyTypes)
hostKeyTypes
- The comma-separated list of supported host key typesMap
protected byte[] sendKexInit(Map<KexProposalOption,String> proposal) throws IOException
proposal
- our proposal for key exchange negotiationIOException
- if an error occurred sending the packetprotected byte[] receiveKexInit(Buffer buffer, Map<KexProposalOption,String> proposal)
buffer
- the buffer containing the key exchange init packetproposal
- the remote proposal to fillprotected void sendNewKeys() throws IOException
IOException
- if an error occurs sending the messageprotected void receiveNewKeys() throws Exception
Exception
- if an error occursprotected byte[] resizeKey(byte[] e, int blockSize, Digest hash, byte[] k, byte[] h) throws Exception
e
- the key to resizeblockSize
- the cipher block size (in bytes)hash
- the hash algorithmk
- the key exchange k parameterh
- the key exchange h parameterException
- if a problem occur while resizing the keypublic void disconnect(int reason, String msg) throws IOException
Session
disconnect
in interface Session
reason
- the reason code for this disconnectmsg
- the text messageIOException
- if an error occurred sending the packetprotected void notImplemented() throws IOException
IOException
- if an error occurred sending the packetprotected Map<KexProposalOption,String> negotiate()
negotiationResult
property.Map
protected Map<KexProposalOption,String> setNegotiationResult(Map<KexProposalOption,String> guess)
public <T> T getAttribute(Session.AttributeKey<T> key)
getAttribute
in interface Session
T
- The generic attribute typekey
- the key of the attribute; must not be null.public <T,E extends T> T setAttribute(Session.AttributeKey<T> key, E value)
setAttribute
in interface Session
T
- The generic attribute typeE
- The generic value typekey
- the key of the attribute; must not be null.value
- the value of the attribute; must not be null.public String getUsername()
getUsername
in interface UsernameHolder
null
/empty if holder
not yet initializedpublic void setUsername(String username)
setUsername
in interface MutableUserHolder
public Object getLock()
public void addSessionListener(SessionListener listener)
SessionListenerManager
addSessionListener
in interface SessionListenerManager
listener
- The SessionListener
to add - not null
public void removeSessionListener(SessionListener listener)
SessionListenerManager
removeSessionListener
in interface SessionListenerManager
listener
- The SessionListener
to removepublic SessionListener getSessionListenerProxy()
getSessionListenerProxy
in interface SessionListenerManager
null
proxy SessionListener
that represents
all the currently registered listeners. Any method invocation on the proxy
is replicated to the currently registered listenerspublic void addChannelListener(ChannelListener listener)
ChannelListenerManager
addChannelListener
in interface ChannelListenerManager
listener
- The ChannelListener
to add - not null
public void removeChannelListener(ChannelListener listener)
ChannelListenerManager
removeChannelListener
in interface ChannelListenerManager
listener
- The ChannelListener
to removepublic ChannelListener getChannelListenerProxy()
getChannelListenerProxy
in interface ChannelListenerManager
null
proxy ChannelListener
that represents
all the currently registered listeners. Any method invocation on the proxy
is replicated to the currently registered listenersprotected void sendSessionEvent(SessionListener.Event event) throws IOException
IOException
public KeyExchangeFuture reExchangeKeys() throws IOException
Session
reExchangeKeys
in interface Session
KeyExchangeFuture
for awaiting the completion of the exchangeIOException
- If failed to request keys re-negotiationprotected void checkRekey() throws IOException
IOException
protected void requestNewKeysExchange() throws IOException
IOException
protected boolean isRekeyRequired()
protected boolean isRekeyTimeIntervalExceeded()
protected boolean isRekeyPacketCountsExceeded()
protected boolean isRekeyDataSizeExceeded()
protected boolean isRekeyBlocksCountExceeded()
protected byte[] sendKexInit() throws IOException
IOException
protected abstract void setKexSeed(byte... seed)
seed
- The result of the KEXINIT handshake - required for correct
session key establishmentprotected String resolveAvailableSignaturesProposal()
null
/empty if no proposalgetFactoryManager()
,
resolveAvailableSignaturesProposal(FactoryManager)
protected abstract String resolveAvailableSignaturesProposal(FactoryManager manager)
manager
- The FactoryManager
null
/empty if no proposalprotected abstract void checkKeys() throws IOException
IOException
protected void receiveKexInit(Buffer buffer) throws IOException
IOException
protected abstract void receiveKexInit(Map<KexProposalOption,String> proposal, byte[] seed) throws IOException
IOException
protected Map<KexProposalOption,String> mergeProposals(Map<KexProposalOption,String> current, Map<KexProposalOption,String> proposal)
protected void serviceAccept() throws IOException
IOException
protected void checkForTimeouts() throws IOException
IOException
- If failed to checkcheckAuthenticationTimeout(long, long)
,
checkIdleTimeout(long, long)
protected Pair<Session.TimeoutStatus,String> checkAuthenticationTimeout(long now, long authTimeoutMs)
now
- The current time in millisauthTimeoutMs
- The configured timeout in millis - if non-positive
then no timeoutPair
specifying the timeout status and disconnect reason
message if timeout expired, null
or NoTimeout
if no timeout
occurredgetAuthTimeout()
protected Pair<Session.TimeoutStatus,String> checkIdleTimeout(long now, long idleTimeoutMs)
now
- The current time in millisidleTimeoutMs
- The configured timeout in millis - if non-positive
then no timeoutPair
specifying the timeout status and disconnect reason
message if timeout expired, null
or NoTimeout
if no timeout
occurredgetIdleTimeout()
public void resetIdleTimeout()
resetIdleTimeout
in interface Session
public Session.TimeoutStatus getTimeoutStatus()
Session
getTimeoutStatus
in interface Session
null
public long getAuthTimeout()
getAuthTimeout
in interface Session
public long getIdleTimeout()
getIdleTimeout
in interface Session
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.