net.myrrix.web
Class InMemoryRealm

java.lang.Object
  extended by org.apache.catalina.util.LifecycleBase
      extended by org.apache.catalina.util.LifecycleMBeanBase
          extended by org.apache.catalina.realm.RealmBase
              extended by net.myrrix.web.InMemoryRealm
All Implemented Interfaces:
MBeanRegistration, org.apache.catalina.Lifecycle, org.apache.catalina.Realm

public final class InMemoryRealm
extends org.apache.catalina.realm.RealmBase

Adapted from Tomcat's MemoryRealm. This implementation of RealmBase lets you add users programmatically to an in-memory store.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.catalina.realm.RealmBase
org.apache.catalina.realm.RealmBase.AllRolesMode
 
Field Summary
static String AUTH_ROLE
           
static String NAME
           
 
Fields inherited from class org.apache.catalina.realm.RealmBase
allRolesMode, container, containerLog, digest, digestEncoding, info, md, md5Encoder, md5Helper, realmPath, sm, stripRealmForGss, support, validate, x509UsernameRetriever, x509UsernameRetrieverClassName
 
Fields inherited from class org.apache.catalina.util.LifecycleMBeanBase
mserver
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
InMemoryRealm()
           
 
Method Summary
 Principal authenticate(String username, String credentials)
           
 String getInfo()
           
protected  String getName()
           
protected  String getPassword(String username)
           
protected  Principal getPrincipal(String username)
           
 
Methods inherited from class org.apache.catalina.realm.RealmBase
addPropertyChangeListener, authenticate, authenticate, authenticate, backgroundProcess, digest, Digest, findSecurityConstraints, getAllRolesMode, getContainer, getDigest, getDigest, getDigestCharset, getDigestEncoding, getDomainInternal, getObjectNameKeyProperties, getPrincipal, getPrincipal, getRealmPath, getRealmSuffix, getServer, getValidate, getX509UsernameRetrieverClassName, hasMessageDigest, hasResourcePermission, hasRole, hasUserDataPermission, initInternal, isStripRealmForGss, main, removePropertyChangeListener, setAllRolesMode, setContainer, setDigest, setDigestEncoding, setRealmPath, setStripRealmForGss, setValidate, setX509UsernameRetrieverClassName, startInternal, stopInternal, toString
 
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister
 
Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

AUTH_ROLE

public static final String AUTH_ROLE
See Also:
Constant Field Values
Constructor Detail

InMemoryRealm

public InMemoryRealm()
Method Detail

getInfo

public String getInfo()
Specified by:
getInfo in interface org.apache.catalina.Realm
Overrides:
getInfo in class org.apache.catalina.realm.RealmBase

authenticate

public Principal authenticate(String username,
                              String credentials)
Specified by:
authenticate in interface org.apache.catalina.Realm
Overrides:
authenticate in class org.apache.catalina.realm.RealmBase

getName

protected String getName()
Specified by:
getName in class org.apache.catalina.realm.RealmBase

getPassword

protected String getPassword(String username)
Specified by:
getPassword in class org.apache.catalina.realm.RealmBase

getPrincipal

protected Principal getPrincipal(String username)
Specified by:
getPrincipal in class org.apache.catalina.realm.RealmBase


Copyright © 2012. All Rights Reserved.