Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.securityfilter.realm
Class SimpleSecurityRealmBase  view SimpleSecurityRealmBase download SimpleSecurityRealmBase.java

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

public class SimpleSecurityRealmBase
extends java.lang.Object
implements SecurityRealmInterface

Security realm base class. This class insulates you from having to create or process Principal objects. You can implement a realm by overriding the two methods that neither take or return a Principal object and this class does the conversions for you.

Version:
$Revision: 1.7 $ $Date: 2003/01/06 00:17:25 $

Constructor Summary
SimpleSecurityRealmBase()
           
 
Method Summary
 java.security.Principal authenticate(java.lang.String username, java.lang.String password)
          Authenticate a user.
 boolean booleanAuthenticate(java.lang.String username, java.lang.String password)
          Authenticate a user.
 boolean isUserInRole(java.security.Principal principal, java.lang.String rolename)
          Test for role membership.
 boolean isUserInRole(java.lang.String username, java.lang.String rolename)
          Test for role membership.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSecurityRealmBase

public SimpleSecurityRealmBase()
Method Detail

booleanAuthenticate

public boolean booleanAuthenticate(java.lang.String username,
                                   java.lang.String password)
Authenticate a user. Override this method in a subclass to avoid dealing with Principal objects.


isUserInRole

public boolean isUserInRole(java.lang.String username,
                            java.lang.String rolename)
Test for role membership. Override this method in a subclass to avoid dealing with Principal objects.


authenticate

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

Specified by:
authenticate in interface SecurityRealmInterface

isUserInRole

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

Specified by:
isUserInRole in interface SecurityRealmInterface