Class AuthenticationProtocolClient
- java.lang.Object
-
- com.sshtools.j2ssh.transport.Service
-
- com.sshtools.j2ssh.authentication.AuthenticationProtocolClient
-
public class AuthenticationProtocolClient extends Service
- Version:
- $Revision: 1.27 $
- Author:
- $author$
-
-
Field Summary
-
Fields inherited from class com.sshtools.j2ssh.transport.Service
ACCEPTING_SERVICE, messageStore, REQUESTING_SERVICE, startMode, state, transport
-
-
Constructor Summary
Constructors Constructor Description AuthenticationProtocolClient()
Creates a new AuthenticationProtocolClient object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEventListener(AuthenticationProtocolListener listener)
int
authenticate(SshAuthenticationClient auth, Service serviceToStart)
java.util.List
getAvailableAuths(java.lang.String username, java.lang.String serviceName)
java.lang.String
getBannerMessage(int timeout)
byte[]
getSessionIdentifier()
protected void
onServiceAccept()
Called when the service is accepted by the remote server.protected void
onServiceInit(int startMode)
Called when the service is intialized.protected void
onServiceRequest()
protected void
onStart()
Called when the service is started.void
readAuthenticationState()
SshMessage
readMessage(int messageId)
SshMessage
readMessage(int[] messageId)
void
registerMessage(java.lang.Class cls, int messageId)
void
sendMessage(SshMessage msg)
-
Methods inherited from class com.sshtools.j2ssh.transport.Service
getServiceName, getState, init, sendServiceAccept, start, stop
-
-
-
-
Method Detail
-
onServiceAccept
protected void onServiceAccept() throws java.io.IOException
Description copied from class:Service
Called when the service is accepted by the remote server.
- Specified by:
onServiceAccept
in classService
- Throws:
java.io.IOException
-
onStart
protected void onStart()
Description copied from class:Service
Called when the service is started.
-
onServiceInit
protected void onServiceInit(int startMode) throws java.io.IOException
Description copied from class:Service
Called when the service is intialized.
- Specified by:
onServiceInit
in classService
- Parameters:
startMode
-- Throws:
java.io.IOException
java.io.IOException
-
onServiceRequest
protected void onServiceRequest() throws java.io.IOException
- Specified by:
onServiceRequest
in classService
- Throws:
java.io.IOException
java.io.IOException
-
addEventListener
public void addEventListener(AuthenticationProtocolListener listener)
- Parameters:
listener
-
-
getAvailableAuths
public java.util.List getAvailableAuths(java.lang.String username, java.lang.String serviceName) throws java.io.IOException
- Parameters:
username
-serviceName
-- Returns:
- Throws:
java.io.IOException
SshException
-
authenticate
public int authenticate(SshAuthenticationClient auth, Service serviceToStart) throws java.io.IOException
- Parameters:
auth
-serviceToStart
-- Returns:
- Throws:
java.io.IOException
SshException
-
sendMessage
public void sendMessage(SshMessage msg) throws java.io.IOException
- Parameters:
msg
-- Throws:
java.io.IOException
-
getSessionIdentifier
public byte[] getSessionIdentifier()
- Returns:
-
registerMessage
public void registerMessage(java.lang.Class cls, int messageId)
- Parameters:
cls
-messageId
-
-
readMessage
public SshMessage readMessage(int messageId) throws TerminatedStateException, java.io.IOException
- Parameters:
messageId
-- Returns:
- Throws:
TerminatedStateException
java.io.IOException
-
readMessage
public SshMessage readMessage(int[] messageId) throws TerminatedStateException, java.io.IOException
- Parameters:
messageId
-- Returns:
- Throws:
TerminatedStateException
java.io.IOException
-
readAuthenticationState
public void readAuthenticationState() throws java.io.IOException, TerminatedStateException
- Throws:
java.io.IOException
TerminatedStateException
-
getBannerMessage
public java.lang.String getBannerMessage(int timeout) throws java.io.IOException
- Parameters:
timeout
-- Returns:
- Throws:
java.io.IOException
SshException
-
-