Package org.apache.sshd.client.session
Class ClientUserAuthService
- 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.client.session.ClientUserAuthService
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,ClientSessionHolder,Closeable,PropertyResolver,Service,SessionContextHolder,SessionHolder<Session>
public class ClientUserAuthService extends AbstractCloseable implements Service, ClientSessionHolder
Client sidessh-authservice.- 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 Modifier and Type Field Description protected List<UserAuthFactory>authFactoriesprotected AtomicReference<AuthFuture>authFutureHolderThe AuthFuture that is being used by the current auth request.protected List<String>clientMethodsprotected ClientSessionImplclientSessionprotected List<String>serverMethods-
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 ClientUserAuthService(Session s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthFutureauth(String service)protected AuthFuturecreateAuthFuture(ClientSession session, String service)ClientSessiongetClientSession()StringgetCurrentServiceName()Map<String,Object>getProperties()ClientSessiongetSession()protected voidpreClose()voidprocess(int cmd, Buffer buffer)Service the request.protected voidprocessUserAuth(int cmd, Buffer buffer, AuthFuture authFuture)Execute one step in user authentication.protected IoWriteFuturesendInitialAuthRequest(ClientSession session, String service)voidstart()protected voidtryNext(int cmd, AuthFuture authFuture)protected AuthFutureupdateCurrentAuthFuture(ClientSession session, String service)-
Methods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, doCloseGracefully, doCloseImmediately, getFutureLock, isClosed, isClosing, 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
-
-
-
-
Field Detail
-
authFutureHolder
protected final AtomicReference<AuthFuture> authFutureHolder
The AuthFuture that is being used by the current auth request. It is set while an authentication is ongoing.
-
clientSession
protected final ClientSessionImpl clientSession
-
authFactories
protected final List<UserAuthFactory> authFactories
-
-
Constructor Detail
-
ClientUserAuthService
public ClientUserAuthService(Session s)
-
-
Method Detail
-
getSession
public ClientSession getSession()
- Specified by:
getSessionin interfaceSessionHolder<Session>
-
getClientSession
public ClientSession getClientSession()
- Specified by:
getClientSessionin interfaceClientSessionHolder- Returns:
- The underlying
ClientSessionused
-
getProperties
public Map<String,Object> getProperties()
- Specified by:
getPropertiesin interfacePropertyResolver
-
getCurrentServiceName
public String getCurrentServiceName()
-
auth
public AuthFuture auth(String service) throws IOException
- Throws:
IOException
-
updateCurrentAuthFuture
protected AuthFuture updateCurrentAuthFuture(ClientSession session, String service) throws IOException
- Throws:
IOException
-
createAuthFuture
protected AuthFuture createAuthFuture(ClientSession session, String service) throws IOException
- Throws:
IOException
-
sendInitialAuthRequest
protected IoWriteFuture sendInitialAuthRequest(ClientSession session, String service) throws IOException
- Throws:
IOException
-
process
public void process(int cmd, Buffer buffer) throws ExceptionDescription copied from interface:ServiceService the request.
-
processUserAuth
protected void processUserAuth(int cmd, Buffer buffer, AuthFuture authFuture) throws ExceptionExecute one step in user authentication.- Parameters:
cmd- the commandbuffer- the inputBuffer, with the reading position after the command byteauthFuture- theAuthFuture- Throws:
Exception- If failed to process
-
tryNext
protected void tryNext(int cmd, AuthFuture authFuture) throws Exception- Throws:
Exception
-
preClose
protected void preClose()
- Overrides:
preClosein classAbstractCloseable
-
-