public class PropertyUserStore
extends org.eclipse.jetty.util.component.AbstractLifeCycle
implements org.eclipse.jetty.util.PathWatcher.Listener
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:.
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
PropertyUserStore.UserListener
UserListener
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected Path |
_configPath |
protected org.eclipse.jetty.util.resource.Resource |
_configResource |
protected boolean |
_firstLoad |
protected IdentityService |
_identityService |
protected Map<String,org.eclipse.jetty.server.UserIdentity> |
_knownUserIdentities |
protected List<String> |
_knownUsers |
protected List<PropertyUserStore.UserListener> |
_listeners |
protected boolean |
hotReload |
protected org.eclipse.jetty.util.PathWatcher |
pathWatcher |
| 构造器和说明 |
|---|
PropertyUserStore() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
doStart()
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.
|
protected void |
doStop() |
String |
getConfig()
已过时。
use
getConfigPath() instead |
Path |
getConfigPath()
Get the Config
Path reference. |
org.eclipse.jetty.util.resource.Resource |
getConfigResource() |
org.eclipse.jetty.server.UserIdentity |
getUserIdentity(String userName) |
boolean |
isHotReload()
Is hot reload enabled on this user store
|
protected void |
loadUsers() |
void |
onPathWatchEvent(org.eclipse.jetty.util.PathWatcher.PathWatchEvent event) |
void |
registerUserListener(PropertyUserStore.UserListener listener)
registers a listener to be notified of the contents of the property file
|
void |
setConfig(String configFile)
已过时。
use
setConfigPath(String) instead |
void |
setConfigPath(File configFile)
Set the Config Path from a
File reference |
void |
setConfigPath(Path configPath)
Set the Config Path
|
void |
setConfigPath(String configFile)
Set the Config Path from a String reference to a file
|
void |
setHotReload(boolean enable)
Enable Hot Reload of the Property File
|
String |
toString() |
protected Path _configPath
protected org.eclipse.jetty.util.resource.Resource _configResource
protected org.eclipse.jetty.util.PathWatcher pathWatcher
protected boolean hotReload
protected IdentityService _identityService
protected boolean _firstLoad
protected final Map<String,org.eclipse.jetty.server.UserIdentity> _knownUserIdentities
protected List<PropertyUserStore.UserListener> _listeners
@Deprecated public String getConfig()
getConfigPath() instead@Deprecated public void setConfig(String configFile)
setConfigPath(String) insteadconfigFile - the config filepublic void setConfigPath(String configFile)
configFile - the config filepublic void setConfigPath(File configFile)
File referenceconfigFile - the config filepublic void setConfigPath(Path configPath)
configPath - the config pathpublic org.eclipse.jetty.server.UserIdentity getUserIdentity(String userName)
public org.eclipse.jetty.util.resource.Resource getConfigResource()
throws IOException
IOException - if unable to get the resourcepublic boolean isHotReload()
public void setHotReload(boolean enable)
enable - true to enable, false to disableprotected void loadUsers()
throws IOException
IOExceptionprotected void doStart()
throws Exception
doStart 在类中 org.eclipse.jetty.util.component.AbstractLifeCycleExceptionAbstractLifeCycle.doStart()public void onPathWatchEvent(org.eclipse.jetty.util.PathWatcher.PathWatchEvent event)
onPathWatchEvent 在接口中 org.eclipse.jetty.util.PathWatcher.Listenerprotected void doStop()
throws Exception
doStop 在类中 org.eclipse.jetty.util.component.AbstractLifeCycleExceptionAbstractLifeCycle.doStop()public void registerUserListener(PropertyUserStore.UserListener listener)
listener - the user listenerCopyright © 2017. All rights reserved.