use of org.eclipse.che.api.workspace.server.spi.StateException in project che-server by eclipse-che.
the class KubernetesInternalRuntime method markStopping.
@Override
protected void markStopping() throws InfrastructureException {
RuntimeIdentity runtimeId = getContext().getIdentity();
// Check if runtime is in STARTING phase to actualize state of startSynchronizer.
Optional<WorkspaceStatus> statusOpt = runtimeStates.getStatus(runtimeId);
if (statusOpt.isPresent() && statusOpt.get() == WorkspaceStatus.STARTING) {
startSynchronizer.start();
}
if (!runtimeStates.updateStatus(runtimeId, s -> s == WorkspaceStatus.RUNNING || s == WorkspaceStatus.STARTING, WorkspaceStatus.STOPPING)) {
throw new StateException("The environment must be running or starting");
}
}
use of org.eclipse.che.api.workspace.server.spi.StateException in project devspaces-images by redhat-developer.
the class KubernetesInternalRuntime method markStopping.
@Override
protected void markStopping() throws InfrastructureException {
RuntimeIdentity runtimeId = getContext().getIdentity();
// Check if runtime is in STARTING phase to actualize state of startSynchronizer.
Optional<WorkspaceStatus> statusOpt = runtimeStates.getStatus(runtimeId);
if (statusOpt.isPresent() && statusOpt.get() == WorkspaceStatus.STARTING) {
startSynchronizer.start();
}
if (!runtimeStates.updateStatus(runtimeId, s -> s == WorkspaceStatus.RUNNING || s == WorkspaceStatus.STARTING, WorkspaceStatus.STOPPING)) {
throw new StateException("The environment must be running or starting");
}
}
Aggregations