Class ServerUserAuthService
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.util.closeable.IoBaseCloseable
-
- org.apache.sshd.common.util.closeable.AbstractCloseable
-
- org.apache.sshd.server.session.ServerUserAuthService
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,Closeable,PropertyResolver,Service,SessionContextHolder,SessionHolder<Session>,ServerSessionHolder
public class ServerUserAuthService extends AbstractCloseable implements Service, ServerSessionHolder
- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State
-
-
Field Summary
-
Fields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
closeFuture, futureLock, state
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.common.PropertyResolver
EMPTY
-
-
Constructor Summary
Constructors Constructor Description ServerUserAuthService(Session s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidasyncAuth(int cmd, Buffer buffer, boolean authed)ServerFactoryManagergetFactoryManager()Map<String,Object>getProperties()A map of properties that can be used to configure the SSH server or client.ServerSessiongetServerSession()ServerSessiongetSession()WelcomeBannerPhasegetWelcomePhase()protected voidhandleAuthenticationFailure(int cmd, Buffer buffer)protected voidhandleAuthenticationInProgress(int cmd, Buffer buffer)protected voidhandleAuthenticationSuccess(int cmd, Buffer buffer)protected booleanhandleUserAuthRequestMessage(ServerSession session, Buffer buffer, AtomicReference<Boolean> authHolder)protected StringloadWelcomeBanner(ServerSession session, URL url, Charset cs)voidprocess(int cmd, Buffer buffer)Service the request.protected StringresolveWelcomeBanner(ServerSession session)IoWriteFuturesendWelcomeBanner(ServerSession session)Sends the welcome banner (if any configured) and if not already invokedvoidstart()-
Methods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, doCloseGracefully, doCloseImmediately, getFutureLock, isClosed, isClosing, preClose, removeCloseFutureListener
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListener
-
Methods inherited from interface org.apache.sshd.common.PropertyResolver
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getString, getStringProperty, isEmpty
-
Methods inherited from interface org.apache.sshd.common.Service
getParentPropertyResolver
-
Methods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
-
-
-
Constructor Detail
-
ServerUserAuthService
public ServerUserAuthService(Session s) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getWelcomePhase
public WelcomeBannerPhase getWelcomePhase()
-
getSession
public ServerSession getSession()
- Specified by:
getSessionin interfaceSessionHolder<Session>
-
getServerSession
public ServerSession getServerSession()
- Specified by:
getServerSessionin interfaceServerSessionHolder- Returns:
- The underlying
ServerSessionused
-
getProperties
public Map<String,Object> getProperties()
Description copied from interface:PropertyResolverA 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, thetoString()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 alongthen it will be parsed into one. Also, if the mapped value is anIntegerbut alongis expected, then it will be converted into one.- Specified by:
getPropertiesin interfacePropertyResolver- Returns:
- a valid
Mapcontaining configuration values, nevernull. Note: may be immutable.
-
process
public void process(int cmd, Buffer buffer) throws ExceptionDescription copied from interface:ServiceService the request.
-
handleUserAuthRequestMessage
protected boolean handleUserAuthRequestMessage(ServerSession session, Buffer buffer, AtomicReference<Boolean> authHolder) throws Exception
- Throws:
Exception
-
asyncAuth
protected void asyncAuth(int cmd, Buffer buffer, boolean authed)
-
handleAuthenticationInProgress
protected void handleAuthenticationInProgress(int cmd, Buffer buffer) throws Exception- Throws:
Exception
-
handleAuthenticationSuccess
protected void handleAuthenticationSuccess(int cmd, Buffer buffer) throws Exception- Throws:
Exception
-
handleAuthenticationFailure
protected void handleAuthenticationFailure(int cmd, Buffer buffer) throws Exception- Throws:
Exception
-
sendWelcomeBanner
public IoWriteFuture sendWelcomeBanner(ServerSession session) throws IOException
Sends the welcome banner (if any configured) and if not already invoked- Parameters:
session- TheServerSessionto send the welcome banner to- Returns:
- The sent welcome banner
IoWriteFuture-nullif none sent - Throws:
IOException- If failed to send the banner
-
resolveWelcomeBanner
protected String resolveWelcomeBanner(ServerSession session) throws IOException
- Throws:
IOException
-
loadWelcomeBanner
protected String loadWelcomeBanner(ServerSession session, URL url, Charset cs) throws IOException
- Throws:
IOException
-
getFactoryManager
public ServerFactoryManager getFactoryManager()
-
-