use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class ContainerRulesConfigPresenter method upgrade.
public void upgrade(final String version) {
view.disableActions();
ruleCapabilitiesService.call(new RemoteCallback<Void>() {
@Override
public void callback(final Void response) {
if (version != null && !version.isEmpty() && version.compareTo(containerSpec.getReleasedId().getVersion()) == 0) {
notification.fire(new NotificationEvent(view.getUpgradeSuccessMessage(), NotificationEvent.NotificationType.SUCCESS));
}
updateViewState();
}
}, new ErrorCallback<Object>() {
@Override
public boolean error(final Object o, final Throwable throwable) {
notification.fire(new NotificationEvent(view.getUpgradeErrorMessage(), NotificationEvent.NotificationType.ERROR));
updateViewState();
return false;
}
}).upgradeContainer(containerSpec, new ReleaseId(containerSpec.getReleasedId().getGroupId(), containerSpec.getReleasedId().getArtifactId(), version));
}
use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class NewContainerWizard method complete.
@Override
public void complete() {
final Map<Capability, ContainerConfig> mapConfig = new HashMap<Capability, ContainerConfig>();
if (getPages().size() == 2) {
mapConfig.put(Capability.PROCESS, processConfigPagePresenter.buildProcessConfig());
}
mapConfig.put(Capability.RULE, new RuleConfig(null, KieScannerStatus.STOPPED));
final ContainerSpec newContainer = newContainerFormPresenter.buildContainerSpec(newContainerFormPresenter.getServerTemplate().getId(), mapConfig);
specManagementService.call(new RemoteCallback<Void>() {
@Override
public void callback(final Void o) {
notification.fire(new NotificationEvent(newContainerFormPresenter.getView().getNewContainerWizardSaveSuccess(), NotificationEvent.NotificationType.SUCCESS));
clear();
NewContainerWizard.super.complete();
serverTemplateSelectedEvent.fire(new ServerTemplateSelected(serverTemplate, newContainer.getId()));
}
}, new ErrorCallback<Object>() {
@Override
public boolean error(final Object o, final Throwable throwable) {
notification.fire(new NotificationEvent(newContainerFormPresenter.getView().getNewContainerWizardSaveError(), NotificationEvent.NotificationType.ERROR));
NewContainerWizard.this.pageSelected(0);
NewContainerWizard.this.start();
return false;
}
}).saveContainerSpec(newContainerFormPresenter.getServerTemplate().getId(), newContainer);
}
Aggregations