use of org.jboss.hal.dmr.Operation in project console by hal.
the class ServerPresenter method showSessions.
// ------------------------------------------------------ connection / sessions
void showSessions(ModelNode connection) {
selectConnection(connection.get(CONNECTION_ID).asString());
Operation operation = new Operation.Builder(resourceAddress(), LIST_SESSIONS_AS_JSON).param(CONNECTION_ID, connectionId).build();
dispatcher.execute(operation, result -> {
List<ModelNode> sessions = Json.parseArray(result.asString(), SESSION_METADATA, ImmutableMap.of("sessionID", SESSION_ID, "creationTime", CREATION_TIMESTAMP, "consumerCount", CONSUMER_COUNT));
setCreationTime(sessions);
getView().updateSessions(sessions);
});
}
use of org.jboss.hal.dmr.Operation in project console by hal.
the class ServerPresenter method rollbackTransaction.
// ------------------------------------------------------ transaction
void rollbackTransaction(ModelNode transaction) {
if (transaction != null) {
String transactionId = transaction.get(TRANSACTION_ID).asString();
Operation operation = new Operation.Builder(resourceAddress(), ROLLBACK_PREPARED_TRANSACTION).param(TRANSACTION_ID, transactionId).build();
dispatcher.execute(operation, result -> MessageEvent.fire(getEventBus(), Message.success(resources.messages().rollbackTransactionSuccess(transactionId))));
}
}
use of org.jboss.hal.dmr.Operation in project console by hal.
the class MicroProfileHealthPresenter method reload.
@Override
protected void reload() {
ResourceAddress address = MICROPROFILE_HEALTH_TEMPLATE.resolve(statementContext);
Operation operation = new Operation.Builder(address, CHECK).build();
dispatcher.execute(operation, result -> getView().update(result));
}
use of org.jboss.hal.dmr.Operation in project console by hal.
the class WebservicesPreview method update.
@Override
public void update(SubsystemMetadata item) {
ResourceAddress runtimeAddress = WEBSERVICES_RUNTIME_TEMPLATE.resolve(statementContext);
Operation opSubsystem = new Operation.Builder(runtimeAddress, READ_RESOURCE_OPERATION).param(INCLUDE_RUNTIME, true).param(RESOLVE_EXPRESSIONS, true).build();
dispatcher.execute(opSubsystem, result -> {
boolean statsEnabled = result.get(STATISTICS_ENABLED).asBoolean(false);
attributes.refresh(result);
Elements.setVisible(noStatistics.element(), !statsEnabled);
Elements.setVisible(attributesElement, statsEnabled);
});
}
use of org.jboss.hal.dmr.Operation in project console by hal.
the class DeploymentPresenter method invalidateSession.
void invalidateSession(Session session) {
DialogFactory.showConfirmation(resources.constants().invalidateSession(), resources.messages().invalidateSessionQuestion(), () -> {
Operation operation = new Operation.Builder(deploymentAddress(), INVALIDATE_SESSION).param(SESSION_ID, session.getSessionId()).build();
dispatcher.execute(operation, result -> {
MessageEvent.fire(getEventBus(), Message.success(resources.messages().invalidateSessionSuccess()));
reload();
}, (op, failure) -> MessageEvent.fire(getEventBus(), Message.error(resources.messages().invalidateSessionError(failure))));
});
}
Aggregations