org.esupportail.cas.server
Class GenericHandler

java.lang.Object
  extended by edu.yale.its.tp.cas.auth.provider.WatchfulPasswordHandler
      extended by org.esupportail.cas.server.GenericHandler
All Implemented Interfaces:
edu.yale.its.tp.cas.auth.AuthHandler, edu.yale.its.tp.cas.auth.PasswordHandler

public final class GenericHandler
extends edu.yale.its.tp.cas.auth.provider.WatchfulPasswordHandler

This class permits via a Xml configuration file to call different specific handler

Author:
Pascal Aubry , Jean-Baptiste Daniel

Field Summary
private static boolean acceptEmptyPasswords
          a boolean to store wheter empty passwords can be accepted or not.
private static java.lang.String CASGENERICHANDLER_RELEASE
          the package release number.
private static long configDate
          the last time the configuration file was modified
private static java.lang.String configFilename
          the name of the configuration file.
private static boolean debug
          Debugging mode.
private static java.util.List handlers
          the list of all the specific handlers to try for authentication.
 
Constructor Summary
GenericHandler()
           
 
Method Summary
 boolean authenticate(javax.servlet.ServletRequest request, java.lang.String username, java.lang.String password)
          Try to authenticate a user by calling all the handlers found in the configuration file.
private static boolean configFileModified()
          tell if the configuration file was modified.
private static java.lang.String getConfigFileName()
          Retrieve the name of the file storing the configuration.
private  void readConfigFile()
          Scans an XML configuration file and builds the structure needed for authentication (a list of specific handlers).
 
Methods inherited from class edu.yale.its.tp.cas.auth.provider.WatchfulPasswordHandler
registerFailure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

acceptEmptyPasswords

private static boolean acceptEmptyPasswords
a boolean to store wheter empty passwords can be accepted or not.


CASGENERICHANDLER_RELEASE

private static final java.lang.String CASGENERICHANDLER_RELEASE
the package release number.

See Also:
Constant Field Values

configDate

private static long configDate
the last time the configuration file was modified


configFilename

private static java.lang.String configFilename
the name of the configuration file.


debug

private static boolean debug
Debugging mode.


handlers

private static java.util.List handlers
the list of all the specific handlers to try for authentication.

Constructor Detail

GenericHandler

public GenericHandler()
Method Detail

authenticate

public boolean authenticate(javax.servlet.ServletRequest request,
                            java.lang.String username,
                            java.lang.String password)
Try to authenticate a user by calling all the handlers found in the configuration file.

Specified by:
authenticate in interface edu.yale.its.tp.cas.auth.PasswordHandler
Overrides:
authenticate in class edu.yale.its.tp.cas.auth.provider.WatchfulPasswordHandler
Parameters:
request - the current request
username - the username provided by the user
password - the password provided by the user
Returns:
true on success, false otherwise.

configFileModified

private static boolean configFileModified()
tell if the configuration file was modified.

Returns:
true if the file was modified since last configuration reading.

getConfigFileName

private static java.lang.String getConfigFileName()
Retrieve the name of the file storing the configuration.

Returns:
a string.

readConfigFile

private void readConfigFile()
                     throws MisconfiguredHandlerException
Scans an XML configuration file and builds the structure needed for authentication (a list of specific handlers).

Throws:
MisconfiguredHandlerException - MisconfiguredHandlerException