public 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 and Description |
---|---|
class |
HashLoginService.HashKnownUser |
MappedLoginService.Anonymous, MappedLoginService.KnownUser, MappedLoginService.RolePrincipal, MappedLoginService.UserPrincipal
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
_identityService, _name, _users
Constructor and Description |
---|
HashLoginService() |
HashLoginService(String name) |
HashLoginService(String name,
String config) |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart() |
protected void |
doStop() |
String |
getConfig() |
void |
getConfig(String config) |
Resource |
getConfigResource() |
int |
getRefreshInterval()
Deprecated.
use
isHotReload() instead |
boolean |
isHotReload()
Is hot reload enabled on this user store
|
protected String[] |
loadRoleInfo(MappedLoginService.KnownUser user) |
protected UserIdentity |
loadUser(String username) |
protected MappedLoginService.KnownUser |
loadUserInfo(String userName) |
void |
loadUsers() |
void |
remove(String userName) |
void |
setConfig(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(String userName,
Credential credential,
String[] roleArray) |
getIdentityService, getName, getUsers, login, logout, putUser, putUser, putUser, removeUser, setIdentityService, setName, setUsers, toString, validate
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
public HashLoginService()
public HashLoginService(String name)
public String getConfig()
public void getConfig(String config)
public Resource getConfigResource()
public void setConfig(String config)
config
- Filename or url of user properties file.public 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(String username)
loadUser
in class MappedLoginService
public void loadUsers() throws IOException
loadUsers
in class MappedLoginService
IOException
protected String[] loadRoleInfo(MappedLoginService.KnownUser user)
loadRoleInfo
in class MappedLoginService
protected MappedLoginService.KnownUser loadUserInfo(String userName)
loadUserInfo
in class MappedLoginService
protected void doStart() throws Exception
doStart
in class MappedLoginService
Exception
AbstractLifeCycle.doStart()
protected void doStop() throws Exception
doStop
in class MappedLoginService
Exception
AbstractLifeCycle.doStop()
public void update(String userName, Credential credential, String[] roleArray)
update
in interface PropertyUserStore.UserListener
public void remove(String userName)
remove
in interface PropertyUserStore.UserListener
Copyright © 1995-2016 Webtide. All Rights Reserved.