public class UserAuthImpl extends AbstractService implements UserAuth
UserAuth implementation.ErrorNotifiable.Utillog, name, timeout, trans| Constructor and Description |
|---|
UserAuthImpl(Transport trans) |
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate(String username,
Service nextService,
Iterable<AuthMethod> methods)
Attempt to authenticate
username using each of methods in order. |
String |
getBanner()
Returns the authentication banner (if any).
|
Deque<UserAuthException> |
getSavedExceptions() |
boolean |
hadPartialSuccess() |
void |
handle(Message msg,
SSHPacket buf)
Delegate handling of some SSH packet to this object.
|
void |
notifyError(SSHException error)
Notifies this object of an
error. |
getName, getTimeout, notifyUnimplemented, request, setTimeoutclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTimeout, setTimeoutpublic UserAuthImpl(Transport trans)
public void authenticate(String username, Service nextService, Iterable<AuthMethod> methods) throws UserAuthException, TransportException
UserAuthusername using each of methods in order. nextService is the
Service that will be enabled on successful authentication.
Authentication fails if there are no method available, i.e. if all the method failed or there were method
available but could not be attempted because the server did not allow them. In this case, a UserAuthException is thrown with its cause as the last authentication failure. Other UserAuthException's
which may have been ignored may be accessed via UserAuth.getSavedExceptions().
Further attempts may also be made by catching UserAuthException and retrying with this method.authenticate in interface UserAuthusername - the user to authenticatenextService - the service to set on successful authenticationmethods - the AuthMethod's to tryUserAuthException - in case of authentication failureTransportException - if there was a transport-layer errorpublic Deque<UserAuthException> getSavedExceptions()
getSavedExceptions in interface UserAuthpublic String getBanner()
UserAuthpublic boolean hadPartialSuccess()
hadPartialSuccess in interface UserAuthtrue if at least one of the method supplied succeeded.public void handle(Message msg, SSHPacket buf) throws SSHException
SSHPacketHandlerhandle in interface SSHPacketHandlerhandle in class AbstractServicemsg - the SSH message identifierbuf - SSHPacket containing rest of the requestSSHException - if there is a non-recoverable errorpublic void notifyError(SSHException error)
ErrorNotifiableerror.notifyError in interface ErrorNotifiablenotifyError in class AbstractServiceCopyright © 2009–2016. All rights reserved.