@ApplicationScoped public class UserConfigurationServiceImpl extends Object implements UserConfigurationService
Constructor and Description |
---|
UserConfigurationServiceImpl() |
Modifier and Type | Method and Description |
---|---|
org.apache.commons.configuration.Configuration |
getUserConfiguration(UserAccount user) |
String |
getUserConfiguration(UserAccount user,
String key)
Get the configuration for the given user and key.
|
String |
getUserConfiguration(UserAccount user,
String key,
String defaultValue)
Get the configuration for the given user and key.
|
List<Object> |
getUserListConfiguration(UserAccount user,
String key)
Return the list configuration value of the given key for the given user.
|
List<Object> |
getUserListConfiguration(UserAccount user,
String key,
List<Object> defaultValue)
Return the list configuration value of the given key for the given user.
|
void |
initialise() |
boolean |
isUserConfigurationSet(UserAccount user,
String key)
Check whether the given configuration is set for the given user.
|
void |
removeUserConfiguration(UserAccount user,
String key)
Remove the user configuration identified by "key" from the database.
|
void |
save(UserAccount user) |
void |
setUserConfiguration(UserAccount user,
String key,
String value)
Set the configuration "key" to the string value "value".
|
void |
setUserListConfiguration(UserAccount user,
String key,
List<String> values)
Set the configuration "key" to the string value "value".
|
@PostConstruct public void initialise()
public boolean isUserConfigurationSet(UserAccount user, String key)
UserConfigurationService
isUserConfigurationSet
in interface UserConfigurationService
public String getUserConfiguration(UserAccount user, String key, String defaultValue)
UserConfigurationService
getUserConfiguration
in interface UserConfigurationService
user
- the user for whom to get the configurationkey
- unique configuration key for lookupdefaultValue
- default value if configuration not foundpublic String getUserConfiguration(UserAccount user, String key)
UserConfigurationService
getUserConfiguration
in interface UserConfigurationService
user
- the user for whom to get the configurationkey
- unique configuration key for lookuppublic List<Object> getUserListConfiguration(UserAccount user, String key)
UserConfigurationService
getUserListConfiguration
in interface UserConfigurationService
public List<Object> getUserListConfiguration(UserAccount user, String key, List<Object> defaultValue)
UserConfigurationService
getUserListConfiguration
in interface UserConfigurationService
public void removeUserConfiguration(UserAccount user, String key)
UserConfigurationService
removeUserConfiguration
in interface UserConfigurationService
public void setUserListConfiguration(UserAccount user, String key, List<String> values)
UserConfigurationService
setUserListConfiguration
in interface UserConfigurationService
public void setUserConfiguration(UserAccount user, String key, String value)
UserConfigurationService
setUserConfiguration
in interface UserConfigurationService
public org.apache.commons.configuration.Configuration getUserConfiguration(UserAccount user)
public void save(UserAccount user)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.