LoginService, PropertyUserStore.UserListenerpublic class HashLoginService extends MappedLoginService implements PropertyUserStore.UserListener
An implementation of UserRealm that stores users and roles in-memory in HashMaps.
Typically these maps are populated by calling the load() method or passing a properties resource to the constructor. The format of the properties file is:
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 |
|---|---|---|
class |
HashLoginService.HashKnownUser |
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListenerorg.eclipse.jetty.util.component.LifeCycle.ListenerMappedLoginService.Anonymous, MappedLoginService.KnownUser, MappedLoginService.RolePrincipal, MappedLoginService.UserPrincipalFAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING_identityService, _name, _users| Constructor | Description |
|---|---|
HashLoginService() |
|
HashLoginService(java.lang.String name) |
|
HashLoginService(java.lang.String name,
java.lang.String config) |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
doStart() |
|
protected void |
doStop() |
|
java.lang.String |
getConfig() |
|
org.eclipse.jetty.util.resource.Resource |
getConfigResource() |
Deprecated.
|
int |
getRefreshInterval() |
Deprecated.
use
isHotReload() instead |
boolean |
isHotReload() |
Is hot reload enabled on this user store
|
protected java.lang.String[] |
loadRoleInfo(MappedLoginService.KnownUser user) |
|
protected UserIdentity |
loadUser(java.lang.String username) |
|
protected MappedLoginService.KnownUser |
loadUserInfo(java.lang.String userName) |
|
void |
loadUsers() |
|
void |
remove(java.lang.String userName) |
|
void |
setConfig(java.lang.String config) |
Load realm users from properties file.
|
void |
setHotReload(boolean enable) |
Enable Hot Reload of the Property File
|
void |
setRefreshInterval(int sec) |
Deprecated.
use
setHotReload(boolean) instead |
void |
update(java.lang.String userName,
org.eclipse.jetty.util.security.Credential credential,
java.lang.String[] roleArray) |
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stopgetIdentityService, getName, getUsers, login, logout, putUser, putUser, putUser, removeUser, setIdentityService, setName, setUsers, toString, validatepublic HashLoginService()
public HashLoginService(java.lang.String name)
public HashLoginService(java.lang.String name,
java.lang.String config)
public java.lang.String getConfig()
@Deprecated public org.eclipse.jetty.util.resource.Resource getConfigResource()
public void setConfig(java.lang.String config)
The property file maps usernames to password specs followed by an optional comma separated list of role names.
config - uri or url or path to realm properties filepublic boolean isHotReload()
public void setHotReload(boolean enable)
enable - true to enable, false to disable@Deprecated public void setRefreshInterval(int sec)
setHotReload(boolean) insteadsec - the refresh interval@Deprecated public int getRefreshInterval()
isHotReload() insteadprotected UserIdentity loadUser(java.lang.String username)
loadUser in class MappedLoginServicepublic void loadUsers()
throws java.io.IOException
loadUsers in class MappedLoginServicejava.io.IOExceptionprotected java.lang.String[] loadRoleInfo(MappedLoginService.KnownUser user)
loadRoleInfo in class MappedLoginServiceprotected MappedLoginService.KnownUser loadUserInfo(java.lang.String userName)
loadUserInfo in class MappedLoginServiceprotected void doStart()
throws java.lang.Exception
doStart in class MappedLoginServicejava.lang.ExceptionAbstractLifeCycle.doStart()protected void doStop()
throws java.lang.Exception
doStop in class MappedLoginServicejava.lang.ExceptionAbstractLifeCycle.doStop()public void update(java.lang.String userName,
org.eclipse.jetty.util.security.Credential credential,
java.lang.String[] roleArray)
update in interface PropertyUserStore.UserListenerpublic void remove(java.lang.String userName)
remove in interface PropertyUserStore.UserListenerCopyright © 1995–2018 Webtide. All rights reserved.