public class ServerSessionImpl extends AbstractSession implements ServerSession
CloseableUtils.AbstractCloseable.StateSession.AttributeKey<T>, Session.TimeoutStatus| Modifier and Type | Field and Description |
|---|---|
protected static long |
MAX_PACKETS |
attributes, authed, authTimeoutMs, authTimeoutTimestamp, clientProposal, clientVersion, currentService, decodeLock, decoderBuffer, decoderLength, decoderState, DEFAULT_SSH_VERSION_PREFIX, disconnectTimeoutMs, encodeLock, factoryManager, i_c, i_s, idleTimeoutMs, idleTimeoutTimestamp, inBytesCount, inCipher, inCipherSize, inCompression, inMac, inMacResult, inPacketsCount, ioSession, isServer, kex, kexState, lastKeyTimeValue, listeners, negotiationResult, outBytesCount, outCipher, outCipherSize, outCompression, outMac, outPacketsCount, pendingPackets, random, reexchangeFuture, requestLock, requestResult, seqi, seqo, serverProposal, serverVersion, SESSION, sessionId, sessionListenerProxy, timeoutStatus, uncompressBuffer, usernamecloseFuture, lock, statelog| Constructor and Description |
|---|
ServerSessionImpl(ServerFactoryManager server,
IoSession ioSession) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkKeys() |
protected void |
checkRekey() |
int |
getActiveSessionCountForUser(String userName)
Retrieve the current number of sessions active for a given username.
|
ServerFactoryManager |
getFactoryManager() |
KeyPair |
getHostKey() |
long |
getId()
Returns the session id.
|
protected boolean |
readIdentification(Buffer buffer)
Read the other side identification.
|
protected void |
receiveKexInit(Map<KexProposalOption,String> proposal,
byte[] seed) |
protected String |
resolveAvailableSignaturesProposal(FactoryManager manager) |
protected String |
resolveEmptySignaturesProposal(Iterable<String> supported,
Iterable<String> provided)
Called by
resolveAvailableSignaturesProposal(FactoryManager)
if none of the provided keys is supported - last chance for the derived
implementation to do something |
protected byte[] |
sendKexInit(Map<KexProposalOption,String> proposal)
Send the key exchange initialization packet.
|
protected void |
sendServerIdentification() |
protected void |
serviceAccept() |
protected void |
setKexSeed(byte... seed) |
void |
startService(String name) |
addListener, attachSession, checkForTimeouts, createBuffer, createBuffer, createProposal, decode, disconnect, doCloseImmediately, doHandleMessage, doReadIdentification, doWritePacket, exceptionCaught, getAttribute, getAuthTimeout, getClientVersion, getIdleTimeout, getInnerCloseable, getIntProperty, getIoSession, getKex, getLock, getLongProperty, getNegotiatedKexParameter, getServerVersion, getService, getServices, getSession, getSession, getSessionId, getTimeoutStatus, getUsername, handleMessage, isAuthenticated, mergeProposals, messageReceived, negotiate, notImplemented, receiveKexInit, receiveKexInit, receiveNewKeys, reExchangeKeys, removeListener, request, requestFailure, requestSuccess, resetIdleTimeout, resolveAvailableSignaturesProposal, sendEvent, sendIdentification, sendKexInit, sendNewKeys, setAttribute, setAuthenticated, setNegotiationResult, setUsername, toString, validateKexState, writePacket, writePacketdoCloseGracefullybuilder, close, isClosed, isClosing, preCloseclose, isOpenclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, createBuffer, createBuffer, disconnect, exceptionCaught, getAttribute, getAuthTimeout, getClientVersion, getIdleTimeout, getIntProperty, getIoSession, getKex, getNegotiatedKexParameter, getServerVersion, getService, getSessionId, getTimeoutStatus, getUsername, isAuthenticated, reExchangeKeys, removeListener, request, resetIdleTimeout, setAttribute, setAuthenticated, setUsername, writePacket, writePacketprotected static final long MAX_PACKETS
public ServerSessionImpl(ServerFactoryManager server, IoSession ioSession) throws Exception
Exceptionpublic ServerFactoryManager getFactoryManager()
getFactoryManager in interface SessiongetFactoryManager in interface ServerSessiongetFactoryManager in class AbstractSessionFactoryManager that has created this session, can not be nullprotected void checkKeys()
checkKeys in class AbstractSessionpublic void startService(String name) throws Exception
startService in interface Sessionname - Service nameException - If failed to start itprotected void serviceAccept()
throws IOException
serviceAccept in class AbstractSessionIOExceptionprotected void checkRekey()
throws IOException
checkRekey in class AbstractSessionIOExceptionprotected void sendServerIdentification()
protected byte[] sendKexInit(Map<KexProposalOption,String> proposal) throws IOException
AbstractSessionsendKexInit in class AbstractSessionproposal - our proposal for key exchange negotiationIOException - if an error occurred sending the packetprotected void setKexSeed(byte... seed)
setKexSeed in class AbstractSessionseed - The result of the KEXINIT handshake - required for correct
session key establishmentprotected String resolveAvailableSignaturesProposal(FactoryManager manager)
resolveAvailableSignaturesProposal in class AbstractSessionmanager - The FactoryManagernull/empty if no proposalprotected String resolveEmptySignaturesProposal(Iterable<String> supported, Iterable<String> provided)
resolveAvailableSignaturesProposal(FactoryManager)
if none of the provided keys is supported - last chance for the derived
implementation to do somethingsupported - The supported key types - may be null/emptyprovided - The available signature types - may be null/emptynull by defaultprotected boolean readIdentification(Buffer buffer) throws IOException
AbstractSessionAbstractSession.doReadIdentification(org.apache.sshd.common.util.buffer.Buffer, boolean) and
store the result in the needed property.readIdentification in class AbstractSessionbuffer - 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(Map<KexProposalOption,String> proposal, byte[] seed) throws IOException
receiveKexInit in class AbstractSessionIOExceptionpublic KeyPair getHostKey()
getHostKey in interface ServerSessionKeyPair representing the current session's used keys
on KEXpublic int getActiveSessionCountForUser(String userName)
ServerSessiongetActiveSessionCountForUser in interface ServerSessionuserName - The name of the user - ignored if null/emptySshSession objects associated with the userpublic long getId()
Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.