public class PropertyBagManager extends Object implements IPropertyBagManagerSPI
Constructor and Description |
---|
PropertyBagManager() |
Modifier and Type | Method and Description |
---|---|
void |
add(PropertyBag bag)
Persists a property bag.
|
void |
delete(PropertyBag bag)
Deletes the given property bag.
|
PropertyBag |
get(String propertyBagId)
Returns the property bag with the given identifier.
|
String |
getValue(String propertyBagId,
String propertyName,
String defaultValue)
Returns the value of the property with the given name for the property bag with the given identifier and, if no value was found, return the given default value.
The calculated value will be calculated considering the inherited values. When changing some property bag values, the new values will only be available in this method after the transaction that changed the property bag values is commited. This method is preferable to PropertyBag.getValue(String, String) . |
Map<String,List<String>> |
getValueMap(String propertyBagId)
Returns the value map for the property bag with the given identifier.
The resulting map will be calculated considering the inherited values and will be an unmodifiable map. When changing some property bag values, the new values will only be available in this method after the transaction that changed the property bag values is commited. This method is preferable to PropertyBag.getValueMap() . |
Tuple2<Map<String,List<String>>,Map<String,List<String>>> |
getValues(String propertyBagId)
|
List<String> |
getValues(String propertyBagId,
String propertyName,
List<String> defaultValues)
Returns the values of the property with the given name for the property bag with the given identifier and, if no value was found, return the given default values.
The calculated value will be calculated considering the inherited values. When changing some property bag values, the new values will only be available in this method after the transaction that changed the property bag values is commited. If the values could be calculated (and, thus, the default values are not used), the returned list will be immutable. If the values couldn't be found, the default values will be returned and, whether it is an immutable list is not defined. This method is preferable to PropertyBag.getValues(String, List) . |
static void |
scheduleClearCache(String propertyBagId)
Schedules a cache clear if needed.
|
public void add(PropertyBag bag) throws PortalException
IPropertyBagManager
add
in interface IPropertyBagManager
bag
- the property bag to persist.PortalException
public PropertyBag get(String propertyBagId) throws PortalException
IPropertyBagManager
get
in interface IPropertyBagManager
propertyBagId
- identifier of the property bag.PortalException
public void delete(PropertyBag bag) throws PortalException
IPropertyBagManager
Delete is not done recursively. There must not be any child property bags that have the given property bag as its parent.
delete
in interface IPropertyBagManager
bag
- the property bag to be deleted.PortalException
public String getValue(String propertyBagId, String propertyName, String defaultValue) throws PortalException
IPropertyBagManager
PropertyBag.getValue(String, String)
.getValue
in interface IPropertyBagManager
propertyBagId
- the property bag identifier.propertyName
- the property name.defaultValue
- the default value.PortalObjectNotFoundException
- if no property bag with the given identifier was found.PortalException
public Tuple2<Map<String,List<String>>,Map<String,List<String>>> getValues(String propertyBagId) throws PortalException
IPropertyBagManagerSPI
a
slot and the complete values (with the inherited values) will be in b
slot.getValues
in interface IPropertyBagManagerSPI
propertyBagId
- the property bag identifier.PortalObjectNotFoundException
- if no property with the given identifier was found.PortalException
public List<String> getValues(String propertyBagId, String propertyName, List<String> defaultValues) throws PortalException
IPropertyBagManager
PropertyBag.getValues(String, List)
.getValues
in interface IPropertyBagManager
propertyBagId
- the property bag identifier.propertyName
- the property name.PortalObjectNotFoundException
- if no property bag with the given identifier was found.PortalException
public Map<String,List<String>> getValueMap(String propertyBagId) throws PortalException
IPropertyBagManager
PropertyBag.getValueMap()
.getValueMap
in interface IPropertyBagManager
propertyBagId
- the property bag identifier.PortalObjectNotFoundException
- if no property bag with the given identifier was found.PortalException
public static void scheduleClearCache(String propertyBagId) throws PortalException
propertyBagId
- the property bag identifier.PortalException
LumisXP 12.4.0.200625 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.