org.apache.cactus.client.authentication
Class AbstractAuthentication

java.lang.Object
  extended byorg.apache.cactus.client.authentication.AbstractAuthentication
All Implemented Interfaces:
Authentication
Direct Known Subclasses:
BasicAuthentication, FormAuthentication

public abstract class AbstractAuthentication
extends java.lang.Object
implements Authentication

This class was designed with the simple assumption that ALL authentication implementations will have a String Name and a String Password. Two abstract functions validateName and validatePassword provide for concrete implementations to perform character validation. All the work is then done in the configure abstract function. In the BasicAuthentication class, for example, the configuring is done by adding the request property "Authorization" with a value "Basic <base64encode of 'userid:password'>".

Since:
1.3
Version:
$Id: AbstractAuthentication.java,v 1.10 2003/06/15 16:28:00 cmlenz Exp $
Author:
Vincent Massol, Jason Robertson, Christopher Lenz

Field Summary
protected  java.lang.String name
          User name part of the Credential
protected  java.lang.String password
          Password part of the Credential
 
Constructor Summary
AbstractAuthentication(java.lang.String theName, java.lang.String thePassword)
           
 
Method Summary
 java.lang.String getName()
           
protected  java.lang.String getPassword()
           
 void setName(java.lang.String theName)
          Sets the user name.
 void setPassword(java.lang.String thePassword)
          Sets the user password of the Credential.
protected abstract  void validateName(java.lang.String theName)
          Verify that the user name passed as parameter is a valid user name for the current authentication scheme.
protected abstract  void validatePassword(java.lang.String thePassword)
          Verify that the user password passed as parameter is a valid user password for the current authentication scheme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cactus.client.authentication.Authentication
configure
 

Field Detail

name

protected java.lang.String name
User name part of the Credential


password

protected java.lang.String password
Password part of the Credential

Constructor Detail

AbstractAuthentication

public AbstractAuthentication(java.lang.String theName,
                              java.lang.String thePassword)
Parameters:
theName - user name of the Credential
thePassword - user password of the Credential
Method Detail

setName

public final void setName(java.lang.String theName)
Sets the user name.

Parameters:
theName - user name of the Credential

getName

public final java.lang.String getName()
Returns:
the user name of the Credential

setPassword

public final void setPassword(java.lang.String thePassword)
Sets the user password of the Credential.

Parameters:
thePassword - the user password of the Credential

getPassword

protected final java.lang.String getPassword()
Returns:
the user password of the Credential

validateName

protected abstract void validateName(java.lang.String theName)
Verify that the user name passed as parameter is a valid user name for the current authentication scheme.

Parameters:
theName - the user name to validate

validatePassword

protected abstract void validatePassword(java.lang.String thePassword)
Verify that the user password passed as parameter is a valid user password for the current authentication scheme.

Parameters:
thePassword - the user password to validate


Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.