Search in sources :

Example 81 with Composite

use of org.jboss.hal.dmr.Composite in project console by hal.

the class ComplexAttributeOperations method save.

// ------------------------------------------------------ (u)pdate using address
/**
 * 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.
 * <p>
 * If the change set is empty, a warning message is fired and the specified callback is executed.
 *
 * @param complexAttribute the name of the complex attribute
 * @param type the human readable name of the complex attribute
 * @param address the fq address for the operation
 * @param changedValues the changed values / payload for the operation
 * @param metadata the metadata for the complex attribute
 * @param callback the callback executed after the resource has been saved
 */
@JsIgnore
public void save(String complexAttribute, String type, ResourceAddress address, Map<String, Object> changedValues, Metadata metadata, Callback callback) {
    Composite operations = operationFactory(complexAttribute).fromChangeSet(address, changedValues, metadata);
    crud.save(operations, resources.messages().modifySingleResourceSuccess(type), callback);
}
Also used : Composite(org.jboss.hal.dmr.Composite) JsIgnore(jsinterop.annotations.JsIgnore)

Aggregations

Composite (org.jboss.hal.dmr.Composite)81 Operation (org.jboss.hal.dmr.Operation)53 CompositeResult (org.jboss.hal.dmr.CompositeResult)50 ResourceAddress (org.jboss.hal.dmr.ResourceAddress)43 ModelNode (org.jboss.hal.dmr.ModelNode)39 ArrayList (java.util.ArrayList)25 List (java.util.List)24 Dispatcher (org.jboss.hal.dmr.dispatch.Dispatcher)22 AddressTemplate (org.jboss.hal.meta.AddressTemplate)22 ModelDescriptionConstants (org.jboss.hal.dmr.ModelDescriptionConstants)21 StatementContext (org.jboss.hal.meta.StatementContext)20 Inject (javax.inject.Inject)19 EventBus (com.google.web.bindery.event.shared.EventBus)18 Metadata (org.jboss.hal.meta.Metadata)18 Ids (org.jboss.hal.resources.Ids)17 Resources (org.jboss.hal.resources.Resources)17 Message (org.jboss.hal.spi.Message)17 MessageEvent (org.jboss.hal.spi.MessageEvent)17 Collectors.toList (java.util.stream.Collectors.toList)16 Provider (javax.inject.Provider)16