org.esupportail.cas.server.handlers.file
Class FileHandler

java.lang.Object
  extended by org.esupportail.cas.server.util.log.Debug
      extended by org.esupportail.cas.server.util.BasicHandler
          extended by org.esupportail.cas.server.handlers.file.FileHandler

public final class FileHandler
extends BasicHandler

The specific Handler for file.

Author:
Pascal Aubry , Jean-Baptiste Daniel

Field Summary
private  java.lang.String encryption
          the encryption used to store passwords.
private  java.lang.String filename
          The filename to read.
private  java.lang.String separator
          The character used to sperate fields in the file.
 
Fields inherited from class org.esupportail.cas.server.util.BasicHandler
FAILED_CONTINUE, FAILED_STOP, SUCCEEDED
 
Constructor Summary
FileHandler(org.dom4j.Element handlerElement, java.lang.Boolean configDebug)
          Constructor.
 
Method Summary
 int authenticate(java.lang.String username, java.lang.String password)
          Try to authenticate a user (by searching into a file).
 
Methods inherited from class org.esupportail.cas.server.util.BasicHandler
checkConfigElement, getConfigElement, getConfigSubElementContent, hasConfigSubElement
 
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
 

Field Detail

encryption

private java.lang.String encryption
the encryption used to store passwords.


filename

private java.lang.String filename
The filename to read.


separator

private java.lang.String separator
The character used to sperate fields in the file.

Constructor Detail

FileHandler

public FileHandler(org.dom4j.Element handlerElement,
                   java.lang.Boolean configDebug)
            throws java.lang.Exception
Constructor.

Parameters:
handlerElement - the XML element that declares the handler in the configuration file
configDebug - debugging mode of the global configuration
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 a file).

Specified by:
authenticate in class BasicHandler
Parameters:
username - the user's name
password - the user's password
Returns:
BasicHandler.SUCCEDED on success, or BasicHandler.FAILED_CONTINUE otherwise.