Package org.apache.sshd.server.session
Interface ServerSession
-
- All Superinterfaces:
AttributeRepository,AttributeStore,java.lang.AutoCloseable,java.nio.channels.Channel,ChannelListenerManager,ChannelStreamPacketWriterResolver,ChannelStreamPacketWriterResolverManager,java.io.Closeable,Closeable,ConnectionEndpointsIndicator,FactoryManagerHolder,KexExtensionHandlerManager,KexFactoryManager,KeyPairProviderHolder,MutableUserHolder,PacketWriter,PortForwardingEventListenerManager,PortForwardingInformationProvider,PropertyResolver,ReservedSessionMessagesManager,ServerAuthenticationManager,ServerProxyAcceptorHolder,Session,SessionContext,SessionDisconnectHandlerManager,SessionHeartbeatController,SessionListenerManager,SignatureFactoriesManager,UnknownChannelReferenceHandlerManager,UserAuthFactoriesManager<ServerSession,UserAuth,UserAuthFactory>,UsernameHolder
- All Known Implementing Classes:
AbstractServerSession,ServerSessionImpl
public interface ServerSession extends Session, ServerProxyAcceptorHolder, ServerAuthenticationManager
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.sshd.common.AttributeRepository
AttributeRepository.AttributeKey<T>
-
Nested classes/interfaces inherited from interface org.apache.sshd.common.session.SessionHeartbeatController
SessionHeartbeatController.HeartbeatType
-
-
Field Summary
-
Fields inherited from interface org.apache.sshd.common.channel.throttle.ChannelStreamPacketWriterResolver
NONE
-
Fields inherited from interface org.apache.sshd.common.Closeable
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT
-
Fields inherited from interface org.apache.sshd.common.PropertyResolver
EMPTY
-
Fields inherited from interface org.apache.sshd.server.ServerAuthenticationManager
AUTH_METHODS, AUTO_WELCOME_BANNER_VALUE, DEFAULT_BANNER_PHASE, DEFAULT_MAX_AUTH_REQUESTS, DEFAULT_USER_AUTH_GSS_FACTORY, DEFAULT_USER_AUTH_KB_INTERACTIVE_FACTORY, DEFAULT_USER_AUTH_PASSWORD_FACTORY, DEFAULT_USER_AUTH_PUBLIC_KEY_FACTORY, DEFAULT_WELCOME_BANNER_LANGUAGE, MAX_AUTH_REQUESTS, WELCOME_BANNER, WELCOME_BANNER_CHARSET, WELCOME_BANNER_LANGUAGE, WELCOME_BANNER_PHASE
-
Fields inherited from interface org.apache.sshd.common.session.SessionContext
DEFAULT_SSH_VERSION_PREFIX, FALLBACK_SSH_VERSION_PREFIX, MAX_VERSION_LINE_LENGTH
-
Fields inherited from interface org.apache.sshd.common.session.SessionHeartbeatController
DEFAULT_CONNECTION_HEARTBEAT_INTERVAL, SESSION_HEARTBEAT_INTERVAL, SESSION_HEARTBEAT_TYPE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetActiveSessionCountForUser(java.lang.String userName)Retrieve the current number of sessions active for a given username.java.net.SocketAddressgetClientAddress()ServerFactoryManagergetFactoryManager()java.security.KeyPairgetHostKey()IoWriteFuturesignalAuthenticationSuccess(java.lang.String username, java.lang.String authService, Buffer buffer)-
Methods inherited from interface org.apache.sshd.common.AttributeRepository
attributeKeys, getAttribute, getAttributesCount
-
Methods inherited from interface org.apache.sshd.common.AttributeStore
clearAttributes, computeAttributeIfAbsent, removeAttribute, setAttribute
-
Methods inherited from interface org.apache.sshd.common.channel.ChannelListenerManager
addChannelListener, getChannelListenerProxy, removeChannelListener
-
Methods inherited from interface org.apache.sshd.common.channel.throttle.ChannelStreamPacketWriterResolverManager
getChannelStreamPacketWriterResolver, resolveChannelStreamPacketWriter, resolveChannelStreamPacketWriterResolver, setChannelStreamPacketWriterResolver
-
Methods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListener
-
Methods inherited from interface org.apache.sshd.common.kex.extension.KexExtensionHandlerManager
getKexExtensionHandler, setKexExtensionHandler
-
Methods inherited from interface org.apache.sshd.common.kex.KexFactoryManager
getCipherFactories, getCipherFactoriesNameList, getCipherFactoriesNames, getCompressionFactories, getCompressionFactoriesNameList, getCompressionFactoriesNames, getKeyExchangeFactories, getMacFactories, getMacFactoriesNameList, getMacFactoriesNames, setCipherFactories, setCipherFactoriesNameList, setCipherFactoriesNames, setCipherFactoriesNames, setCompressionFactories, setCompressionFactoriesNameList, setCompressionFactoriesNames, setCompressionFactoriesNames, setKeyExchangeFactories, setMacFactories, setMacFactoriesNameList, setMacFactoriesNames, setMacFactoriesNames
-
Methods inherited from interface org.apache.sshd.common.keyprovider.KeyPairProviderHolder
getKeyPairProvider, setKeyPairProvider
-
Methods inherited from interface org.apache.sshd.common.auth.MutableUserHolder
setUsername
-
Methods inherited from interface org.apache.sshd.common.io.PacketWriter
writePacket
-
Methods inherited from interface org.apache.sshd.common.forward.PortForwardingEventListenerManager
addPortForwardingEventListener, getPortForwardingEventListenerProxy, removePortForwardingEventListener
-
Methods inherited from interface org.apache.sshd.common.forward.PortForwardingInformationProvider
getBoundLocalPortForward, getBoundRemotePortForward, getLocalForwardsBindings, getRemoteForwardsBindings, getStartedLocalPortForwards, getStartedRemotePortForwards, isLocalPortForwardingStartedForPort, isRemotePortForwardingStartedForPort
-
Methods inherited from interface org.apache.sshd.common.PropertyResolver
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getParentPropertyResolver, getProperties, getString, getStringProperty
-
Methods inherited from interface org.apache.sshd.common.session.ReservedSessionMessagesManager
getReservedSessionMessagesHandler, setReservedSessionMessagesHandler
-
Methods inherited from interface org.apache.sshd.server.ServerAuthenticationManager
getGSSAuthenticator, getHostBasedAuthenticator, getKeyboardInteractiveAuthenticator, getPasswordAuthenticator, getPublickeyAuthenticator, setGSSAuthenticator, setHostBasedAuthenticator, setKeyboardInteractiveAuthenticator, setPasswordAuthenticator, setPublickeyAuthenticator, setUserAuthFactoriesNames
-
Methods inherited from interface org.apache.sshd.server.session.ServerProxyAcceptorHolder
getServerProxyAcceptor, setServerProxyAcceptor
-
Methods inherited from interface org.apache.sshd.common.session.Session
createBuffer, createBuffer, disconnect, exceptionCaught, getAuthTimeout, getAuthTimeoutStart, getIdleTimeout, getIdleTimeoutStart, getIoSession, getKex, getLocalAddress, getRemoteAddress, getService, getTimeoutStatus, prepareBuffer, reExchangeKeys, request, resetAuthTimeout, resetIdleTimeout, resolveAttribute, sendDebugMessage, sendIgnoreMessage, setAuthenticated, startService, writePacket
-
Methods inherited from interface org.apache.sshd.common.session.SessionContext
getCipherInformation, getClientKexProposals, getClientVersion, getCompressionInformation, getKexNegotiationResult, getKexState, getMacInformation, getNegotiatedKexParameter, getServerKexProposals, getServerVersion, getSessionId, isAuthenticated, isServerSession
-
Methods inherited from interface org.apache.sshd.common.session.SessionDisconnectHandlerManager
getSessionDisconnectHandler, setSessionDisconnectHandler
-
Methods inherited from interface org.apache.sshd.common.session.SessionHeartbeatController
disableSessionHeartbeat, getSessionHeartbeatInterval, getSessionHeartbeatType, setSessionHeartbeat
-
Methods inherited from interface org.apache.sshd.common.session.SessionListenerManager
addSessionListener, getSessionListenerProxy, removeSessionListener
-
Methods inherited from interface org.apache.sshd.common.signature.SignatureFactoriesManager
getSignatureFactories, getSignatureFactoriesNameList, getSignatureFactoriesNames, setSignatureFactories, setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNames
-
Methods inherited from interface org.apache.sshd.common.session.UnknownChannelReferenceHandlerManager
getUnknownChannelReferenceHandler, resolveUnknownChannelReferenceHandler, setUnknownChannelReferenceHandler
-
Methods inherited from interface org.apache.sshd.common.auth.UserAuthFactoriesManager
getUserAuthFactories, getUserAuthFactoriesNameList, getUserAuthFactoriesNames, setUserAuthFactories, setUserAuthFactoriesNameList, setUserAuthFactoriesNames
-
Methods inherited from interface org.apache.sshd.common.auth.UsernameHolder
getUsername
-
-
-
-
Method Detail
-
getFactoryManager
ServerFactoryManager getFactoryManager()
- Specified by:
getFactoryManagerin interfaceFactoryManagerHolder- Returns:
- The
ServerFactoryManagerfor this session
-
getClientAddress
java.net.SocketAddress getClientAddress()
- Returns:
- The
SocketAddressof the remote client. If no proxy wrapping was used then this is the same as theIoSession#getRemoteAddress(). Otherwise, it indicates the real client's address that was somehow transmitted via the proxy meta-data
-
getHostKey
java.security.KeyPair getHostKey()
- Returns:
- The
KeyPairrepresenting the current session's used keys on KEX -nullif not negotiated yet
-
getActiveSessionCountForUser
int getActiveSessionCountForUser(java.lang.String userName)
Retrieve the current number of sessions active for a given username.- Parameters:
userName- The name of the user - ignored ifnull/empty- Returns:
- The current number of live
SshSessionobjects associated with the user
-
signalAuthenticationSuccess
IoWriteFuture signalAuthenticationSuccess(java.lang.String username, java.lang.String authService, Buffer buffer) throws java.lang.Exception
- Marks the session as authenticated.
- Starts the specified service.
-
Sends the
SSH_MSG_USERAUTH_SUCCESSmessage.
- Parameters:
username- The authenticated usernameauthService- The service to startbuffer- Any extra data received to use to start the service- Returns:
- An
IoWriteFuturethat can be used to wait for theSSH_MSG_USERAUTH_SUCCESSmessage send result - Throws:
java.lang.Exception- if cannot handle the request
-
-