org.esupportail.cas.server.handlers.example
Class ExampleHandler

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.example.ExampleHandler

public final class ExampleHandler
extends BasicHandler

This class implements a very simple handler accepting one particular login/password.

Author:
Pascal Aubry

Field Summary
private  java.lang.String login
          the only netId that the handler will accept
private  java.lang.String password
          the associated password
 
Fields inherited from class org.esupportail.cas.server.util.BasicHandler
FAILED_CONTINUE, FAILED_STOP, SUCCEEDED
 
Constructor Summary
ExampleHandler(org.dom4j.Element handlerElement, java.lang.Boolean configDebug)
          Analyse the XML configuration to set netId and password attributes (constructor).
 
Method Summary
 int authenticate(java.lang.String userLogin, java.lang.String userPassword)
          Try to authenticate a user (compare with the local credentials).
 
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

login

private java.lang.String login
the only netId that the handler will accept


password

private java.lang.String password
the associated password

Constructor Detail

ExampleHandler

public ExampleHandler(org.dom4j.Element handlerElement,
                      java.lang.Boolean configDebug)
               throws java.lang.Exception
Analyse the XML configuration to set netId and password attributes (constructor).

Parameters:
handlerElement - the XML element that declares the handler in the configuration file
configDebug - debugging mode of the global configuration (set by default to the handler)
Throws:
java.lang.Exception - when the handler not configured correctly
Method Detail

authenticate

public int authenticate(java.lang.String userLogin,
                        java.lang.String userPassword)
Try to authenticate a user (compare with the local credentials).

Specified by:
authenticate in class BasicHandler
Parameters:
userLogin - the user's login
userPassword - the user's password
Returns:
BasicHandler.SUCCEDED on success, BasicHandler.FAILED_CONTINUE or BasicHandler.FAILED_STOP otherwise.