org.securityfilter.realm.catalina
Class CatalinaRealmAdapter

java.lang.Object
  extended byorg.securityfilter.realm.catalina.CatalinaRealmAdapter
All Implemented Interfaces:
SecurityRealmInterface

public class CatalinaRealmAdapter
extends Object
implements SecurityRealmInterface

CatalinaRealmAdapter - adapts a Catalina Realm for use with the securityfilter

Version:
$Revision: 1.1 $ $Date: 2004/07/03 20:53:45 $
Author:
Max Cooper (max@maxcooper.com)

Constructor Summary
CatalinaRealmAdapter()
           
 
Method Summary
 Principal authenticate(String username, String password)
          Authenticate a user.
 boolean isUserInRole(Principal principal, String rolename)
          Test for role membership.
 void setRealm(Object realm)
          Set the Catalina Realm that we are to adapt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatalinaRealmAdapter

public CatalinaRealmAdapter()
Method Detail

setRealm

public void setRealm(Object realm)
Set the Catalina Realm that we are to adapt.


authenticate

public Principal authenticate(String username,
                              String password)
Authenticate a user.

Specified by:
authenticate in interface SecurityRealmInterface
Parameters:
username - a username
password - a plain text password, as entered by the user
Returns:
a Principal object representing the user if successful, false otherwise

isUserInRole

public boolean isUserInRole(Principal principal,
                            String rolename)
Test for role membership. Use Principal.getName() to get the username from the principal object.

Specified by:
isUserInRole in interface SecurityRealmInterface
Parameters:
principal - Principal object representing a user
rolename - name of a role to test for membership
Returns:
true if the user is in the role, false otherwise