Package org.eclipse.jetty.security
Class PropertyUserStore
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.security.UserStore
-
- org.eclipse.jetty.security.PropertyUserStore
-
- All Implemented Interfaces:
java.util.EventListener,LifeCycle,PathWatcher.Listener
public 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
Passwordshould 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePropertyUserStore.UserListener-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Constructor Summary
Constructors Constructor Description PropertyUserStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.StringgetConfig()Get the config (as a string)java.nio.file.PathgetConfigPath()Get the ConfigPathreference.ResourcegetConfigResource()booleanisHotReload()Is hot reload enabled on this user storevoidonPathWatchEvent(PathWatcher.PathWatchEvent event)voidregisterUserListener(PropertyUserStore.UserListener listener)Registers a listener to be notified of the contents of the property filevoidsetConfig(java.lang.String config)Set the Config Path from a String reference to a filevoidsetConfigFile(java.io.File configFile)Set the Config Path from aFilereferencevoidsetConfigPath(java.io.File configFile)Deprecated.voidsetConfigPath(java.lang.String configFile)Deprecated.voidsetConfigPath(java.nio.file.Path configPath)Set the Config PathvoidsetHotReload(boolean enable)Enable Hot Reload of the Property Filejava.lang.StringtoString()-
Methods inherited from class org.eclipse.jetty.security.UserStore
addUser, getIdentityService, getKnownUserIdentities, getUserIdentity, removeUser
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
-
-
-
-
Method Detail
-
getConfig
public java.lang.String getConfig()
Get the config (as a string)- Returns:
- the config path as a string
-
setConfig
public void setConfig(java.lang.String config)
Set the Config Path from a String reference to a file- Parameters:
config- the config file
-
getConfigPath
public java.nio.file.Path getConfigPath()
Get the ConfigPathreference.- Returns:
- the config path
-
setConfigPath
@Deprecated public void setConfigPath(java.lang.String configFile)
Deprecated.Set the Config Path from a String reference to a file- Parameters:
configFile- the config file can a be a file path or a reference to a file within a jar filejar:file:
-
setConfigPath
@Deprecated public void setConfigPath(java.io.File configFile)
Deprecated.Set the Config Path from aFilereference- Parameters:
configFile- the config file
-
setConfigFile
public void setConfigFile(java.io.File configFile)
Set the Config Path from aFilereference- Parameters:
configFile- the config file
-
setConfigPath
public void setConfigPath(java.nio.file.Path configPath)
Set the Config Path- Parameters:
configPath- the config path
-
getConfigResource
public Resource getConfigResource()
- Returns:
- the resource associated with the configured properties file, creating it if necessary
-
isHotReload
public boolean isHotReload()
Is hot reload enabled on this user store- Returns:
- true if hot reload was enabled before startup
-
setHotReload
public void setHotReload(boolean enable)
Enable Hot Reload of the Property File- Parameters:
enable- true to enable, false to disable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractLifeCycle
-
onPathWatchEvent
public void onPathWatchEvent(PathWatcher.PathWatchEvent event)
- Specified by:
onPathWatchEventin interfacePathWatcher.Listener
-
registerUserListener
public void registerUserListener(PropertyUserStore.UserListener listener)
Registers a listener to be notified of the contents of the property file- Parameters:
listener- the user listener
-
-