com.sshtools.daemon.authentication
Class AuthenticationProtocolServer

java.lang.Object
  extended by com.sshtools.j2ssh.transport.Service
      extended by com.sshtools.j2ssh.transport.AsyncService
          extended by com.sshtools.daemon.authentication.AuthenticationProtocolServer
All Implemented Interfaces:
java.lang.Runnable

public class AuthenticationProtocolServer
extends AsyncService

Version:
$Revision: 1.1 $
Author:
$author$

Field Summary
private  java.util.Map acceptServices
           
private  int attempts
           
private  java.util.List availableAuths
           
private  boolean completed
           
private  java.util.List completedAuthentications
           
private static org.apache.commons.logging.Log log
           
private  int[] messageFilter
           
private  SshMessageStore methodMessages
           
private  java.lang.String serviceToStart
           
 
Fields inherited from class com.sshtools.j2ssh.transport.AsyncService
thread
 
Fields inherited from class com.sshtools.j2ssh.transport.Service
ACCEPTING_SERVICE, messageStore, REQUESTING_SERVICE, startMode, state, transport
 
Constructor Summary
AuthenticationProtocolServer()
          Creates a new AuthenticationProtocolServer object.
 
Method Summary
 void acceptService(Service service)
           
protected  int[] getAsyncMessageFilter()
           Implement this method by returning the message ids of the asyncrounous messages your implementation wants to receive.
 TransportProtocolState getConnectionState()
           
 byte[] getSessionIdentifier()
           
protected  void onMessageReceived(SshMessage msg)
           Called by the service thread when an asyncronous message is received.
private  void onMsgUserAuthRequest(SshMsgUserAuthRequest msg)
           
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 onStop()
           The service thread calls this method when the thread is exiting.
 SshMessage readMessage()
           
 void registerMessage(int messageId, java.lang.Class cls)
           
 void sendMessage(SshMessage msg)
           
private  void sendUserAuthFailure(boolean success)
           
private  void sendUserAuthSuccess()
           
 
Methods inherited from class com.sshtools.j2ssh.transport.AsyncService
onStart, run
 
Methods inherited from class com.sshtools.j2ssh.transport.Service
getServiceName, getState, init, sendServiceAccept, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

completedAuthentications

private java.util.List completedAuthentications

acceptServices

private java.util.Map acceptServices

availableAuths

private java.util.List availableAuths

serviceToStart

private java.lang.String serviceToStart

messageFilter

private int[] messageFilter

methodMessages

private SshMessageStore methodMessages

attempts

private int attempts

completed

private boolean completed
Constructor Detail

AuthenticationProtocolServer

public AuthenticationProtocolServer()
Creates a new AuthenticationProtocolServer object.

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 class Service
Throws:
java.io.IOException

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 class Service
Parameters:
startMode -
Throws:
java.io.IOException

getSessionIdentifier

public byte[] getSessionIdentifier()
Returns:

getConnectionState

public TransportProtocolState getConnectionState()
Returns:

sendMessage

public void sendMessage(SshMessage msg)
                 throws java.io.IOException
Parameters:
msg -
Throws:
java.io.IOException

readMessage

public SshMessage readMessage()
                       throws java.io.IOException
Returns:
Throws:
java.io.IOException
SshException

registerMessage

public void registerMessage(int messageId,
                            java.lang.Class cls)
Parameters:
messageId -
cls -

onServiceRequest

protected void onServiceRequest()
                         throws java.io.IOException
Specified by:
onServiceRequest in class Service
Throws:
java.io.IOException
AuthenticationProtocolException

onMessageReceived

protected void onMessageReceived(SshMessage msg)
                          throws java.io.IOException
Description copied from class: AsyncService

Called by the service thread when an asyncronous message is received.

Specified by:
onMessageReceived in class AsyncService
Parameters:
msg -
Throws:
java.io.IOException
AuthenticationProtocolException

getAsyncMessageFilter

protected int[] getAsyncMessageFilter()
Description copied from class: AsyncService

Implement this method by returning the message ids of the asyncrounous messages your implementation wants to receive.

Specified by:
getAsyncMessageFilter in class AsyncService
Returns:

acceptService

public void acceptService(Service service)
Parameters:
service -

sendUserAuthFailure

private void sendUserAuthFailure(boolean success)
                          throws java.io.IOException
Throws:
java.io.IOException

onStop

protected void onStop()
Description copied from class: AsyncService

The service thread calls this method when the thread is exiting.

Specified by:
onStop in class AsyncService

sendUserAuthSuccess

private void sendUserAuthSuccess()
                          throws java.io.IOException
Throws:
java.io.IOException

onMsgUserAuthRequest

private void onMsgUserAuthRequest(SshMsgUserAuthRequest msg)
                           throws java.io.IOException
Throws:
java.io.IOException