use of org.jboss.hal.dmr.ResourceAddress in project console by hal.
the class ClusteringPresenter method addBridge.
void addBridge(ServerSubResource ssr) {
Metadata metadata = metadataRegistry.lookup(ssr.template);
NameItem nameItem = new NameItem();
Form<ModelNode> form = new ModelNodeForm.Builder<>(Ids.build(ssr.baseId, Ids.ADD), metadata).unboundFormItem(nameItem, 0).fromRequestProperties().include(QUEUE_NAME, DISCOVERY_GROUP, STATIC_CONNECTORS).unsorted().build();
List<AddressTemplate> templates = asList(SELECTED_SERVER_TEMPLATE.append(CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(IN_VM_CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(HTTP_CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(REMOTE_CONNECTOR + EQ_WILDCARD));
form.getFormItem(DISCOVERY_GROUP).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, SELECTED_SERVER_TEMPLATE.append(DISCOVERY_GROUP + EQ_WILDCARD)));
form.getFormItem(STATIC_CONNECTORS).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, templates));
new AddResourceDialog(resources.messages().addResourceTitle(ssr.type), form, (name, model) -> {
name = nameItem.getValue();
ResourceAddress address = SELECTED_SERVER_TEMPLATE.append(ssr.resource + "=" + name).resolve(statementContext);
crud.add(ssr.type, name, address, model, (n, a) -> reload());
}).show();
}
use of org.jboss.hal.dmr.ResourceAddress in project console by hal.
the class ClusteringPresenter method reload.
@Override
protected void reload() {
ResourceAddress address = SELECTED_SERVER_TEMPLATE.resolve(statementContext);
crud.readChildren(address, asList(BROADCAST_GROUP, DISCOVERY_GROUP, CLUSTER_CONNECTION, GROUPING_HANDLER, BRIDGE), result -> {
getView().updateBroadcastGroup(asNamedNodes(result.step(0).get(RESULT).asPropertyList()));
getView().updateDiscoveryGroup(asNamedNodes(result.step(1).get(RESULT).asPropertyList()));
getView().updateClusterConnection(asNamedNodes(result.step(2).get(RESULT).asPropertyList()));
getView().updateGroupingHandler(asNamedNodes(result.step(3).get(RESULT).asPropertyList()));
getView().updateBridge(asNamedNodes(result.step(4).get(RESULT).asPropertyList()));
});
}
use of org.jboss.hal.dmr.ResourceAddress in project console by hal.
the class ConnectionPresenter method addHttpConnector.
void addHttpConnector() {
ServerSubResource ssr = ServerSubResource.HTTP_CONNECTOR;
Metadata metadata = metadataRegistry.lookup(ssr.template);
Form<ModelNode> form = new ModelNodeForm.Builder<>(Ids.build(ssr.baseId, Ids.ADD), metadata).unboundFormItem(new NameItem(), 0).fromRequestProperties().requiredOnly().build();
form.getFormItem(SOCKET_BINDING).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, AddressTemplate.of("/socket-binding-group=*/socket-binding=*")));
form.getFormItem(ENDPOINT).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, AddressTemplate.of("/{selected.profile}/subsystem=messaging-activemq/server=*/http-acceptor=*")));
new AddResourceDialog(ssr.type, form, (name, model) -> {
ResourceAddress address = SELECTED_SERVER_TEMPLATE.append(ssr.resource + EQ + name).resolve(statementContext);
crud.add(ssr.type, name, address, model, (n, a) -> reload());
}).show();
}
use of org.jboss.hal.dmr.ResourceAddress in project console by hal.
the class ConnectionPresenter method addPooledConnectionFactory.
void addPooledConnectionFactory(ServerSubResource ssr) {
Metadata metadata = metadataRegistry.lookup(ssr.template);
NameItem nameItem = new NameItem();
Form<ModelNode> form = new ModelNodeForm.Builder<>(Ids.build(ssr.baseId, Ids.ADD), metadata).unboundFormItem(nameItem, 0).fromRequestProperties().include("entries", DISCOVERY_GROUP, CONNECTORS).unsorted().build();
List<AddressTemplate> templates = asList(SELECTED_SERVER_TEMPLATE.append(CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(IN_VM_CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(HTTP_CONNECTOR + EQ_WILDCARD), SELECTED_SERVER_TEMPLATE.append(REMOTE_CONNECTOR + EQ_WILDCARD));
form.getFormItem(DISCOVERY_GROUP).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, SELECTED_SERVER_TEMPLATE.append(DISCOVERY_GROUP + EQ_WILDCARD)));
form.getFormItem(CONNECTORS).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, templates));
new AddResourceDialog(resources.messages().addResourceTitle(ssr.type), form, (name, model) -> {
name = nameItem.getValue();
ResourceAddress address = SELECTED_SERVER_TEMPLATE.append(ssr.resource + EQ + name).resolve(statementContext);
crud.add(ssr.type, name, address, model, (n, a) -> reload());
}).show();
}
use of org.jboss.hal.dmr.ResourceAddress in project console by hal.
the class LoggingProfilePresenter method reload.
@Override
protected void reload() {
ResourceAddress address = SELECTED_LOGGING_PROFILE_TEMPLATE.resolve(statementContext);
crud.read(address, 2, result -> {
// @formatter:off
if (result.hasDefined(ROOT_LOGGER_TEMPLATE.lastName())) {
getView().updateRootLogger(result.get(ROOT_LOGGER_TEMPLATE.lastName()).get(ROOT_LOGGER_TEMPLATE.lastValue()));
} else {
getView().noRootLogger();
}
getView().updateLogger(asNamedNodes(failSafePropertyList(result, LOGGER_TEMPLATE.lastName())));
getView().updateAsyncHandler(asNamedNodes(failSafePropertyList(result, ASYNC_HANDLER_TEMPLATE.lastName())));
getView().updateConsoleHandler(asNamedNodes(failSafePropertyList(result, CONSOLE_HANDLER_TEMPLATE.lastName())));
getView().updateCustomHandler(asNamedNodes(failSafePropertyList(result, CUSTOM_HANDLER_TEMPLATE.lastName())));
getView().updateFileHandler(asNamedNodes(failSafePropertyList(result, FILE_HANDLER_TEMPLATE.lastName())));
getView().updatePeriodicHandler(asNamedNodes(failSafePropertyList(result, PERIODIC_ROTATING_FILE_HANDLER_TEMPLATE.lastName())));
getView().updatePeriodicSizeHandler(asNamedNodes(failSafePropertyList(result, PERIODIC_SIZE_ROTATING_FILE_HANDLER_TEMPLATE.lastName())));
getView().updateSizeHandler(asNamedNodes(failSafePropertyList(result, SIZE_ROTATING_FILE_HANDLER_TEMPLATE.lastName())));
getView().updateSocketHandler(asNamedNodes(failSafePropertyList(result, SOCKET_HANDLER_TEMPLATE.lastName())));
getView().updateSyslogHandler(asNamedNodes(failSafePropertyList(result, SYSLOG_HANDLER_TEMPLATE.lastName())));
getView().updateCustomFormatter(asNamedNodes(failSafePropertyList(result, CUSTOM_FORMATTER_TEMPLATE.lastName())));
getView().updatePatternFormatter(asNamedNodes(failSafePropertyList(result, PATTERN_FORMATTER_TEMPLATE.lastName())));
getView().updateJsonFormatter(asNamedNodes(failSafePropertyList(result, JSON_FORMATTER_TEMPLATE.lastName())));
getView().updateXmlFormatter(asNamedNodes(failSafePropertyList(result, XML_FORMATTER_TEMPLATE.lastName())));
// @formatter:on
});
}
Aggregations