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

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.BindDatabaseServer

public final class BindDatabaseServer
extends DatabaseServer

This class implements a database server class, which can authenticate users by binding to a database. It is used by BindDatabaseHandler.

Author:
Pascal Aubry , Jean-Baptiste Daniel

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
BindDatabaseServer(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 binding to the 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

BindDatabaseServer

public BindDatabaseServer(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 binding to the 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.