org.esupportail.cas.server.util
Class RedundantHandler
java.lang.Object
org.esupportail.cas.server.util.log.Debug
org.esupportail.cas.server.util.BasicHandler
org.esupportail.cas.server.util.RedundantHandler
- Direct Known Subclasses:
- DatabaseHandler, LdapHandler, NisHandler, NtHandler
public abstract class RedundantHandler
- extends BasicHandler
This abstract class implements a redundant handler, with a list
of servers that will be used for redundancy.
- Author:
- Pascal Aubry
|
Field Summary |
private java.util.LinkedList |
servers
the list of servers to be used for authentication. |
|
Constructor Summary |
protected |
RedundantHandler(org.dom4j.Element handlerElement,
java.lang.Boolean configDebug)
Constructor. |
|
Method Summary |
protected void |
addServers(boolean serverElementNeeded,
java.lang.String serverClassname)
Constructor. |
int |
authenticate(java.lang.String username,
java.lang.String password)
Tries to Authenticate a user by accessing all the servers. |
java.util.List |
getServers()
retrieve the list of the servers. |
| 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 |
servers
private java.util.LinkedList servers
- the list of servers to be used for authentication. Modified by
addServer().
RedundantHandler
protected RedundantHandler(org.dom4j.Element handlerElement,
java.lang.Boolean configDebug)
- Constructor.
- Parameters:
handlerElement - the XML element that declares the handler
in the configuration fileconfigDebug - debugging mode of the global configuration
addServers
protected final void addServers(boolean serverElementNeeded,
java.lang.String serverClassname)
throws java.lang.Exception
- Constructor.
- Parameters:
serverElementNeeded - true to force the handler to have at least one server sub-elementserverClassname - the classname of the server to create for the handler
- Throws:
java.lang.Exception - Exception
authenticate
public final int authenticate(java.lang.String username,
java.lang.String password)
- Tries to Authenticate a user by accessing all the servers.
- Specified by:
authenticate in class BasicHandler
- Parameters:
username - the username to authenticatepassword - the correspoding password
- Returns:
- BasicHandlerSUCCEDED on success, or
BasicHandler.FAILED_CONTINUE otherwise.
getServers
public final java.util.List getServers()
- retrieve the list of the servers.
- Returns:
- the list of the servers used for authentication.