org.eclipse.jetty.security
Class PropertyUserStore
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.security.PropertyUserStore
- All Implemented Interfaces:
- LifeCycle
public class PropertyUserStore
- extends AbstractLifeCycle
PropertyUserStore
This class monitors a property file of the format mentioned below and notifies registered listeners of the changes to the the given file.
username: password [,rolename ...]
Passwords may be clear text, obfuscated or checksummed. The class com.eclipse.Util.Password should be used to generate obfuscated passwords or password
checksums.
If DIGEST Authentication is used, the password must be in a recoverable format, either plain text or OBF:.
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString |
PropertyUserStore
public PropertyUserStore()
getConfig
public String getConfig()
setConfig
public void setConfig(String config)
getUserIdentity
public UserIdentity getUserIdentity(String userName)
getConfigResource
public Resource getConfigResource()
throws IOException
- returns the resource associated with the configured properties file, creating it if necessary
- Throws:
IOException
setRefreshInterval
public void setRefreshInterval(int msec)
- sets the refresh interval (in seconds)
getRefreshInterval
public int getRefreshInterval()
- refresh interval in seconds for how often the properties file should be checked for changes
doStart
protected void doStart()
throws Exception
- Depending on the value of the refresh interval, this method will either start up a scanner thread that will monitor the properties file for changes after
it has initially loaded it. Otherwise the users will be loaded and there will be no active monitoring thread so changes will not be detected.
- Overrides:
doStart
in class AbstractLifeCycle
- Throws:
Exception
- See Also:
AbstractLifeCycle.doStart()
doStop
protected void doStop()
throws Exception
- Overrides:
doStop
in class AbstractLifeCycle
- Throws:
Exception
- See Also:
AbstractLifeCycle.doStop()
registerUserListener
public void registerUserListener(PropertyUserStore.UserListener listener)
- registers a listener to be notified of the contents of the property file
Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.