@Service @Transactional(propagation=REQUIRED) public class PluginPropertyManagement extends Object
Constructor and Description |
---|
PluginPropertyManagement() |
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getAllApplicationProperties(String symbolicName)
Returns all application properties for the given bundle.
|
Map<String,String> |
getAllClientProperties(String symbolicName)
Returns all client properties for the given bundle.
|
String |
getApplicationProperty(String symbolicName,
String propertyKey)
Returns an application property for a specific bundle.
|
String |
getApplicationProperty(String symbolicName,
String propertyKey,
String defaultValue)
Returns an application property for a specific bundle with default value.
|
String |
getApplicationPropertyUncached(String symbolicName,
String propertyKey)
Returns an application property for a specific bundle bypassing the cache.
|
String |
getClientProperty(String symbolicName,
String propertyKey)
Returns a property within the current clients scope for the given bundle.
|
String |
getClientProperty(String symbolicName,
String propertyKey,
String defaultValue)
Returns a property within the current clients scope for the given bundle.
|
<T extends Serializable> |
getClientPropertyAsObject(String symbolicName,
String propertyKey,
Class<T> clazz)
Returns a property within the current clients scope for the given bundle.
|
void |
init()
Lazy initialization.
|
void |
setApplicationProperty(String symbolicName,
String propertyKey,
String propertyValue)
Sets an application property.
|
void |
setClientProperty(String symbolicName,
String propertyKey,
String propertyValue)
Sets a client property.
|
void |
setClientPropertyAsObject(String symbolicName,
String propertyKey,
Object propertyValue)
Sets a client property from an object.
|
public Map<String,String> getAllApplicationProperties(String symbolicName)
symbolicName
- Symbolic name of the bundle.public Map<String,String> getAllClientProperties(String symbolicName)
symbolicName
- Symbolic name of the bundle.@Transactional(readOnly=true, propagation=SUPPORTS) public String getApplicationProperty(String symbolicName, String propertyKey) throws PluginPropertyManagementException
symbolicName
- Symbolic name of the bundle, the property should be read from.propertyKey
- The key of the property.PluginPropertyManagementException
- Exception.@Transactional(readOnly=true, propagation=SUPPORTS) public String getApplicationProperty(String symbolicName, String propertyKey, String defaultValue) throws PluginPropertyManagementException
symbolicName
- Symbolic name of the bundle.propertyKey
- The key of the property.defaultValue
- The default value.PluginPropertyManagementException
- Exception.@Transactional(readOnly=true, propagation=SUPPORTS) public String getApplicationPropertyUncached(String symbolicName, String propertyKey) throws PluginPropertyManagementException
symbolicName
- Symbolic name of the bundle, the property should be read from.propertyKey
- The key of the property.PluginPropertyManagementException
- Exception.@Transactional(readOnly=true) public String getClientProperty(String symbolicName, String propertyKey)
symbolicName
- Symbolic name of the bundle to use.propertyKey
- The key of the property.@Transactional(readOnly=true) public String getClientProperty(String symbolicName, String propertyKey, String defaultValue)
symbolicName
- Symbolic name of the bundle to use.propertyKey
- The key of the property.defaultValue
- The default value.@Transactional(readOnly=true) public <T extends Serializable> T getClientPropertyAsObject(String symbolicName, String propertyKey, Class<T> clazz) throws PluginPropertyManagementException
T
- Type of the value. If the type implements
com.communote.server.core.common.time.LastModificationAware the last modification
date of the result will be set from the last modification date of the property.
The getters and setters must be ignored from JSON serialization.symbolicName
- Symbolic name of the bundle to use.propertyKey
- The key of the property.clazz
- containing the type.PluginPropertyManagementException
- Exception.@PostConstruct public void init()
public void setApplicationProperty(String symbolicName, String propertyKey, String propertyValue) throws AuthorizationException
symbolicName
- Symbolic name of the bundle to use.propertyKey
- The key of the property.propertyValue
- The value of the property.AuthorizationException
- in case the current client is not the global clientpublic void setClientProperty(String symbolicName, String propertyKey, String propertyValue)
symbolicName
- Symbolic name of the bundle to use.propertyKey
- The key of the property.propertyValue
- The value. Set this to "null" to delete the property.public void setClientPropertyAsObject(String symbolicName, String propertyKey, Object propertyValue) throws PluginPropertyManagementException
com.example.Property={"count":"42"}
symbolicName
- Symbolic name of the bundle to use.propertyKey
- The key of the property.propertyValue
- The value. Set this to "null" to delete the property.PluginPropertyManagementException
- Exception.Copyright © 2019 Communote team. All rights reserved.