use of org.kie.workbench.common.services.shared.resources.PerspectiveIds.SERVER_MANAGEMENT in project kie-wb-common by kiegroup.
the class AbstractBuildAndDeployExecutor method saveContainerSpecAndMaybeStartContainer.
protected void saveContainerSpecAndMaybeStartContainer(final BuildExecutionContext context, final ContainerSpec containerSpec) {
specManagementService.call(ignore -> {
if (!context.isStartContainer()) {
notificationEvent.fire(new NotificationEvent(CONSTANTS.DeploySuccessful(), NotificationEvent.NotificationType.SUCCESS).setAutoHide(false).setNavigation(CONSTANTS.ViewDeploymentDetails(), new DefaultPlaceRequest(SERVER_MANAGEMENT)));
finish();
return;
}
specManagementService.call(ignore2 -> {
notificationEvent.fire(new NotificationEvent(CONSTANTS.DeploySuccessfulAndContainerStarted(), NotificationEvent.NotificationType.SUCCESS).setAutoHide(false).setNavigation(CONSTANTS.ViewDeploymentDetails(), new DefaultPlaceRequest(SERVER_MANAGEMENT)));
finish();
}, (o, throwable) -> {
notificationEvent.fire(new NotificationEvent(CONSTANTS.DeploySuccessfulButContainerFailedToStart(), NotificationEvent.NotificationType.WARNING).setAutoHide(false).setNavigation(CONSTANTS.ViewDeploymentDetails(), new DefaultPlaceRequest(SERVER_MANAGEMENT)));
finish();
return false;
}).startContainer(containerSpec);
}, (o, throwable) -> {
notificationEvent.fire(new NotificationEvent(CONSTANTS.DeployFailed(), NotificationEvent.NotificationType.ERROR).setAutoHide(false).setNavigation(CONSTANTS.ViewDeploymentDetails(), new DefaultPlaceRequest(SERVER_MANAGEMENT)));
finish();
return false;
}).saveContainerSpec(context.getServerTemplate().getId(), containerSpec);
}
use of org.kie.workbench.common.services.shared.resources.PerspectiveIds.SERVER_MANAGEMENT in project kie-wb-common by kiegroup.
the class AbstractBuildAndDeployExecutor method updateContainerSpec.
protected void updateContainerSpec(final BuildExecutionContext context, final ContainerSpec containerSpec) {
ServerTemplate serverTemplate = context.getServerTemplate();
if (serverTemplate.getMode().equals(KieServerMode.DEVELOPMENT)) {
containerSpec.setStatus(serverTemplate.getContainerSpec(containerSpec.getId()).getStatus());
specManagementService.call(ignore -> {
notifyUpdateSuccess();
}, (o, throwable) -> {
notifyUpdateError();
return false;
}).updateContainerSpec(context.getServerTemplate().getId(), containerSpec);
} else {
notificationEvent.fire(new NotificationEvent(CONSTANTS.DeploymentSkippedCannotUpdateDeploymentsOnProduction(), ERROR).setAutoHide(false).setNavigation(CONSTANTS.ViewDeploymentDetails(), new DefaultPlaceRequest(SERVER_MANAGEMENT)));
finish();
}
}
Aggregations