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, state
log
EMPTY
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, removeCloseFutureListener
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParentPropertyResolver
getSessionContext
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getString, getStringProperty, isEmpty, isEmpty
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
protected 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 ClientSessionHolder
ClientSession
usedpublic java.util.Map<java.lang.String,java.lang.Object> getProperties()
PropertyResolver
A 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 PropertyResolver
Map
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.IOException
protected AuthFuture updateCurrentAuthFuture(ClientSession session, java.lang.String service) throws java.io.IOException
java.io.IOException
protected AuthFuture createAuthFuture(ClientSession session, java.lang.String service) throws java.io.IOException
java.io.IOException
protected IoWriteFuture sendInitialAuthRequest(ClientSession session, java.lang.String service) throws java.io.IOException
java.io.IOException
public void process(int cmd, Buffer buffer) throws java.lang.Exception
Service
protected void processUserAuth(Buffer buffer) throws java.lang.Exception
buffer
- The input Buffer
java.lang.Exception
- If failed to processprotected void tryNext(int cmd) throws java.lang.Exception
java.lang.Exception
protected void preClose()
AbstractCloseable
preClose
in class AbstractCloseable