public class ClientUserAuthService extends AbstractCloseable implements Service, ClientSessionHolder
ssh-auth
service.AbstractCloseable.State
Modifier and Type | Field and Description |
---|---|
private java.util.List<UserAuthFactory> |
authFactories |
private java.util.concurrent.atomic.AtomicReference<AuthFuture> |
authFutureHolder
The AuthFuture that is being used by the current auth request.
|
private java.util.List<java.lang.String> |
clientMethods |
private ClientSessionImpl |
clientSession |
private int |
currentMethod |
private java.util.Map<java.lang.String,java.lang.Object> |
properties |
private java.util.List<java.lang.String> |
serverMethods |
private java.lang.String |
service |
private UserAuth |
userAuth |
closeFuture, futureLock, state
log
EMPTY
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT
Constructor and Description |
---|
ClientUserAuthService(Session s) |
Modifier and Type | Method and Description |
---|---|
AuthFuture |
auth(java.lang.String service) |
ClientSession |
getClientSession() |
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.
|
void |
start() |
protected void |
tryNext(int cmd) |
addCloseFutureListener, builder, close, doCloseGracefully, doCloseImmediately, getFutureLock, isClosed, isClosing, removeCloseFutureListener
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParentPropertyResolver
getSessionContext
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getString, getStringProperty
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
private final java.util.concurrent.atomic.AtomicReference<AuthFuture> authFutureHolder
private final java.util.Map<java.lang.String,java.lang.Object> properties
private final ClientSessionImpl clientSession
private final java.util.List<java.lang.String> clientMethods
private final java.util.List<UserAuthFactory> authFactories
private java.lang.String service
private java.util.List<java.lang.String> serverMethods
private UserAuth userAuth
private int currentMethod
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 AuthFuture auth(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