use of org.jboss.hal.core.OperationFactory in project console by hal.
the class ResourceAdapterView method saveConfiguration.
void saveConfiguration(Form<ModelNode> form, Map<String, Object> changedValues) {
changedValues.remove(CONFIG_PROPERTIES);
changedValues.remove(WM_SECURITY_MAPPING_GROUPS);
changedValues.remove(WM_SECURITY_MAPPING_USERS);
ResourceAddress address = SELECTED_RESOURCE_ADAPTER_TEMPLATE.resolve(selectionAwareStatementContext);
OperationFactory operationFactory = new OperationFactory();
Metadata metadata = mbuiContext.metadataRegistry().lookup(RESOURCE_ADAPTER_TEMPLATE);
Composite operations = operationFactory.fromChangeSet(address, changedValues, metadata);
Operation groupMappings = mappingsOperation(address, form, WM_SECURITY_MAPPING_GROUPS);
if (groupMappings != null) {
operations.add(groupMappings);
}
Operation userMappings = mappingsOperation(address, form, WM_SECURITY_MAPPING_USERS);
if (userMappings != null) {
operations.add(userMappings);
}
FormItem<Map<String, String>> formItem = form.getFormItem(CONFIG_PROPERTIES);
Map<String, String> configProperties = formItem != null ? formItem.getValue() : Collections.emptyMap();
mbuiContext.po().saveWithProperties(Names.RESOURCE_ADAPTER, presenter.getResourceAdapter(), address, operations, CONFIG_PROPERTIES, configProperties, () -> presenter.reload());
}
use of org.jboss.hal.core.OperationFactory in project console by hal.
the class SocketBindingGroupPresenter method saveClientMapping.
void saveClientMapping(Metadata metadata, ModelNode clientMapping, Map<String, Object> changedValues) {
ResourceAddress address = SELECTED_TEMPLATE.append(INBOUND.templateSuffix()).resolve(statementContext, inbound);
OperationFactory operationFactory = new OperationFactory(name -> CLIENT_MAPPINGS + "[" + clientMapping.get(INDEX).asInt() + "]." + name);
Composite operations = operationFactory.fromChangeSet(address, changedValues, metadata);
dispatcher.execute(operations, (CompositeResult result) -> {
MessageEvent.fire(getEventBus(), Message.success(resources.messages().modifySingleResourceSuccess(Names.CLIENT_MAPPING)));
reloadClientMappings();
});
}
use of org.jboss.hal.core.OperationFactory in project console by hal.
the class HostPresenter method saveHeader.
@Override
public void saveHeader(int pathIndex, int index, String header, Metadata metadata, Map<String, Object> changedValues, SafeHtml successMessage) {
ResourceAddress address = HTTP_INTERFACE_TEMPLATE.resolve(statementContext);
OperationFactory operationFactory = new OperationFactory(name -> constantsHeadersIndex(pathIndex) + DOT + headersIndex(index) + DOT + name);
Composite composite = operationFactory.fromChangeSet(address, changedValues, metadata);
dispatcher.execute(composite, (CompositeResult result) -> {
reloadHeaders(pathIndex);
MessageEvent.fire(getEventBus(), Message.success(successMessage));
});
}
use of org.jboss.hal.core.OperationFactory in project console by hal.
the class StandaloneServerPresenter method saveHeader.
@Override
public void saveHeader(int pathIndex, int index, String header, Metadata metadata, Map<String, Object> changedValues, SafeHtml successMessage) {
ResourceAddress address = HTTP_INTERFACE_TEMPLATE.resolve(statementContext);
OperationFactory operationFactory = new OperationFactory(name -> constantsHeadersIndex(pathIndex) + DOT + headersIndex(index) + DOT + name);
Composite composite = operationFactory.fromChangeSet(address, changedValues, metadata);
dispatcher.execute(composite, (CompositeResult result) -> {
reloadHeaders(pathIndex);
MessageEvent.fire(getEventBus(), Message.success(successMessage));
});
}
Aggregations