java.util.EventListener, LifeCycle, PathWatcher.Listenerpublic class PropertyUserStore extends UserStore implements 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:.
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
PropertyUserStore.UserListener |
UserListener
|
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.Listener| Modifier and Type | Field | Description |
|---|---|---|
protected java.nio.file.Path |
_configPath |
|
protected boolean |
_firstLoad |
|
protected boolean |
_hotReload |
|
protected java.util.List<PropertyUserStore.UserListener> |
_listeners |
|
protected PathWatcher |
_pathWatcher |
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING| Constructor | Description |
|---|---|
PropertyUserStore() |
| Modifier and Type | Method | Description |
|---|---|---|
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() |
|
java.lang.String |
getConfig() |
Get the config (as a string)
|
java.nio.file.Path |
getConfigPath() |
Get the Config
Path reference. |
Resource |
getConfigResource() |
|
boolean |
isHotReload() |
Is hot reload enabled on this user store
|
protected void |
loadUsers() |
|
void |
onPathWatchEvent(PathWatcher.PathWatchEvent event) |
|
void |
registerUserListener(PropertyUserStore.UserListener listener) |
registers a listener to be notified of the contents of the property file
|
void |
setConfig(java.lang.String config) |
Set the Config Path from a String reference to a file
|
void |
setConfigFile(java.io.File configFile) |
Set the Config Path from a
File reference |
void |
setConfigPath(java.io.File configFile) |
Deprecated.
|
void |
setConfigPath(java.lang.String configFile) |
Deprecated.
|
void |
setConfigPath(java.nio.file.Path configPath) |
Set the Config Path
|
void |
setHotReload(boolean enable) |
Enable Hot Reload of the Property File
|
java.lang.String |
toString() |
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddUser, getIdentityService, getKnownUserIdentities, getUserIdentity, removeUserprotected java.nio.file.Path _configPath
protected PathWatcher _pathWatcher
protected boolean _hotReload
protected boolean _firstLoad
protected java.util.List<PropertyUserStore.UserListener> _listeners
public java.lang.String getConfig()
public void setConfig(java.lang.String config)
config - the config filepublic java.nio.file.Path getConfigPath()
Path reference.@Deprecated public void setConfigPath(java.lang.String configFile)
configFile - the config file can a be a file path or a reference to a file within a jar file jar:file:@Deprecated public void setConfigPath(java.io.File configFile)
File referenceconfigFile - the config filepublic void setConfigFile(java.io.File configFile)
File referenceconfigFile - the config filepublic void setConfigPath(java.nio.file.Path configPath)
configPath - the config pathpublic Resource getConfigResource() throws java.io.IOException
java.io.IOException - if unable to get the resourcepublic boolean isHotReload()
public void setHotReload(boolean enable)
enable - true to enable, false to disablepublic java.lang.String toString()
toString in class java.lang.Objectprotected void loadUsers()
throws java.io.IOException
java.io.IOExceptionprotected void doStart()
throws java.lang.Exception
doStart in class AbstractLifeCyclejava.lang.ExceptionAbstractLifeCycle.doStart()public void onPathWatchEvent(PathWatcher.PathWatchEvent event)
onPathWatchEvent in interface PathWatcher.Listenerprotected void doStop()
throws java.lang.Exception
doStop in class AbstractLifeCyclejava.lang.ExceptionAbstractLifeCycle.doStop()public void registerUserListener(PropertyUserStore.UserListener listener)
listener - the user listenerCopyright © 1995–2018 Webtide. All rights reserved.