Class ComplexAttributeOperations


  • public class ComplexAttributeOperations
    extends Object
    Class to create, read, update and delete complex attributes. This class mirrors and delegates to methods from CrudOperations.
    • 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 dialog
        resource - the resource name
        complexAttribute - the name of the complex attribute
        type - the human readable name of the complex attribute
        template - the address template which is resolved against the current statement context and the resource name to get the resource address for the operation
        callback - 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 dialog
        resource - the resource name
        complexAttribute - the name of the complex attribute
        type - the human readable name of the complex attribute
        template - the address template which is resolved against the current statement context and the resource name to get the resource address for the operation
        attributes - additional attributes which should be part of the add resource dialog
        callback - 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 dialog
        resource - the resource name
        complexAttribute - the name of the complex attribute
        type - the human readable name of the complex attribute
        template - the address template which is resolved against the current statement context and the resource name to get the resource address for the operation
        callback - 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 dialog
        resource - the resource name
        complexAttribute - the name of the complex attribute
        type - the human readable name of the complex attribute
        template - the address template which is resolved against the current statement context and the resource name to get the resource address for the operation
        attributes - additional attributes which should be part of the add resource dialog
        callback - 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 name
        complexAttribute - the name of the complex attribute
        type - the human readable name of the complex attribute
        template - the address template which is resolved against the current statement context and the resource name to get the resource address for the operation
        payload - 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 attribute
        type - the human readable name of the complex attribute
        address - the fq address for the operation
        payload - 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 name
        complexAttribute - the name of the complex attribute
        type - the human readable name of the complex attribute
        template - the address template which is resolved against the current statement context and the resource name to get the resource address for the operation
        payload - 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 name
        complexAttribute - the name of the complex attribute
        type - the human readable name of the complex attribute
        template - the address template which is resolved against the current statement context and the resource name to get the resource address for the operation
        changedValues - the changed values / payload for the operation
        callback - 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 name
        complexAttribute - the name of the complex attribute
        type - the human readable name of the complex attribute
        index - the index for the list-type complex attribute
        template - the address template which is resolved against the current statement context and the resource name to get the resource address for the operation
        changedValues - the changed values / payload for the operation
        callback - 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 attribute
        type - the human readable name of the complex attribute
        address - the fq address for the operation
        payload - 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 attribute
        type - the human readable name of the complex attribute
        address - the fq address for the operation
        changedValues - the changed values / payload for the operation
        metadata - the metadata for the complex attribute
        callback - 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 attribute
        type - the human readable name of the complex attribute
        index - the index for the list-type complex attribute
        address - the fq address for the operation
        changedValues - the changed values / payload for the operation
        metadata - the metadata for the complex attribute
        callback - 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 name
        complexAttribute - the name of the complex attribute
        type - the human readable name of the complex attribute
        template - the address template which is resolved against the current statement context and the resource name to get the resource address for the operation
        form - the form which should be reset
        callback - 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 name
        complexAttribute - the name of the complex attribute
        type - the human readable name of the complex attribute
        template - the address template which is resolved against the current statement context and the resource name to get the resource address for the operation
        form - the form which should be reset
        callback - 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 attribute
        type - the human readable name of the complex attribute
        address - the fq address for the operation
        form - the form which should be reset
        callback - 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 name
        complexAttribute - the name of the complex attribute
        type - the human readable name of the complex attribute
        template - the address template which is resolved against the current statement context and the resource name to get the resource address for the operation
        callback - 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 attribute
        type - the human readable name of the complex attribute
        address - the fq address for the operation
        callback - 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 name
        complexAttribute - the name of the complex attribute
        type - the human readable name of the complex attribute
        index - the index for the list-type complex attribute
        template - the address template which is resolved against the current statement context and the resource name to get the resource address for the operation
        callback - 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 attribute
        type - the human readable name of the complex attribute
        index - the index for the list-type complex attribute
        address - the fq address for the operation
        callback - the callback executed after the complex attribute has been undefined