org.apache.sshd.server.session
Class ServerSession
java.lang.Object
org.apache.sshd.common.session.AbstractSession
org.apache.sshd.server.session.ServerSession
- All Implemented Interfaces:
- Session
public class ServerSession
- extends AbstractSession
TODO: handle key re-exchange
key re-exchange should be performed after each gigabyte of transferred data
or one hour time connection (see RFC4253, section 9)
TODO: better use of SSH_MSG_DISCONNECT and disconnect error codes
TODO Add javadoc
- Author:
- Apache MINA SSHD Project
| Fields inherited from class org.apache.sshd.common.session.AbstractSession |
attributes, authed, channels, clientProposal, clientVersion, closeFuture, closing, decodeLock, decoderBuffer, decoderLength, decoderState, encodeLock, factoryManager, I_C, I_S, inCipher, inCipherSize, inCompression, inMac, inMacResult, ioSession, kex, listeners, lock, log, negociated, nextChannelId, outCipher, outCipherSize, outCompression, outMac, random, seqi, seqo, serverProposal, serverVersion, SESSION, sessionId, uncompressBuffer, username |
| Methods inherited from class org.apache.sshd.common.session.AbstractSession |
addListener, attachSession, channelClose, channelData, channelEof, channelExtendedData, channelFailure, channelOpenConfirmation, channelOpenFailure, channelRequest, channelWindowAdjust, createBuffer, createProposal, decode, disconnect, doReadIdentification, exceptionCaught, getAttribute, getChannel, getFactoryManager, getIntProperty, getIoSession, getNextChannelId, getSession, getSession, getUsername, messageReceived, negociate, notImplemented, receiveKexInit, receiveNewKeys, registerChannel, removeListener, sendIdentification, sendKexInit, sendNewKeys, setAttribute, unregisterChannel, writePacket |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServerSession
public ServerSession(FactoryManager server,
org.apache.mina.core.session.IoSession ioSession)
throws java.lang.Exception
- Throws:
java.lang.Exception
close
public CloseFuture close(boolean immediately)
- Description copied from class:
AbstractSession
- Close this session.
This method will close all channels, then close the underlying MINA session.
The call will not block until the mina session is actually closed.
- Overrides:
close in class AbstractSession
getNegociated
public java.lang.String getNegociated(int index)
getKex
public KeyExchange getKex()
getSessionId
public byte[] getSessionId()
getServerFactoryManager
public ServerFactoryManager getServerFactoryManager()
getScheduledExecutorService
protected java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
handleMessage
protected void handleMessage(Buffer buffer)
throws java.lang.Exception
- Description copied from class:
AbstractSession
- Abstract method for processing incoming decoded packets.
The given buffer will hold the decoded packet, starting from
the command byte at the read position.
Packets must be processed within this call or be copied because
the given buffer is meant to be changed and updated when this
method returns.
- Specified by:
handleMessage in class AbstractSession
- Parameters:
buffer - the buffer containing the packet
- Throws:
java.lang.Exception - if an exeption occurs while handling this packet.
readIdentification
protected boolean readIdentification(Buffer buffer)
throws java.io.IOException
- Description copied from class:
AbstractSession
- Read the other side identification.
This method is specific to the client or server side, but both should call
AbstractSession.doReadIdentification(org.apache.sshd.common.util.Buffer) and
store the result in the needed property.
- Specified by:
readIdentification in class AbstractSession
- Parameters:
buffer - the buffer containing the remote identification
- Returns:
true if the identification has been fully read or
false if more data is needed
- Throws:
java.io.IOException - if an error occurs such as a bad protocol version
getHostKey
public java.security.KeyPair getHostKey()
getActiveSessionCountForUser
protected int getActiveSessionCountForUser(java.lang.String userName)
- Retrieve the current number of sessions active for a given username.
- Parameters:
userName - The name of the user
- Returns:
- The current number of live
SshSession objects associated with the user
initAgentForward
public java.lang.String initAgentForward()
throws java.io.IOException
- Throws:
java.io.IOException
createX11Display
public java.lang.String createX11Display(boolean singleConnection,
java.lang.String authenticationProtocol,
java.lang.String authenticationCookie,
int screen)
throws java.io.IOException
- Throws:
java.io.IOException
Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.