Package org.jboss.hal.core
Class PropertiesOperations
- java.lang.Object
-
- org.jboss.hal.core.PropertiesOperations
-
public class PropertiesOperations extends Object
Many resources store properties in form of a sub resource similar to:{ "top-level-attribute" => undefined, "property" => { "foo" => {"value" => "bar"}, "baz" => {"value" => "qux"} } }where"property"is the properties sub resource (PSR). Each property has its onw resource with the name as key and the"value"string node as value.This class mirrors some of the methods from
CrudOperationsto save these resources together with its properties (if modified):- New properties are added as children of the PSR
- Modified properties are modified in the PSRs
- Removed properties are removed from the PSR
-
-
Constructor Summary
Constructors Constructor Description PropertiesOperations(com.google.web.bindery.event.shared.EventBus eventBus, Dispatcher dispatcher, MetadataProcessor metadataProcessor, javax.inject.Provider<Progress> progress, StatementContext statementContext, Resources resources)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsaveSingletonWithProperties(String type, ResourceAddress address, Map<String,Object> changedValues, Metadata metadata, String psr, Map<String,String> properties, Callback callback)Saves the changed values and its properties (if modified) to the specified resource.voidsaveWithProperties(String type, String name, ResourceAddress address, Map<String,Object> changedValues, Metadata metadata, String psr, Map<String,String> properties, Callback callback)Saves the changed values and its properties (if modified) to the specified resource.voidsaveWithProperties(String type, String name, ResourceAddress address, Composite operations, String psr, Map<String,String> properties, Callback callback)Saves the changed values and its properties (if modified) to the specified resource.voidsaveWithProperties(String type, String name, AddressTemplate template, Map<String,Object> changedValues, String psr, Map<String,String> properties, Callback callback)Saves the changed values and its properties (if modified) to the specified resource.
-
-
-
Constructor Detail
-
PropertiesOperations
@Inject public PropertiesOperations(com.google.web.bindery.event.shared.EventBus eventBus, Dispatcher dispatcher, MetadataProcessor metadataProcessor, @Footer javax.inject.Provider<Progress> progress, StatementContext statementContext, Resources resources)
-
-
Method Detail
-
saveWithProperties
public void saveWithProperties(String type, String name, AddressTemplate template, Map<String,Object> changedValues, String psr, Map<String,String> properties, Callback callback)
Saves the changed values and its properties (if modified) to the specified resource. After the resource has been saved a standard success message is fired and the specified callback is executed.This is the properties-extended version of
CrudOperations.save(String, String, AddressTemplate, Map, Callback):- New properties are added as children of the PSR
- Modified properties are modified in the PSRs
- Removed properties are removed from the PSR
- Parameters:
type- the human readable resource type used in the success messagename- the resource nametemplate- the address template which is resolved against the current statement context and the resource name to get the resource address for the operationchangedValues- the changed values / payload for the operationpsr- the name of the properties sub resource (PSR) - most often this is "property"properties- the properties to savecallback- the callback executed after saving the resource
-
saveWithProperties
public void saveWithProperties(String type, String name, ResourceAddress address, Map<String,Object> changedValues, Metadata metadata, String psr, Map<String,String> properties, Callback callback)
Saves the changed values and its properties (if modified) to the specified resource. After the resource has been saved a standard success message is fired and the specified callback is executed.This is the properties-extended version of
CrudOperations.save(String, String, AddressTemplate, Map, Callback):- New properties are added as children of the PSR
- Modified properties are modified in the PSRs
- Removed properties are removed from the PSR
- Parameters:
type- the human readable resource type used in the success messagename- the resource nameaddress- the fq address for the operationchangedValues- the changed values / payload for the operationmetadata- the metadata for the of the attributes in the change setpsr- the name of the properties sub resource (PSR) - most often this is "property"properties- the properties to savecallback- the callback executed after saving the resource
-
saveWithProperties
public void saveWithProperties(String type, String name, ResourceAddress address, Composite operations, String psr, Map<String,String> properties, Callback callback)
Saves the changed values and its properties (if modified) to the specified resource. After the resource has been saved a standard success message is fired and the specified callback is executed.This is the properties-extended version of
CrudOperations.save(String, String, Composite, Callback):- New properties are added as children of the PSR
- Modified properties are modified in the PSRs
- Removed properties are removed from the PSR
- Parameters:
type- the human readable resource type used in the success messagename- the resource nameaddress- the fq address for the operationoperations- the composite operation to persist the changed valuespsr- the name of the properties sub resource (PSR) - most often this is "property"properties- the properties to savecallback- the callback executed after saving the resource
-
saveSingletonWithProperties
public void saveSingletonWithProperties(String type, ResourceAddress address, Map<String,Object> changedValues, Metadata metadata, String psr, Map<String,String> properties, Callback callback)
Saves the changed values and its properties (if modified) to the specified resource. After the resource has been saved a standard success message is fired and the specified callback is executed.This is the properties-extended version of
CrudOperations.saveSingleton(String, AddressTemplate, Map, Callback):- New properties are added as children of the PSR
- Modified properties are modified in the PSRs
- Removed properties are removed from the PSR
- Parameters:
type- the human readable resource type used in the success messageaddress- the fq address for the operationchangedValues- the changed values / payload for the operationmetadata- the metadata for the of the attributes in the change setpsr- the name of the properties sub resource (PSR) - most often this is "property"properties- the properties to savecallback- the callback executed after saving the resource
-
-