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

Quick Search    Search Deep

org.securityfilter.example.realm
Class TrivialSecurityRealm  view TrivialSecurityRealm download TrivialSecurityRealm.java

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

public class TrivialSecurityRealm
extends org.securityfilter.realm.SimpleSecurityRealmBase

Trivial implementation of the SecurityRealmInterface. There is one user: username is 'username', password is 'password' And this user is in one role: 'inthisrole'

Version:
$Revision: 1.3 $ $Date: 2003/10/25 10:49:04 $

Field Summary
private  java.lang.String exampleProperty
           
 
Constructor Summary
TrivialSecurityRealm()
           
 
Method Summary
 boolean booleanAuthenticate(java.lang.String username, java.lang.String password)
          Authenticate a user.
 java.lang.String getExampleProperty()
          Getter for exampleProperty.
 boolean isUserInRole(java.lang.String username, java.lang.String role)
          Test for role membership.
 void setExampleProperty(java.lang.String value)
          Setter for exampleProperty to deomonstrate setting realm properties from config file.
 
Methods inherited from class org.securityfilter.realm.SimpleSecurityRealmBase
authenticate, isUserInRole
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exampleProperty

private java.lang.String exampleProperty
Constructor Detail

TrivialSecurityRealm

public TrivialSecurityRealm()
Method Detail

booleanAuthenticate

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


isUserInRole

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


setExampleProperty

public void setExampleProperty(java.lang.String value)
Setter for exampleProperty to deomonstrate setting realm properties from config file. This has no effect other than printing a message when the property is set.


getExampleProperty

public java.lang.String getExampleProperty()
Getter for exampleProperty.