Package org.jboss.hal.core
Class ComplexAttributeOperations
- java.lang.Object
-
- org.jboss.hal.core.ComplexAttributeOperations
-
public class ComplexAttributeOperations extends Object
Class to create, read, update and delete complex attributes. This class mirrors and delegates to methods fromCrudOperations.
-
-
Constructor Summary
Constructors Constructor Description ComplexAttributeOperations(CrudOperations crud, 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 voidadd(String id, String resource, String complexAttribute, String type, AddressTemplate template, Iterable<String> attributes, Callback callback)Opens an add-resource-dialog for the given complex attribute.voidadd(String id, String resource, String complexAttribute, String type, AddressTemplate template, Callback callback)Opens an add-resource-dialog for the given complex attribute.voidadd(String resource, String complexAttribute, String type, AddressTemplate template, ModelNode payload, Callback callback)Writes the payload to the complex attribute in the specified resource.voidadd(String complexAttribute, String type, ResourceAddress address, ModelNode payload, Callback callback)Writes the payload to the complex attribute in the specified resource.voidlistAdd(String id, String resource, String complexAttribute, String type, AddressTemplate template, Iterable<String> attributes, Callback callback)Opens an add-resource-dialog for the given complex attribute.voidlistAdd(String id, String resource, String complexAttribute, String type, AddressTemplate template, Callback callback)Opens an add-resource-dialog for the given complex attribute.voidlistAdd(String resource, String complexAttribute, String type, AddressTemplate template, ModelNode payload, Callback callback)Adds the payload to the complex attribute in the specified resource.voidremove(String complexAttribute, String type, int index, ResourceAddress address, Callback callback)Undefines the complex attribute at the specified index.voidremove(String resource, String complexAttribute, String type, int index, AddressTemplate template, Callback callback)Undefines the complex attribute at the specified index.voidremove(String resource, String complexAttribute, String type, AddressTemplate template, Callback callback)Undefines the complex attribute.voidremove(String complexAttribute, String type, ResourceAddress address, Callback callback)Undefines the complex attribute.<T> voidreset(String resource, String complexAttribute, String type, AddressTemplate template, Form<T> form, Callback callback)Undefines all non required attributes in the specified form.<T> voidreset(String resource, String complexAttribute, String type, AddressTemplate template, Metadata metadata, Form<T> form, Callback callback)Undefines all non required attributes in the specified form.<T> voidreset(String complexAttribute, String type, ResourceAddress address, Metadata metadata, Form<T> form, Callback callback)Undefines all non required attributes in the specified form.voidsave(String complexAttribute, String type, int index, ResourceAddress address, Map<String,Object> changedValues, Metadata metadata, Callback callback)Writes the changed values to the list-type complex attribute.voidsave(String resource, String complexAttribute, String type, int index, AddressTemplate template, Map<String,Object> changedValues, Callback callback)Writes the changed values to the list-type complex attribute.voidsave(String resource, String complexAttribute, String type, AddressTemplate template, Map<String,Object> changedValues, Callback callback)Writes the changed values to the complex attribute.voidsave(String complexAttribute, String type, ResourceAddress address, Map<String,Object> changedValues, Metadata metadata, Callback callback)Writes the changed values to the complex attribute.voidsave(String complexAttribute, String type, ResourceAddress address, ModelNode payload, Callback callback)Writes the full payload to the complex attribute in the specified resource.
-
-
-
Constructor Detail
-
ComplexAttributeOperations
@Inject public ComplexAttributeOperations(CrudOperations crud, com.google.web.bindery.event.shared.EventBus eventBus, Dispatcher dispatcher, MetadataProcessor metadataProcessor, @Footer javax.inject.Provider<Progress> progress, StatementContext statementContext, Resources resources)
-
-
Method Detail
-
add
public void add(String id, String resource, String complexAttribute, String type, AddressTemplate template, Callback callback)
Opens an add-resource-dialog for the given complex attribute. The dialog contains fields for all required attributes. When clicking "Add", a new complex attribute is created and written to the specified resource. After the resource has been updated, a success message is fired and the specified callback is executed.- Parameters:
id- the id used for the add resource dialogresource- the resource namecomplexAttribute- the name of the complex attributetype- the human readable name of the complex attributetemplate- the address template which is resolved against the current statement context and the resource name to get the resource address for the operationcallback- the callback executed after the resource has been added
-
add
public void add(String id, String resource, String complexAttribute, String type, AddressTemplate template, Iterable<String> attributes, Callback callback)
Opens an add-resource-dialog for the given complex attribute. The dialog contains fields for all required attributes. When clicking "Add", a new complex attribute is created and written to the specified resource. After the resource has been updated, a success message is fired and the specified callback is executed.- Parameters:
id- the id used for the add resource dialogresource- the resource namecomplexAttribute- the name of the complex attributetype- the human readable name of the complex attributetemplate- the address template which is resolved against the current statement context and the resource name to get the resource address for the operationattributes- additional attributes which should be part of the add resource dialogcallback- the callback executed after the resource has been added
-
listAdd
public void listAdd(String id, String resource, String complexAttribute, String type, AddressTemplate template, Callback callback)
Opens an add-resource-dialog for the given complex attribute. The dialog contains fields for all required attributes. When clicking "Add", a new model node is created and added to the complex attribute in the specified resource. After the resource has been updated, a success message is fired and the specified callback is executed.- Parameters:
id- the id used for the add resource dialogresource- the resource namecomplexAttribute- the name of the complex attributetype- the human readable name of the complex attributetemplate- the address template which is resolved against the current statement context and the resource name to get the resource address for the operationcallback- the callback executed after the resource has been added
-
listAdd
public void listAdd(String id, String resource, String complexAttribute, String type, AddressTemplate template, Iterable<String> attributes, Callback callback)
Opens an add-resource-dialog for the given complex attribute. If the resource contains required attributes, they are displayed, otherwise all attributes are displayed. When clicking "Add", a new model node is created and added to the complex attribute in the specified resource. After the resource has been updated, a success message is fired and the specified callback is executed.- Parameters:
id- the id used for the add resource dialogresource- the resource namecomplexAttribute- the name of the complex attributetype- the human readable name of the complex attributetemplate- the address template which is resolved against the current statement context and the resource name to get the resource address for the operationattributes- additional attributes which should be part of the add resource dialogcallback- the callback executed after the resource has been added
-
add
public void add(String resource, String complexAttribute, String type, AddressTemplate template, @Nullable ModelNode payload, Callback callback)
Writes the payload to the complex attribute in the specified resource. After the resource has been updated, a success message is fired and the specified callback is executed.- Parameters:
resource- the resource namecomplexAttribute- the name of the complex attributetype- the human readable name of the complex attributetemplate- the address template which is resolved against the current statement context and the resource name to get the resource address for the operationpayload- the optional payload for the complex attribute (may be null or undefined)callback- the callback executed after the resource has been added
-
add
public void add(String complexAttribute, String type, ResourceAddress address, @Nullable ModelNode payload, Callback callback)
Writes the payload to the complex attribute in the specified resource. After the resource has been updated, a success message is fired and the specified callback is executed.- Parameters:
complexAttribute- the name of the complex attributetype- the human readable name of the complex attributeaddress- the fq address for the operationpayload- the optional payload for the complex attribute (may be null or undefined)callback- the callback executed after the resource has been added
-
listAdd
public void listAdd(String resource, String complexAttribute, String type, AddressTemplate template, @Nullable ModelNode payload, Callback callback)
Adds the payload to the complex attribute in the specified resource. After the resource has been updated, a success message is fired and the specified callback is executed.- Parameters:
resource- the resource namecomplexAttribute- the name of the complex attributetype- the human readable name of the complex attributetemplate- the address template which is resolved against the current statement context and the resource name to get the resource address for the operationpayload- the optional payload for the complex attribute (may be null or undefined)callback- the callback executed after the resource has been added
-
save
public void save(String resource, String complexAttribute, String type, AddressTemplate template, Map<String,Object> changedValues, Callback callback)
Writes the changed values to the complex attribute. After the complex attribute has been saved a standard success message is fired and the specified callback is executed.If the change set is empty, a warning message is fired and the specified callback is executed.
- Parameters:
resource- the resource namecomplexAttribute- the name of the complex attributetype- the human readable name of the complex attributetemplate- 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 operationcallback- the callback executed after the resource has been saved
-
save
public void save(String resource, String complexAttribute, String type, int index, AddressTemplate template, Map<String,Object> changedValues, Callback callback)
Writes the changed values to the list-type complex attribute. After the complex attribute has been saved a standard success message is fired and the specified callback is executed.If the change set is empty, a warning message is fired and the specified callback is executed.
- Parameters:
resource- the resource namecomplexAttribute- the name of the complex attributetype- the human readable name of the complex attributeindex- the index for the list-type complex attributetemplate- 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 operationcallback- the callback executed after the resource has been saved
-
save
public void save(String complexAttribute, String type, ResourceAddress address, @Nullable ModelNode payload, Callback callback)
Writes the full payload to the complex attribute in the specified resource. After the resource has been updated, a success message is fired and the specified callback is executed.- Parameters:
complexAttribute- the name of the complex attributetype- the human readable name of the complex attributeaddress- the fq address for the operationpayload- the optional payload for the complex attribute (may be null or undefined)callback- the callback executed after the resource has been added
-
save
public void save(String complexAttribute, String type, ResourceAddress address, Map<String,Object> changedValues, Metadata metadata, Callback callback)
Writes the changed values to the complex attribute. After the complex attribute has been saved a standard success message is fired and the specified callback is executed.If the change set is empty, a warning message is fired and the specified callback is executed.
- Parameters:
complexAttribute- the name of the complex attributetype- the human readable name of the complex attributeaddress- the fq address for the operationchangedValues- the changed values / payload for the operationmetadata- the metadata for the complex attributecallback- the callback executed after the resource has been saved
-
save
public void save(String complexAttribute, String type, int index, ResourceAddress address, Map<String,Object> changedValues, Metadata metadata, Callback callback)
Writes the changed values to the list-type complex attribute. After the complex attribute has been saved a standard success message is fired and the specified callback is executed.If the change set is empty, a warning message is fired and the specified callback is executed.
- Parameters:
complexAttribute- the name of the complex attributetype- the human readable name of the complex attributeindex- the index for the list-type complex attributeaddress- the fq address for the operationchangedValues- the changed values / payload for the operationmetadata- the metadata for the complex attributecallback- the callback executed after the resource has been saved
-
reset
public <T> void reset(String resource, String complexAttribute, String type, AddressTemplate template, Form<T> form, Callback callback)
Undefines all non required attributes in the specified form. After the attributes in the complex attribute have been undefined a standard success message is fired and the specified callback is executed.If the form contains only required attributes, a warning message is fired and the specified callback is executed.
- Parameters:
resource- the resource namecomplexAttribute- the name of the complex attributetype- the human readable name of the complex attributetemplate- the address template which is resolved against the current statement context and the resource name to get the resource address for the operationform- the form which should be resetcallback- the callback executed after the resource has been saved
-
reset
public <T> void reset(String resource, String complexAttribute, String type, AddressTemplate template, Metadata metadata, Form<T> form, Callback callback)
Undefines all non required attributes in the specified form. After the attributes in the complex attribute have been undefined a standard success message is fired and the specified callback is executed.If the form contains only required attributes, a warning message is fired and the specified callback is executed.
- Parameters:
resource- the resource namecomplexAttribute- the name of the complex attributetype- the human readable name of the complex attributetemplate- the address template which is resolved against the current statement context and the resource name to get the resource address for the operationform- the form which should be resetcallback- the callback executed after the resource has been saved
-
reset
public <T> void reset(String complexAttribute, String type, ResourceAddress address, Metadata metadata, Form<T> form, Callback callback)
Undefines all non required attributes in the specified form. After the attributes in the complex attribute have been undefined a standard success message is fired and the specified callback is executed.If the form contains only required attributes, a warning message is fired and the specified callback is executed.
- Parameters:
complexAttribute- the name of the complex attributetype- the human readable name of the complex attributeaddress- the fq address for the operationform- the form which should be resetcallback- the callback executed after the resource has been saved
-
remove
public void remove(String resource, String complexAttribute, String type, AddressTemplate template, Callback callback)
Undefines the complex attribute. After the attribute has been undefined a standard success message is fired and the specified callback is executed.- Parameters:
resource- the resource namecomplexAttribute- the name of the complex attributetype- the human readable name of the complex attributetemplate- the address template which is resolved against the current statement context and the resource name to get the resource address for the operationcallback- the callback executed after the complex attribute has been undefined
-
remove
public void remove(String complexAttribute, String type, ResourceAddress address, Callback callback)
Undefines the complex attribute. After the attribute has been undefined a standard success message is fired and the specified callback is executed.- Parameters:
complexAttribute- the name of the complex attributetype- the human readable name of the complex attributeaddress- the fq address for the operationcallback- the callback executed after the complex attribute has been undefined
-
remove
public void remove(String resource, String complexAttribute, String type, int index, AddressTemplate template, Callback callback)
Undefines the complex attribute at the specified index. After the attribute has been undefined a standard success message is fired and the specified callback is executed.- Parameters:
resource- the resource namecomplexAttribute- the name of the complex attributetype- the human readable name of the complex attributeindex- the index for the list-type complex attributetemplate- the address template which is resolved against the current statement context and the resource name to get the resource address for the operationcallback- the callback executed after the complex attribute has been undefined
-
remove
public void remove(String complexAttribute, String type, int index, ResourceAddress address, Callback callback)
Undefines the complex attribute at the specified index. After the attribute has been undefined a standard success message is fired and the specified callback is executed.- Parameters:
complexAttribute- the name of the complex attributetype- the human readable name of the complex attributeindex- the index for the list-type complex attributeaddress- the fq address for the operationcallback- the callback executed after the complex attribute has been undefined
-
-