org.objectweb.jonas.security.realm
Class JRealmCatalina41

java.lang.Object
  extended byorg.apache.catalina.realm.RealmBase
      extended byorg.objectweb.jonas.security.realm.JRealmCatalina41
All Implemented Interfaces:
org.apache.catalina.Lifecycle, org.apache.catalina.Realm

public class JRealmCatalina41
extends org.apache.catalina.realm.RealmBase

Implementation of a Realm. (by a wrapper) Use any JOnAS realm by specifying the resource name

Author:
Craig R. McClanahan, Florent Benoit : Tomcat 4.1.x /JOnAS 3.1

Field Summary
 
Fields inherited from class org.apache.catalina.realm.RealmBase
container, debug, digest, lifecycle, md, md5Encoder, md5Helper, started, support, validate
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
JRealmCatalina41()
           
 
Method Summary
 java.security.Principal authenticate(java.lang.String username, java.lang.String credentials)
          Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.
 java.lang.String getInfo()
          Return descriptive information about this Realm implementation and the corresponding version number, in the format <description>/<version>.
protected  java.lang.String getName()
          Return a short name for this Realm implementation.
protected  java.lang.String getPassword(java.lang.String username)
          Return the password associated with the given principal's user name.
protected  java.security.Principal getPrincipal(java.lang.String username)
          Return the Principal associated with the given user name.
 java.lang.String getResourceName()
          Return the resource name we will be using.
protected  void log(java.lang.String message)
          Log a message on the Logger associated with our Container (if any)
 void setResourceName(java.lang.String resourceName)
          Set the resource name we will be using.
 void start()
          Prepare for active use of the public methods of this Component.
 void stop()
          Gracefully shut down active use of the public methods of this Component.
 
Methods inherited from class org.apache.catalina.realm.RealmBase
addLifecycleListener, addPropertyChangeListener, authenticate, authenticate, authenticate, digest, Digest, findLifecycleListeners, getContainer, getDebug, getDigest, getDigest, getValidate, hasMessageDigest, hasRole, log, main, removeLifecycleListener, removePropertyChangeListener, setContainer, setDebug, setDigest, setValidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRealmCatalina41

public JRealmCatalina41()
Method Detail

getInfo

public java.lang.String getInfo()
Return descriptive information about this Realm implementation and the corresponding version number, in the format <description>/<version>.

Returns:
the info.

getResourceName

public java.lang.String getResourceName()
Return the resource name we will be using.

Returns:
the resource name.

setResourceName

public void setResourceName(java.lang.String resourceName)
Set the resource name we will be using.

Parameters:
resourceName - The new resource name

authenticate

public java.security.Principal authenticate(java.lang.String username,
                                            java.lang.String credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.

Parameters:
username - Username of the Principal to look up
credentials - Password or other credentials to use in authenticating this username
Returns:
the principal associated

getName

protected java.lang.String getName()
Return a short name for this Realm implementation.

Returns:
the name

getPassword

protected java.lang.String getPassword(java.lang.String username)
Return the password associated with the given principal's user name.

Parameters:
username - the given principal's user name.
Returns:
the password associated.

getPrincipal

protected java.security.Principal getPrincipal(java.lang.String username)
Return the Principal associated with the given user name.

Parameters:
username - the given principal's user name.
Returns:
the Principal associated

start

public void start()
           throws org.apache.catalina.LifecycleException
Prepare for active use of the public methods of this Component.

Throws:
org.apache.catalina.LifecycleException - if this component detects a fatal error that prevents it from being started

stop

public void stop()
          throws org.apache.catalina.LifecycleException
Gracefully shut down active use of the public methods of this Component.

Throws:
org.apache.catalina.LifecycleException - if this component detects a fatal error that needs to be reported

log

protected void log(java.lang.String message)
Log a message on the Logger associated with our Container (if any)

Parameters:
message - Message to be logged