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 org. 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 obfuscated.
| Modifier and Type | Class and Description |
|---|---|
| public static interface |
| Modifier and Type | Field and Description |
|---|---|
| protected Resource | |
| protected boolean | |
| protected List | |
| protected int | |
| protected Scanner | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | doStart()
Overrides org. |
| protected void | doStop()
Overrides org. |
| public Resource | |
| public Resource | Returns: the resource associated with the configured properties file, creating it if necessary
Deprecated
for removal.
|
| public int | Returns: the period in seconds to scan for property file changes, or 0 for no scanningGet the period in seconds to scan for property file changes, or 0 for no scanning. |
| public boolean | Returns: true if hot reload was enabled before startup
Deprecated
use
Is hot reload enabled on this user store
getReloadInterval()
|
| protected void | |
| private void | notifyRemove(String
the user that was removed username)Notifies the registered listeners that a user has been removed. |
| private void | notifyUpdate(String
the user that was updated username, Credential the updated credentials credential, String[] the updated roles roleArray)Notifies the registered listeners of potential updates to a user |
| public void | pathAdded(Path
the path)Path#toRealPath(LinkOption. of the added fileOverrides default org. |
| public void | pathChanged(Path
the path)Path#toRealPath(LinkOption. of the changed fileOverrides default org. |
| public void | pathRemoved(Path
the path)Path#toRealPath(LinkOption. of the removed fileOverrides default org. |
| public void | registerUserListener(PropertyUserStore.
the user listener listenerRegisters a listener to be notified of the contents of the property file |
| public void | |
| public void | setHotReload(boolean
true to enable to a 1 second scan, false to disable enable)
Deprecated
use
Enable Hot Reload of the Property File
setReloadInterval(int)
|
| public void | setReloadInterval(int
the period in seconds to scan for property file changes, or 0 for no scanning scanSeconds)Enable Hot Reload of the Property File |
| public String | toString()
Returns a string representation of the object.
|
| _configResource | back to summary |
|---|---|
| protected Resource _configResource | |
| _firstLoad | back to summary |
|---|---|
| protected boolean _firstLoad | |
| _listeners | back to summary |
|---|---|
| protected List<PropertyUserStore. Hides org. | |
| _reloadInterval | back to summary |
|---|---|
| protected int _reloadInterval | |
| _scanner | back to summary |
|---|---|
| protected Scanner _scanner | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG Hides org. | |
| PropertyUserStore | back to summary |
|---|---|
| public PropertyUserStore() | |
| doStart | back to summary |
|---|---|
| protected void doStart() throws Exception Overrides org. 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.
| |
| doStop | back to summary |
|---|---|
| protected void doStop() throws Exception Overrides org. Doc from org. Stops the managed lifecycle beans in the reverse order they were added.
| |
| getConfig | back to summary |
|---|---|
| public Resource getConfig() Get the config (as a string)
| |
| getConfigResource | back to summary |
|---|---|
| public Resource getConfigResource()
Deprecated for removal.
| |
| getReloadInterval | back to summary |
|---|---|
| public int getReloadInterval() Get the period in seconds to scan for property file changes, or 0 for no scanning.
| |
| isHotReload | back to summary |
|---|---|
| public boolean isHotReload()
Deprecated Is hot reload enabled on this user store
| |
| loadUsers | back to summary |
|---|---|
| protected void loadUsers() throws IOException Load the user data from the property file.
| |
| notifyRemove | back to summary |
|---|---|
| private void notifyRemove(String username) Notifies the registered listeners that a user has been removed.
| |
| notifyUpdate | back to summary |
|---|---|
| private void notifyUpdate(String username, Credential credential, String[] roleArray) Notifies the registered listeners of potential updates to a user
| |
| pathAdded | back to summary |
|---|---|
| public void pathAdded(Path path) throws Exception Overrides default org. Doc from org. Called when a file is added.
Default implementation calls
| |
| pathChanged | back to summary |
|---|---|
| public void pathChanged(Path path) throws Exception Overrides default org. Doc from org. Called when a file is changed.
Default implementation calls
| |
| pathRemoved | back to summary |
|---|---|
| public void pathRemoved(Path path) throws Exception Overrides default org. Doc from org. Called when a file is removed.
Default implementation calls
| |
| registerUserListener | back to summary |
|---|---|
| public void registerUserListener(PropertyUserStore. Registers a listener to be notified of the contents of the property file
| |
| setConfig | back to summary |
|---|---|
| public void setConfig(Resource config) Set the Config Path from a String reference to a file
| |
| setHotReload | back to summary |
|---|---|
| public void setHotReload(boolean enable)
Deprecated Enable Hot Reload of the Property File
| |
| setReloadInterval | back to summary |
|---|---|
| public void setReloadInterval(int scanSeconds) Enable Hot Reload of the Property File
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void |
| remove | back to summary |
|---|---|
| public void remove(String username) | |
| update | back to summary |
|---|---|
| public void update(String username, Credential credential, String[] roleArray) | |