use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class ContainerPresenter method toggleActivationContainer.
public void toggleActivationContainer() {
if (containerSpec.getStatus().equals(KieContainerStatus.DEACTIVATED)) {
specManagementService.call(new RemoteCallback<Void>() {
@Override
public void callback(final Void response) {
refresh();
}
}, new ErrorCallback<Object>() {
@Override
public boolean error(final Object o, final Throwable throwable) {
notification.fire(new NotificationEvent(view.getStartContainerErrorMessage(), NotificationEvent.NotificationType.ERROR));
refresh();
return false;
}
}).activateContainer(containerSpec);
} else if (containerSpec.getStatus().equals(KieContainerStatus.STARTED)) {
specManagementService.call(new RemoteCallback<Void>() {
@Override
public void callback(final Void response) {
refresh();
}
}, new ErrorCallback<Object>() {
@Override
public boolean error(final Object o, final Throwable throwable) {
notification.fire(new NotificationEvent(view.getStartContainerErrorMessage(), NotificationEvent.NotificationType.ERROR));
refresh();
return false;
}
}).deactivateContainer(containerSpec);
}
}
use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class ContainerPresenter method startContainer.
public void startContainer() {
specManagementService.call(new RemoteCallback<Void>() {
@Override
public void callback(final Void response) {
refresh();
}
}, new ErrorCallback<Object>() {
@Override
public boolean error(final Object o, final Throwable throwable) {
notification.fire(new NotificationEvent(view.getStartContainerErrorMessage(), NotificationEvent.NotificationType.ERROR));
refresh();
return false;
}
}).startContainer(containerSpec);
}
use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class ContainerPresenter method stopContainer.
public void stopContainer() {
specManagementService.call(new RemoteCallback<Void>() {
@Override
public void callback(final Void response) {
refresh();
}
}, new ErrorCallback<Object>() {
@Override
public boolean error(final Object o, final Throwable throwable) {
notification.fire(new NotificationEvent(view.getStopContainerErrorMessage(), NotificationEvent.NotificationType.ERROR));
refresh();
return false;
}
}).stopContainer(containerSpec);
}
use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class ContainerProcessConfigPresenter method save.
public void save() {
view.disableActions();
final ProcessConfig newProcessConfig = processConfigPresenter.buildProcessConfig();
specManagementService.call(new RemoteCallback<Void>() {
@Override
public void callback(final Void containerConfig) {
notification.fire(new NotificationEvent(view.getSaveSuccessMessage(), NotificationEvent.NotificationType.SUCCESS));
setupView(newProcessConfig);
}
}, new ErrorCallback<Object>() {
@Override
public boolean error(final Object o, final Throwable throwable) {
notification.fire(new NotificationEvent(view.getSaveErrorMessage(), NotificationEvent.NotificationType.ERROR));
setupView(processConfigPresenter.getProcessConfig());
return false;
}
}).updateContainerConfig(processConfigPresenter.getContainerSpecKey().getServerTemplateKey().getId(), processConfigPresenter.getContainerSpecKey().getId(), Capability.PROCESS, newProcessConfig);
}
use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class NewServerTemplateWizard method complete.
@Override
public void complete() {
final ServerTemplate newServerTemplate = buildServerTemplate();
specManagementService.call(new RemoteCallback<Void>() {
@Override
public void callback(final Void o) {
notification.fire(new NotificationEvent(newTemplatePresenter.getView().getNewServerTemplateWizardSaveSuccess(), NotificationEvent.NotificationType.SUCCESS));
clear();
NewServerTemplateWizard.super.complete();
serverTemplateListRefreshEvent.fire(new ServerTemplateListRefresh(newServerTemplate.getId()));
}
}, new ErrorCallback<Object>() {
@Override
public boolean error(final Object o, final Throwable throwable) {
notification.fire(new NotificationEvent(newTemplatePresenter.getView().getNewServerTemplateWizardSaveError(), NotificationEvent.NotificationType.ERROR));
NewServerTemplateWizard.this.pageSelected(0);
NewServerTemplateWizard.this.start();
return false;
}
}).saveServerTemplate(newServerTemplate);
}
Aggregations