public class ServerSession extends AbstractSession
AbstractSession.PendingWriteFuture
Session.AttributeKey<T>
Modifier and Type | Field and Description |
---|---|
protected static long |
MAX_PACKETS |
attributes, authed, clientProposal, clientVersion, currentService, decodeLock, decoderBuffer, decoderLength, decoderState, encodeLock, factoryManager, I_C, I_S, inBytes, inCipher, inCipherSize, inCompression, inMac, inMacResult, inPackets, ioSession, isServer, kex, KEX_STATE_DONE, KEX_STATE_INIT, KEX_STATE_KEYS, KEX_STATE_RUN, kexState, lastKeyTime, listeners, negotiated, outBytes, outCipher, outCipherSize, outCompression, outMac, outPackets, pendingPackets, random, reexchangeFuture, requestLock, requestResult, seqi, seqo, serverProposal, serverVersion, SESSION, sessionId, uncompressBuffer, username
CLOSED, closeFuture, GRACEFUL, IMMEDIATE, lock, log, OPENED, state
Constructor and Description |
---|
ServerSession(ServerFactoryManager server,
IoSession ioSession) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkForTimeouts()
Checks whether the server session has timed out (both auth and idle timeouts are checked).
|
protected void |
checkKeys() |
protected void |
checkRekey() |
protected int |
getActiveSessionCountForUser(String userName)
Retrieve the current number of sessions active for a given username.
|
ServerFactoryManager |
getFactoryManager()
Retrieve the factory manager
|
KeyPair |
getHostKey() |
long |
getId()
Returns the session id.
|
String |
getNegotiated(int index) |
protected boolean |
readIdentification(Buffer buffer)
Read the other side identification.
|
protected void |
receiveKexInit(Buffer buffer) |
void |
resetIdleTimeout() |
protected void |
sendKexInit() |
protected void |
serviceAccept() |
void |
startService(String name) |
addListener, attachSession, createBuffer, createBuffer, createProposal, decode, disconnect, doHandleMessage, doReadIdentification, doWritePacket, exceptionCaught, getAttribute, getClientVersion, getInnerCloseable, getIntProperty, getIoSession, getKex, getLock, getLongProperty, getServerVersion, getServices, getSession, getSession, getSessionId, getUsername, handleMessage, isAuthenticated, messageReceived, negotiate, notImplemented, postClose, receiveKexInit, receiveNewKeys, reExchangeKeys, removeListener, request, requestFailure, requestSuccess, sendEvent, sendIdentification, sendKexInit, sendNewKeys, setAttribute, setAuthenticated, setUsername, toString, writePacket
doCloseGracefully, doCloseImmediately
close
protected static final long MAX_PACKETS
public ServerSession(ServerFactoryManager server, IoSession ioSession) throws Exception
Exception
public String getNegotiated(int index)
public ServerFactoryManager getFactoryManager()
AbstractSession
getFactoryManager
in interface Session
getFactoryManager
in class AbstractSession
protected void checkKeys()
checkKeys
in class AbstractSession
public void startService(String name) throws Exception
startService
in class AbstractSession
Exception
protected void serviceAccept() throws IOException
serviceAccept
in class AbstractSession
IOException
protected void checkForTimeouts() throws IOException
IOException
protected void checkRekey() throws IOException
checkRekey
in class AbstractSession
IOException
public void resetIdleTimeout()
resetIdleTimeout
in class AbstractSession
protected void sendKexInit() throws IOException
sendKexInit
in class AbstractSession
IOException
protected boolean readIdentification(Buffer buffer) throws IOException
AbstractSession
AbstractSession.doReadIdentification(org.apache.sshd.common.util.Buffer)
and
store the result in the needed property.readIdentification
in class AbstractSession
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 void receiveKexInit(Buffer buffer) throws IOException
receiveKexInit
in class AbstractSession
IOException
public KeyPair getHostKey()
protected int getActiveSessionCountForUser(String userName)
userName
- The name of the userSshSession
objects associated with the userpublic long getId()
Copyright © 2008-2014 The Apache Software Foundation. All Rights Reserved.