org.esupportail.cas.server.handlers.database
Class QueryDatabaseServer

java.lang.Object
  extended by org.esupportail.cas.server.util.log.Debug
      extended by org.esupportail.cas.server.util.Server
          extended by org.esupportail.cas.server.handlers.database.DatabaseServer
              extended by org.esupportail.cas.server.handlers.database.QueryDatabaseServer

public final class QueryDatabaseServer
extends DatabaseServer

This class also implements a database server class, which can authenticate users by searching into a database. It is used by SearchDatabaseHandler.

Author:
Pascal Aubry , Jean-Baptiste Daniel , Arunas Stockus

Field Summary
 
Fields inherited from class org.esupportail.cas.server.util.Server
AUTHENTICATE_FAILURE, AUTHENTICATE_NOAUTH, AUTHENTICATE_SUCCESS, CONNECT_FAILURE, CONNECT_NOAUTH, CONNECT_SUCCESS
 
Constructor Summary
QueryDatabaseServer(java.lang.Boolean handlerDebug, RedundantHandler handler, org.dom4j.Element serverElement)
          Constructor.
 
Method Summary
 int authenticate(java.lang.String username, java.lang.String password)
          Try to authenticate a user (by searching into the handler's database).
 
Methods inherited from class org.esupportail.cas.server.handlers.database.DatabaseServer
connect
 
Methods inherited from class org.esupportail.cas.server.util.Server
getConnectError, getHandler, getServerSubElementContent, setConnectError
 
Methods inherited from class org.esupportail.cas.server.util.log.Debug
checkClass, elementDebugValue, isDebug, setDebug, trace, trace, traceBegin, traceEnd, traceEnd, traceEnd, traceThrow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryDatabaseServer

public QueryDatabaseServer(java.lang.Boolean handlerDebug,
                           RedundantHandler handler,
                           org.dom4j.Element serverElement)
                    throws java.lang.Exception
Constructor.

Parameters:
handlerDebug - debugging mode of the handler
handler - the handler the server will be used by
serverElement - the XML element that declares the server
Throws:
java.lang.Exception - Exception
Method Detail

authenticate

public int authenticate(java.lang.String username,
                        java.lang.String password)
Try to authenticate a user (by searching into the handler's database).

Specified by:
authenticate in class Server
Parameters:
username - the user's name
password - the user's password
Returns:
Server.AUTHENTICATE_SUCCESS, Server.AUTHENTICATE_NOAUTH or Server.AUTHENTICATE_FAILURE.