public class ClientUserAuthService extends AbstractCloseable implements Service, ClientSessionHolder
ssh-auth service.AbstractCloseable.State| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<UserAuthFactory> |
authFactories |
protected java.util.concurrent.atomic.AtomicReference<AuthFuture> |
authFutureHolder
The AuthFuture that is being used by the current auth request.
|
protected java.util.List<java.lang.String> |
clientMethods |
protected ClientSessionImpl |
clientSession |
private int |
currentMethod |
private java.lang.Runnable |
initialRequestSender |
private java.lang.Object |
initLock |
private java.util.Map<java.lang.String,java.lang.Object> |
properties |
protected java.util.List<java.lang.String> |
serverMethods |
private java.lang.String |
service |
private boolean |
started |
private UserAuth |
userAuth |
closeFuture, futureLock, statelogEMPTY| Constructor and Description |
|---|
ClientUserAuthService(Session s) |
| Modifier and Type | Method and Description |
|---|---|
AuthFuture |
auth(java.lang.String service) |
protected AuthFuture |
createAuthFuture(ClientSession session,
java.lang.String service) |
ClientSession |
getClientSession() |
java.lang.String |
getCurrentServiceName() |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
A map of properties that can be used to configure the SSH server or client.
|
ClientSession |
getSession() |
protected void |
preClose()
preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately.
|
void |
process(int cmd,
Buffer buffer)
Service the request.
|
protected void |
processUserAuth(Buffer buffer)
Execute one step in user authentication.
|
protected IoWriteFuture |
sendInitialAuthRequest(ClientSession session,
java.lang.String service) |
void |
start() |
protected void |
tryNext(int cmd) |
protected AuthFuture |
updateCurrentAuthFuture(ClientSession session,
java.lang.String service) |
addCloseFutureListener, builder, close, doCloseGracefully, doCloseImmediately, getFutureLock, isClosed, isClosing, removeCloseFutureListenerdebug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetParentPropertyResolvergetSessionContextgetBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getString, getStringProperty, isEmpty, isEmptyaddCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListenerprotected final java.util.concurrent.atomic.AtomicReference<AuthFuture> authFutureHolder
protected final ClientSessionImpl clientSession
protected final java.util.List<UserAuthFactory> authFactories
protected final java.util.List<java.lang.String> clientMethods
protected java.util.List<java.lang.String> serverMethods
private final java.util.Map<java.lang.String,java.lang.Object> properties
private java.lang.String service
private UserAuth userAuth
private int currentMethod
private final java.lang.Object initLock
private boolean started
private java.lang.Runnable initialRequestSender
public ClientUserAuthService(Session s)
public ClientSession getSession()
getSession in interface SessionHolder<Session>public ClientSession getClientSession()
getClientSession in interface ClientSessionHolderClientSession usedpublic java.util.Map<java.lang.String,java.lang.Object> getProperties()
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, the toString() 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 a
long then it will be parsed into one. Also, if the mapped value is an Integer but a long
is expected, then it will be converted into one.
getProperties in interface PropertyResolverMap containing configuration values, never null. Note: may be
immutable.public java.lang.String getCurrentServiceName()
public AuthFuture auth(java.lang.String service) throws java.io.IOException
java.io.IOExceptionprotected AuthFuture updateCurrentAuthFuture(ClientSession session, java.lang.String service) throws java.io.IOException
java.io.IOExceptionprotected AuthFuture createAuthFuture(ClientSession session, java.lang.String service) throws java.io.IOException
java.io.IOExceptionprotected IoWriteFuture sendInitialAuthRequest(ClientSession session, java.lang.String service) throws java.io.IOException
java.io.IOExceptionpublic void process(int cmd,
Buffer buffer)
throws java.lang.Exception
Serviceprotected void processUserAuth(Buffer buffer) throws java.lang.Exception
buffer - The input Bufferjava.lang.Exception - If failed to processprotected void tryNext(int cmd)
throws java.lang.Exception
java.lang.Exceptionprotected void preClose()
AbstractCloseablepreClose in class AbstractCloseable