QuickServer
v1.4.7

org.quickserver.net.server
Class QuickAuthenticationHandler

java.lang.Object
  extended byorg.quickserver.net.server.QuickAuthenticationHandler
All Implemented Interfaces:
ClientAuthenticationHandler
Direct Known Subclasses:
Authenticator

public abstract class QuickAuthenticationHandler
extends java.lang.Object
implements ClientAuthenticationHandler

This class is used to authenticate a client when it connects to QuickServer. Only single instance of this class will be used per QuickServer to handle all authentication. Should have a default constructor.

Since:
1.4.6
Author:
Akshathkumar Shetty

Constructor Summary
QuickAuthenticationHandler()
           
 
Method Summary
 AuthStatus askAuthentication(ClientHandler handler)
          Method called first time after gotConnected() method is caled on ClientEventHandler, if Authenticator is set.
 AuthStatus handleAuthentication(ClientHandler handler, byte[] data)
          Method called when ever a client sends binary data before authentication.
 AuthStatus handleAuthentication(ClientHandler handler, java.lang.Object data)
          Method called when ever a client sends Object data before authentication.
 AuthStatus handleAuthentication(ClientHandler handler, java.lang.String data)
          Method called when ever a client sends character/string data before authentication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickAuthenticationHandler

public QuickAuthenticationHandler()
Method Detail

askAuthentication

public AuthStatus askAuthentication(ClientHandler handler)
                             throws java.io.IOException,
                                    AppException
Description copied from interface: ClientAuthenticationHandler
Method called first time after gotConnected() method is caled on ClientEventHandler, if Authenticator is set. Should be used to initate a authorisation process, like asking for username.

Specified by:
askAuthentication in interface ClientAuthenticationHandler
Returns:
AuthStatus that indicates if authorisation states, if null it is treated as authentication not yet finished.
Throws:
java.io.IOException - if io error in socket
AppException - if client socket needs to be closed.

handleAuthentication

public AuthStatus handleAuthentication(ClientHandler handler,
                                       java.lang.String data)
                                throws java.io.IOException,
                                       AppException
Description copied from interface: ClientAuthenticationHandler
Method called when ever a client sends character/string data before authentication.

Specified by:
handleAuthentication in interface ClientAuthenticationHandler
Returns:
AuthStatus that indicates if authorisation states, if null it is treated as authentication not yet finished.
Throws:
AppException - if client socket needs to be closed.
java.io.IOException - if io error in socket

handleAuthentication

public AuthStatus handleAuthentication(ClientHandler handler,
                                       java.lang.Object data)
                                throws java.io.IOException,
                                       AppException
Description copied from interface: ClientAuthenticationHandler
Method called when ever a client sends Object data before authentication.

Specified by:
handleAuthentication in interface ClientAuthenticationHandler
Returns:
AuthStatus that indicates if authorisation states, if null it is treated as authentication not yet finished.
Throws:
java.io.IOException - if io error in socket
AppException - if client socket needs to be closed.

handleAuthentication

public AuthStatus handleAuthentication(ClientHandler handler,
                                       byte[] data)
                                throws java.io.IOException
Description copied from interface: ClientAuthenticationHandler
Method called when ever a client sends binary data before authentication.

Specified by:
handleAuthentication in interface ClientAuthenticationHandler
Returns:
AuthStatus that indicates if authorisation states, if null it is treated as authentication not yet finished.
Throws:
java.io.IOException - if io error in socket

QuickServer
v1.4.7

Copyright © 2003-2006 QuickServer.org