diff --git a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncher.java b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncher.java index c1f2f2a7b7..cd7efe1653 100644 --- a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncher.java +++ b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncher.java @@ -123,7 +123,7 @@ public abstract class AbstractAgentLauncher implements AgentLauncher { process.start(lineConsumer); } catch (ConflictException | MachineException e) { try { - machine.getLogger().writeLine(format("[ERROR] %s", e.getMessage())); + machine.getLogger().writeLine(format("[FAILED] %s", e.getMessage())); } catch (IOException ignored) { } } diff --git a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/DefaultAgentLauncher.java b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/DefaultAgentLauncher.java index 1ad4cf47b2..9cdbe123fe 100644 --- a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/DefaultAgentLauncher.java +++ b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/DefaultAgentLauncher.java @@ -49,7 +49,7 @@ public class DefaultAgentLauncher implements AgentLauncher { // //process.start(lineConsumer); // } catch (Throwable e) { // try { -// machine.getLogger().writeLine(format("[ERROR] %s", e.getMessage())); +// machine.getLogger().writeLine(format("[FAILED] %s", e.getMessage())); // } catch (IOException ignored) { // } // } finally { diff --git a/assembly/assembly-wsmaster-war/src/main/java/org/eclipse/che/api/deploy/WsMasterModule.java b/assembly/assembly-wsmaster-war/src/main/java/org/eclipse/che/api/deploy/WsMasterModule.java index c75651d13a..c3112b636e 100644 --- a/assembly/assembly-wsmaster-war/src/main/java/org/eclipse/che/api/deploy/WsMasterModule.java +++ b/assembly/assembly-wsmaster-war/src/main/java/org/eclipse/che/api/deploy/WsMasterModule.java @@ -117,6 +117,12 @@ public class WsMasterModule extends AbstractModule { bind(org.eclipse.che.everrest.ETagResponseFilter.class); bind(org.eclipse.che.api.agent.server.AgentRegistryService.class); + // temporary solution + bind(org.eclipse.che.api.workspace.server.event.RuntimeStatusJsonRpcMessenger.class).asEagerSingleton(); + bind(org.eclipse.che.api.workspace.server.event.MachineStatusJsonRpcMessenger.class).asEagerSingleton(); + bind(org.eclipse.che.api.workspace.server.event.ServerStatusJsonRpcMessenger.class).asEagerSingleton(); + // + bind(org.eclipse.che.security.oauth.OAuthAuthenticatorProvider.class) .to(org.eclipse.che.security.oauth.OAuthAuthenticatorProviderImpl.class); bind(org.eclipse.che.security.oauth.shared.OAuthTokenProvider.class) diff --git a/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/machine/MachineLimits.java b/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/machine/MachineLimits.java deleted file mode 100644 index 0bfdbf10e2..0000000000 --- a/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/machine/MachineLimits.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012-2017 Codenvy, S.A. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Codenvy, S.A. - initial API and implementation - *******************************************************************************/ -package org.eclipse.che.api.core.model.machine; - -/** - * Describes machine limits such as RAM size. - * - * @author Alexander Garagatyi - */ -public interface MachineLimits { - /** Get memory size (in megabytes) that is allocated for starting machine. */ - int getRam(); -} diff --git a/dockerfiles/lib/src/api/wsmaster/project/project.ts b/dockerfiles/lib/src/api/wsmaster/project/project.ts index 0b42814f68..9b34c174f2 100644 --- a/dockerfiles/lib/src/api/wsmaster/project/project.ts +++ b/dockerfiles/lib/src/api/wsmaster/project/project.ts @@ -45,7 +45,7 @@ export class Project { this.workspaceDTO = workspaceDTO; // search the workspace agent link - let servers : Map = this.workspaceDTO.getRuntime().getDevMachine().getRuntime().getServers(); + let servers : Map = this.workspaceDTO.getRuntime().getDevMachine().getRuntime().getServers(); var hrefWsAgent; for (let server of servers.values()) { diff --git a/dockerfiles/lib/src/internal/action/impl/workspace-ssh-action.ts b/dockerfiles/lib/src/internal/action/impl/workspace-ssh-action.ts index 57e6ea5070..b8a9553128 100644 --- a/dockerfiles/lib/src/internal/action/impl/workspace-ssh-action.ts +++ b/dockerfiles/lib/src/internal/action/impl/workspace-ssh-action.ts @@ -104,7 +104,7 @@ export class WorkspaceSshAction { return ssh.getPair("workspace", foundWorkspaceDTO.getId()); }).then((sshPairDto : org.eclipse.che.api.ssh.shared.dto.SshPairDto) => { - let machines : Array = foundWorkspaceDTO.getRuntime().getMachines(); + let machines : Array = foundWorkspaceDTO.getRuntime().getMachines(); let runtime: org.eclipse.che.api.machine.shared.dto.MachineRuntimeInfoDto = this.getSelectedMachine(machines).getRuntime(); let user : string = runtime.getProperties().get("config.user"); if (user === "") { @@ -135,7 +135,7 @@ export class WorkspaceSshAction { }); } - private getSelectedMachine(machines : Array) : org.eclipse.che.api.machine.shared.dto.MachineDto { + private getSelectedMachine(machines : Array) : org.eclipse.che.api.workspace.shared.dto.MachineDto { for(let i : number=0; i /** Type class used to register this event. */ public static Type TYPE = new Type<>(); private final MachineStatusEvent.EventType status; - private final String machineId; + //private final String machineId; private final String workspaceId; private final String machineName; private final String error; @@ -56,8 +56,8 @@ public class DevMachineStateEvent extends GwtEvent */ public DevMachineStateEvent(MachineStatusEvent event) { this.status = event.getEventType(); - this.machineId = event.getMachineId(); - this.workspaceId = event.getWorkspaceId(); + //this.machineId = event.getMachineId(); + this.workspaceId = event.getIdentity().getWorkspaceId(); this.machineName = event.getMachineName(); this.error = event.getError(); } @@ -72,9 +72,9 @@ public class DevMachineStateEvent extends GwtEvent return status; } - public String getMachineId() { - return machineId; - } +// public String getMachineId() { +// return machineId; +// } public String getWorkspaceId() { return workspaceId; @@ -94,9 +94,9 @@ public class DevMachineStateEvent extends GwtEvent case RUNNING: handler.onDevMachineStarted(this); break; - case DESTROYED: - handler.onDevMachineDestroyed(this); - break; +// case DESTROYED: +// handler.onDevMachineDestroyed(this); +// break; } } diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/console/OutputConsoleViewImpl.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/console/OutputConsoleViewImpl.java index cc0f1ca195..aeb02b9af5 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/console/OutputConsoleViewImpl.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/console/OutputConsoleViewImpl.java @@ -59,7 +59,7 @@ import static org.eclipse.che.ide.ui.menu.PositionController.VerticalAlign.BOTTO public class OutputConsoleViewImpl extends Composite implements OutputConsoleView, ScrollHandler { private final List> output2Color = newArrayList(new Pair<>(compile("\\[\\s*(DOCKER)\\s*\\]"), "#4EABFF"), - new Pair<>(compile("\\[\\s*(ERROR)\\s*\\]"), "#FF2727"), + new Pair<>(compile("\\[\\s*(FAILED)\\s*\\]"), "#FF2727"), new Pair<>(compile("\\[\\s*(WARN)\\s*\\]"), "#F5A623"), new Pair<>(compile("\\[\\s*(STDOUT)\\s*\\]"), "#8ED72B"), new Pair<>(compile("\\[\\s*(STDERR)\\s*\\]"), "#FF4343")); diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/machine/EnvironmentStatusHandler.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/machine/EnvironmentStatusHandler.java index 10ebdcba26..ad59f78dd8 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/machine/EnvironmentStatusHandler.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/machine/EnvironmentStatusHandler.java @@ -15,7 +15,7 @@ import com.google.inject.Singleton; import com.google.web.bindery.event.shared.EventBus; import org.eclipse.che.api.core.jsonrpc.commons.RequestTransmitter; -import org.eclipse.che.api.machine.shared.dto.event.MachineStatusEvent; +import org.eclipse.che.api.workspace.shared.dto.event.MachineStatusEvent; import org.eclipse.che.api.workspace.shared.dto.RuntimeDto; import org.eclipse.che.ide.api.app.AppContext; import org.eclipse.che.ide.api.machine.ActiveRuntime; @@ -60,8 +60,8 @@ public class EnvironmentStatusHandler { } public void handleEnvironmentStatusChanged(MachineStatusEvent event) { - final String machineId = event.getMachineId(); - final String workspaceId = event.getWorkspaceId(); + final String machineId = event.getMachineName(); + final String workspaceId = event.getIdentity().getWorkspaceId(); workspaceServiceClient.getWorkspace(workspaceId).then(workspace -> { RuntimeDto workspaceRuntime = workspace.getRuntime(); @@ -72,13 +72,13 @@ public class EnvironmentStatusHandler { ((AppContextImpl)appContext).setWorkspace(workspace); switch (event.getEventType()) { - case CREATING: + case STARTING: handleMachineCreating(machineId); break; case RUNNING: handleMachineRunning(machineId); break; - case ERROR: + case FAILED: handleMachineError(event); break; } diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/processes/panel/ProcessesPanelPresenter.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/processes/panel/ProcessesPanelPresenter.java index 16994c40db..4c6ca4228f 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/processes/panel/ProcessesPanelPresenter.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/processes/panel/ProcessesPanelPresenter.java @@ -26,7 +26,7 @@ import org.eclipse.che.api.core.model.workspace.config.Environment; import org.eclipse.che.api.core.model.workspace.config.MachineConfig; import org.eclipse.che.api.core.model.workspace.runtime.Machine; import org.eclipse.che.api.core.model.workspace.runtime.Server; -import org.eclipse.che.api.machine.shared.dto.MachineDto; +import org.eclipse.che.api.workspace.shared.dto.MachineDto; import org.eclipse.che.api.machine.shared.dto.execagent.GetProcessLogsResponseDto; import org.eclipse.che.api.machine.shared.dto.execagent.GetProcessesResponseDto; import org.eclipse.che.api.promises.client.Operation; diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/workspace/events/EnvironmentStatusEventHandler.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/workspace/events/EnvironmentStatusEventHandler.java index 9659ecdbe6..3bb61a718d 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/workspace/events/EnvironmentStatusEventHandler.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/workspace/events/EnvironmentStatusEventHandler.java @@ -15,7 +15,7 @@ import com.google.inject.Provider; import com.google.inject.Singleton; import org.eclipse.che.api.core.jsonrpc.commons.RequestHandlerConfigurator; -import org.eclipse.che.api.machine.shared.dto.event.MachineStatusEvent; +import org.eclipse.che.api.workspace.shared.dto.event.MachineStatusEvent; import org.eclipse.che.ide.machine.EnvironmentStatusHandler; import org.eclipse.che.ide.util.loging.Log; diff --git a/ide/che-core-ide-app/src/test/java/org/eclipse/che/ide/command/palette/CommandsPalettePresenterTest.java b/ide/che-core-ide-app/src/test/java/org/eclipse/che/ide/command/palette/CommandsPalettePresenterTest.java index 3fe5870e09..f71d2023bf 100644 --- a/ide/che-core-ide-app/src/test/java/org/eclipse/che/ide/command/palette/CommandsPalettePresenterTest.java +++ b/ide/che-core-ide-app/src/test/java/org/eclipse/che/ide/command/palette/CommandsPalettePresenterTest.java @@ -12,7 +12,7 @@ package org.eclipse.che.ide.command.palette; import org.eclipse.che.api.core.model.machine.Machine; import org.eclipse.che.api.core.model.workspace.Workspace; -import org.eclipse.che.api.machine.shared.dto.MachineDto; +import org.eclipse.che.api.workspace.shared.dto.MachineDto; import org.eclipse.che.api.promises.client.Operation; import org.eclipse.che.api.promises.client.Promise; import org.eclipse.che.api.workspace.shared.dto.WorkspaceRuntimeDto; diff --git a/ide/che-core-ide-app/src/test/java/org/eclipse/che/ide/command/toolbar/previews/PreviewUrlTest.java b/ide/che-core-ide-app/src/test/java/org/eclipse/che/ide/command/toolbar/previews/PreviewUrlTest.java index e9a8360cc9..62db237fae 100644 --- a/ide/che-core-ide-app/src/test/java/org/eclipse/che/ide/command/toolbar/previews/PreviewUrlTest.java +++ b/ide/che-core-ide-app/src/test/java/org/eclipse/che/ide/command/toolbar/previews/PreviewUrlTest.java @@ -11,7 +11,7 @@ package org.eclipse.che.ide.command.toolbar.previews; import org.eclipse.che.api.machine.shared.dto.MachineRuntimeInfoDto; -import org.eclipse.che.api.machine.shared.dto.ServerDto; +import org.eclipse.che.api.workspace.shared.dto.ServerDto; import org.eclipse.che.ide.api.app.AppContext; import org.eclipse.che.ide.api.machine.DevMachine; import org.junit.Before; diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DefaultInfrastructureProvisioner.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DefaultInfrastructureProvisioner.java index 0a59178d20..4b4e846f93 100644 --- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DefaultInfrastructureProvisioner.java +++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DefaultInfrastructureProvisioner.java @@ -12,8 +12,8 @@ package org.eclipse.che.workspace.infrastructure.docker; import org.eclipse.che.api.agent.server.exception.AgentException; import org.eclipse.che.api.core.model.workspace.config.Environment; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import org.eclipse.che.api.workspace.server.spi.InfrastructureException; -import org.eclipse.che.api.workspace.server.spi.RuntimeIdentity; import org.eclipse.che.workspace.infrastructure.docker.model.DockerEnvironment; import javax.inject.Inject; diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerRuntimeContext.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerRuntimeContext.java index 8b006b8104..46166e05c7 100644 --- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerRuntimeContext.java +++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerRuntimeContext.java @@ -17,13 +17,13 @@ import org.eclipse.che.api.agent.server.impl.AgentSorter; import org.eclipse.che.api.core.ValidationException; import org.eclipse.che.api.core.model.machine.MachineSource; import org.eclipse.che.api.core.model.workspace.config.Environment; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import org.eclipse.che.api.workspace.server.URLRewriter; import org.eclipse.che.api.workspace.server.spi.InfrastructureException; import org.eclipse.che.api.workspace.server.spi.InternalInfrastructureException; import org.eclipse.che.api.workspace.server.spi.InternalMachineConfig; import org.eclipse.che.api.workspace.server.spi.InternalRuntime; import org.eclipse.che.api.workspace.server.spi.RuntimeContext; -import org.eclipse.che.api.workspace.server.spi.RuntimeIdentity; import org.eclipse.che.api.workspace.shared.Utils; import org.eclipse.che.plugin.docker.client.MessageProcessor; import org.eclipse.che.workspace.infrastructure.docker.exception.SourceNotFoundException; @@ -83,7 +83,7 @@ public class DockerRuntimeContext extends RuntimeContext { AgentRegistry agentRegistry, ContextsStorage contextsStorage) throws ValidationException, InfrastructureException { - super(environment, identity, infrastructure, agentSorter, agentRegistry, null); + super(environment, identity, infrastructure, agentSorter, agentRegistry); this.devMachineName = Utils.getDevMachineName(environment); this.dockerEnvironment = dockerEnvironment; this.dockerNetworkLifecycle = dockerNetworkLifecycle; diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerRuntimeInfrastructure.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerRuntimeInfrastructure.java index b168826c96..cff33ffb5e 100644 --- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerRuntimeInfrastructure.java +++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerRuntimeInfrastructure.java @@ -14,9 +14,10 @@ import com.google.inject.Inject; import org.eclipse.che.api.core.ValidationException; import org.eclipse.che.api.core.model.workspace.config.Environment; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; +import org.eclipse.che.api.core.notification.EventService; import org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl; import org.eclipse.che.api.workspace.server.spi.InfrastructureException; -import org.eclipse.che.api.workspace.server.spi.RuntimeIdentity; import org.eclipse.che.api.workspace.server.spi.RuntimeInfrastructure; import org.eclipse.che.workspace.infrastructure.docker.environment.DockerConfigSourceSpecificEnvironmentParser; import org.eclipse.che.workspace.infrastructure.docker.environment.EnvironmentNormalizer; @@ -49,8 +50,9 @@ public class DockerRuntimeInfrastructure extends RuntimeInfrastructure { InfrastructureProvisioner infrastructureProvisioner, EnvironmentNormalizer environmentNormalizer, Map environmentParsers, - RuntimeFactory runtimeFactory) { - super("docker", environmentParsers.keySet()); + RuntimeFactory runtimeFactory, + EventService eventService) { + super("docker", environmentParsers.keySet(), eventService); this.dockerEnvironmentValidator = dockerEnvironmentValidator; this.dockerEnvironmentParser = dockerEnvironmentParser; this.startStrategy = startStrategy; diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/InfrastructureProvisioner.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/InfrastructureProvisioner.java index d1a82b7430..955cd71a5a 100644 --- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/InfrastructureProvisioner.java +++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/InfrastructureProvisioner.java @@ -11,8 +11,8 @@ package org.eclipse.che.workspace.infrastructure.docker; import org.eclipse.che.api.core.model.workspace.config.Environment; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import org.eclipse.che.api.workspace.server.spi.InfrastructureException; -import org.eclipse.che.api.workspace.server.spi.RuntimeIdentity; import org.eclipse.che.workspace.infrastructure.docker.model.DockerEnvironment; /** diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/MachineStarter.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/MachineStarter.java index db8a3d3c43..8fae2bfde8 100644 --- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/MachineStarter.java +++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/MachineStarter.java @@ -16,12 +16,12 @@ import com.google.common.base.Strings; import com.google.common.collect.ImmutableSet; import org.eclipse.che.api.core.model.workspace.config.ServerConfig; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import org.eclipse.che.api.core.util.FileCleaner; import org.eclipse.che.api.core.util.SystemInfo; import org.eclipse.che.api.workspace.server.model.impl.MachineSourceImpl; import org.eclipse.che.api.workspace.server.spi.InfrastructureException; import org.eclipse.che.api.workspace.server.spi.InternalInfrastructureException; -import org.eclipse.che.api.workspace.server.spi.RuntimeIdentity; import org.eclipse.che.commons.annotation.Nullable; import org.eclipse.che.commons.env.EnvironmentContext; import org.eclipse.che.commons.lang.os.WindowsPathEscaper; @@ -41,12 +41,10 @@ import org.eclipse.che.plugin.docker.client.json.network.ConnectContainer; import org.eclipse.che.plugin.docker.client.json.network.EndpointConfig; import org.eclipse.che.plugin.docker.client.params.BuildImageParams; import org.eclipse.che.plugin.docker.client.params.CreateContainerParams; -import org.eclipse.che.plugin.docker.client.params.GetContainerLogsParams; import org.eclipse.che.plugin.docker.client.params.ListImagesParams; import org.eclipse.che.plugin.docker.client.params.PullParams; import org.eclipse.che.plugin.docker.client.params.RemoveContainerParams; import org.eclipse.che.plugin.docker.client.params.RemoveImageParams; -import org.eclipse.che.plugin.docker.client.params.network.RemoveNetworkParams; import org.eclipse.che.plugin.docker.client.params.StartContainerParams; import org.eclipse.che.plugin.docker.client.params.TagParams; import org.eclipse.che.plugin.docker.client.params.network.ConnectContainerToNetworkParams; diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/RuntimeFactory.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/RuntimeFactory.java index 2af5d86941..5cede82a73 100644 --- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/RuntimeFactory.java +++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/RuntimeFactory.java @@ -14,8 +14,8 @@ import com.google.inject.assistedinject.Assisted; import org.eclipse.che.api.core.ValidationException; import org.eclipse.che.api.core.model.workspace.config.Environment; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import org.eclipse.che.api.workspace.server.spi.InfrastructureException; -import org.eclipse.che.api.workspace.server.spi.RuntimeIdentity; import org.eclipse.che.workspace.infrastructure.docker.model.DockerEnvironment; import java.util.List; diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/environment/EnvironmentNormalizer.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/environment/EnvironmentNormalizer.java index d68dac14d8..9d994420df 100644 --- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/environment/EnvironmentNormalizer.java +++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/environment/EnvironmentNormalizer.java @@ -12,13 +12,13 @@ package org.eclipse.che.workspace.infrastructure.docker.environment; import org.eclipse.che.api.core.ServerException; import org.eclipse.che.api.core.model.workspace.config.Environment; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import org.eclipse.che.api.workspace.server.RecipeDownloader; import org.eclipse.che.api.workspace.server.spi.InfrastructureException; -import org.eclipse.che.api.workspace.server.spi.RuntimeIdentity; import org.eclipse.che.commons.lang.NameGenerator; import org.eclipse.che.workspace.infrastructure.docker.ContainerNameGenerator; -import org.eclipse.che.workspace.infrastructure.docker.model.DockerEnvironment; import org.eclipse.che.workspace.infrastructure.docker.model.DockerContainerConfig; +import org.eclipse.che.workspace.infrastructure.docker.model.DockerEnvironment; import javax.inject.Inject; import javax.inject.Named; diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/local/LocalCheInfrastructureProvisioner.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/local/LocalCheInfrastructureProvisioner.java index 86dbcd8067..4ca8beeee6 100644 --- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/local/LocalCheInfrastructureProvisioner.java +++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/local/LocalCheInfrastructureProvisioner.java @@ -13,9 +13,9 @@ package org.eclipse.che.workspace.infrastructure.docker.local; import com.google.common.base.Strings; import org.eclipse.che.api.core.model.workspace.config.Environment; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import org.eclipse.che.api.core.util.SystemInfo; import org.eclipse.che.api.workspace.server.spi.InfrastructureException; -import org.eclipse.che.api.workspace.server.spi.RuntimeIdentity; import org.eclipse.che.commons.annotation.Nullable; import org.eclipse.che.commons.lang.os.WindowsPathEscaper; import org.eclipse.che.inject.CheBootstrap; diff --git a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/CheEnvironmentEngineTest.java b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/CheEnvironmentEngineTest.java index 2b56e3e0dd..e4030f17b2 100644 --- a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/CheEnvironmentEngineTest.java +++ b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/CheEnvironmentEngineTest.java @@ -651,7 +651,7 @@ public class CheEnvironmentEngineTest { // // then // for (Instance instance : instances) { // verify(eventService).publish(newDto(MachineStatusEvent.class) -// .withEventType(MachineStatusEvent.EventType.CREATING) +// .withEventType(MachineStatusEvent.EventType.STARTING) // .withDev(instance.getConfig().isDev()) // .withMachineName(instance.getConfig().getName()) // .withMachineId(instance.getId()) @@ -841,7 +841,7 @@ public class CheEnvironmentEngineTest { // // // then // verify(eventService).publish(newDto(MachineStatusEvent.class) -// .withEventType(MachineStatusEvent.EventType.CREATING) +// .withEventType(MachineStatusEvent.EventType.STARTING) // .withDev(config.isDev()) // .withMachineName(config.getName()) // .withMachineId("newMachineId") @@ -918,7 +918,7 @@ public class CheEnvironmentEngineTest { // // // then // verify(eventService).publish(newDto(MachineStatusEvent.class) -// .withEventType(MachineStatusEvent.EventType.CREATING) +// .withEventType(MachineStatusEvent.EventType.STARTING) // .withDev(instance.getConfig().isDev()) // .withMachineName(instance.getConfig().getName()) // .withMachineId(instance.getId()) diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filebuffers/src/main/java/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filebuffers/src/main/java/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java index 9af0c4753c..79c250e6e7 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filebuffers/src/main/java/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filebuffers/src/main/java/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java @@ -151,7 +151,7 @@ public class ExtensionsRegistry { // if (value != null) { // IContentType contentType= fContentTypeManager.getContentType(value); // if (contentType == null) { -// log(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, NLSUtility +// log(new Status(IStatus.FAILED, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, NLSUtility // .format(FileBuffersMessages.ExtensionsRegistry_error_contentTypeDoesNotExist, value), null)); // return; // } @@ -188,7 +188,7 @@ public class ExtensionsRegistry { // // IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(FileBuffersPlugin.PLUGIN_ID, extensionPointName); // if (extensionPoint == null) { -// log(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, 0, NLSUtility +// log(new Status(IStatus.FAILED, FileBuffersPlugin.PLUGIN_ID, 0, NLSUtility // .format(FileBuffersMessages.ExtensionsRegistry_error_extensionPointNotFound, extensionPointName), null)); // return; // } diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filebuffers/src/main/java/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filebuffers/src/main/java/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java index 1e18e4dd60..274c25a2f3 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filebuffers/src/main/java/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filebuffers/src/main/java/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java @@ -128,7 +128,7 @@ public class TextFileBufferManager implements ITextFileBufferManager { // // fileBuffer= createFileBuffer(fileStore); // if (fileBuffer == null) -// throw new CoreException(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IFileBufferStatusCodes.CREATION_FAILED, FileBuffersMessages.FileBufferManager_error_canNotCreateFilebuffer, null)); +// throw new CoreException(new Status(IStatus.FAILED, FileBuffersPlugin.PLUGIN_ID, IFileBufferStatusCodes.CREATION_FAILED, FileBuffersMessages.FileBufferManager_error_canNotCreateFilebuffer, null)); // // fileBuffer.create(fileStore, monitor); // @@ -487,7 +487,7 @@ public class TextFileBufferManager implements ITextFileBufferManager { // } // } // public void handleException(Throwable t) { -// IStatus status= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.TextFileBufferManager_error_documentSetupFailed, t); +// IStatus status= new Status(IStatus.FAILED, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.TextFileBufferManager_error_documentSetupFailed, t); // FileBuffersPlugin.getDefault().log(status); // } // }; @@ -517,7 +517,7 @@ public class TextFileBufferManager implements ITextFileBufferManager { // runnableResult[0]= factory.createDocument(); // } // public void handleException(Throwable t) { -// IStatus status= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.TextFileBufferManager_error_documentFactoryFailed, t); +// IStatus status= new Status(IStatus.FAILED, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.TextFileBufferManager_error_documentFactoryFailed, t); // FileBuffersPlugin.getDefault().log(status); // } // }; diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-resources/src/main/java/org/eclipse/core/resources/IWorkspace.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-resources/src/main/java/org/eclipse/core/resources/IWorkspace.java index c39f3d99a6..170ca8b601 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-resources/src/main/java/org/eclipse/core/resources/IWorkspace.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-resources/src/main/java/org/eclipse/core/resources/IWorkspace.java @@ -1465,7 +1465,7 @@ public interface IWorkspace extends IAdaptable { * be filtered out by its parent resource filters once it exists in the workspace. *

*

- * This method will return a status with severity IStatus.ERROR + * This method will return a status with severity IStatus.FAILED * if the resource will be filtered out - removed - out of the workspace by * its parent resource filters. *

@@ -1476,7 +1476,7 @@ public interface IWorkspace extends IAdaptable { * @param resource the resource to validate the location for * @return a status object with code IStatus.OK if the given * resource is not filtered by its parent resource filters, otherwise a status - * object with severity IStatus.ERROR indicating that it will + * object with severity IStatus.FAILED indicating that it will * @see IStatus#OK * @since 3.6 */ @@ -1507,7 +1507,7 @@ public interface IWorkspace extends IAdaptable { * *

*

- * This method will return a status with severity IStatus.ERROR + * This method will return a status with severity IStatus.FAILED * if the location does not obey the above rules. Also, this method will * return a status with severity IStatus.WARNING if the * location overlaps the location of any existing resource in the workspace. @@ -1521,7 +1521,7 @@ public interface IWorkspace extends IAdaptable { * @return a status object with code IStatus.OK if the given * location is valid as the linked resource location, otherwise a status * object with severity IStatus.WARNING or - * IStatus.ERROR indicating what is wrong with the location + * IStatus.FAILED indicating what is wrong with the location * @see IStatus#OK * @see ResourcesPlugin#PREF_DISABLE_LINKING * @since 2.1 @@ -1551,7 +1551,7 @@ public interface IWorkspace extends IAdaptable { * *

*

- * This method will return a status with severity IStatus.ERROR + * This method will return a status with severity IStatus.FAILED * if the location does not obey the above rules. Also, this method will * return a status with severity IStatus.WARNING if the * location overlaps the location of any existing resource in the workspace. @@ -1565,7 +1565,7 @@ public interface IWorkspace extends IAdaptable { * @return a status object with code IStatus.OK if the given * location is valid as the linked resource location, otherwise a status * object with severity IStatus.WARNING or - * IStatus.ERROR indicating what is wrong with the location + * IStatus.FAILED indicating what is wrong with the location * @see IStatus#OK * @see ResourcesPlugin#PREF_DISABLE_LINKING * @since 3.2 diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-resources/src/main/java/org/eclipse/core/resources/team/TeamHook.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-resources/src/main/java/org/eclipse/core/resources/team/TeamHook.java index 20bb06e819..a304a989dd 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-resources/src/main/java/org/eclipse/core/resources/team/TeamHook.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-resources/src/main/java/org/eclipse/core/resources/team/TeamHook.java @@ -131,7 +131,7 @@ public abstract class TeamHook extends InternalTeamHook { * @param location a file system path where the file should be linked * @return a status object with code IStatus.OK * if linking is allowed, otherwise a status object with severity - * IStatus.ERROR indicating why the creation is not allowed. + * IStatus.FAILED indicating why the creation is not allowed. * @see org.eclipse.core.resources.IResource#ALLOW_MISSING_LOCAL */ public IStatus validateCreateLink(IFile file, int updateFlags, IPath location) { @@ -161,7 +161,7 @@ public abstract class TeamHook extends InternalTeamHook { * @param location a file system URI where the file should be linked * @return a status object with code IStatus.OK * if linking is allowed, otherwise a status object with severity - * IStatus.ERROR indicating why the creation is not allowed. + * IStatus.FAILED indicating why the creation is not allowed. * @see org.eclipse.core.resources.IResource#ALLOW_MISSING_LOCAL * @since 3.2 */ @@ -195,7 +195,7 @@ public abstract class TeamHook extends InternalTeamHook { * @param location a file system path where the folder should be linked * @return a status object with code IStatus.OK * if linking is allowed, otherwise a status object with severity - * IStatus.ERROR indicating why the creation is not allowed. + * IStatus.FAILED indicating why the creation is not allowed. * @see org.eclipse.core.resources.IResource#ALLOW_MISSING_LOCAL */ public IStatus validateCreateLink(IFolder folder, int updateFlags, IPath location) { @@ -225,7 +225,7 @@ public abstract class TeamHook extends InternalTeamHook { * @param location a file system path where the folder should be linked * @return a status object with code IStatus.OK * if linking is allowed, otherwise a status object with severity - * IStatus.ERROR indicating why the creation is not allowed. + * IStatus.FAILED indicating why the creation is not allowed. * @see org.eclipse.core.resources.IResource#ALLOW_MISSING_LOCAL * @since 3.2 */ diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/che/jdt/core/JavaConventions.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/che/jdt/core/JavaConventions.java index 5f3d6a5d9d..355c374c25 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/che/jdt/core/JavaConventions.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/che/jdt/core/JavaConventions.java @@ -755,7 +755,7 @@ public final class JavaConventions { } } else { // compliance is not valid - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.invalidCompilerOption", compliance==null?"":compliance, JavaCore.COMPILER_COMPLIANCE))); //$NON-NLS-1$ //$NON-NLS-2$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.invalidCompilerOption", compliance==null?"":compliance, JavaCore.COMPILER_COMPLIANCE))); //$NON-NLS-1$ //$NON-NLS-2$ } // Verify source value and set default for target if necessary @@ -775,7 +775,7 @@ public final class JavaConventions { sourceLevel = ClassFileConstants.JDK1_3; } else { // source is not valid - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.invalidCompilerOption", source==null?"":source, JavaCore.COMPILER_SOURCE))); //$NON-NLS-1$ //$NON-NLS-2$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.invalidCompilerOption", source==null?"":source, JavaCore.COMPILER_SOURCE))); //$NON-NLS-1$ //$NON-NLS-2$ } // Verify target value @@ -783,7 +783,7 @@ public final class JavaConventions { targetLevel = CompilerOptions.versionToJdkLevel(target); if (targetLevel == 0) { // target is not valid - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.invalidCompilerOption", target==null?"":target, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM))); //$NON-NLS-1$ //$NON-NLS-2$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.invalidCompilerOption", target==null?"":target, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM))); //$NON-NLS-1$ //$NON-NLS-2$ } } @@ -791,24 +791,24 @@ public final class JavaConventions { if (complianceLevel != 0 && sourceLevel != 0 && targetLevel != 0) { // target must be 1.5 if source is 1.5 if (sourceLevel >= ClassFileConstants.JDK1_5 && targetLevel < ClassFileConstants.JDK1_5) { - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleTargetForSource", target, JavaCore.VERSION_1_5))); //$NON-NLS-1$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.incompatibleTargetForSource", target, JavaCore.VERSION_1_5))); //$NON-NLS-1$ } else // target must be 1.4 if source is 1.4 if (sourceLevel >= ClassFileConstants.JDK1_4 && targetLevel < ClassFileConstants.JDK1_4) { - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleTargetForSource", target, JavaCore.VERSION_1_4))); //$NON-NLS-1$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.incompatibleTargetForSource", target, JavaCore.VERSION_1_4))); //$NON-NLS-1$ } // target cannot be greater than compliance level if (complianceLevel < targetLevel){ - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleComplianceForTarget", compliance, JavaCore.VERSION_1_4))); //$NON-NLS-1$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.incompatibleComplianceForTarget", compliance, JavaCore.VERSION_1_4))); //$NON-NLS-1$ } // compliance must be 1.5 if source is 1.5 if (source.equals(JavaCore.VERSION_1_5) && complianceLevel < ClassFileConstants.JDK1_5) { - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleComplianceForSource", compliance, JavaCore.VERSION_1_5))); //$NON-NLS-1$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.incompatibleComplianceForSource", compliance, JavaCore.VERSION_1_5))); //$NON-NLS-1$ } else // compliance must be 1.4 if source is 1.4 if (source.equals(JavaCore.VERSION_1_4) && complianceLevel < ClassFileConstants.JDK1_4) { - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleComplianceForSource", compliance, JavaCore.VERSION_1_4))); //$NON-NLS-1$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.incompatibleComplianceForSource", compliance, JavaCore.VERSION_1_4))); //$NON-NLS-1$ } } diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/che/jdt/javadoc/JavaDocLocations.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/che/jdt/javadoc/JavaDocLocations.java index 6252d45ef2..474dbf0a2b 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/che/jdt/javadoc/JavaDocLocations.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/che/jdt/javadoc/JavaDocLocations.java @@ -274,7 +274,7 @@ public class JavaDocLocations { } // private static JavaUIException createException(Throwable t, String message) { -// return new JavaUIException(JavaUIStatus.createError(IStatus.ERROR, message, t)); +// return new JavaUIException(JavaUIStatus.createError(IStatus.FAILED, message, t)); // } // private static Map loadOldForCompatibility() { diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/core/JavaConventions.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/core/JavaConventions.java index a4350af428..9424badd0a 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/core/JavaConventions.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/core/JavaConventions.java @@ -754,7 +754,7 @@ public final class JavaConventions { } } else { // compliance is not valid - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.invalidCompilerOption", compliance==null?"":compliance, JavaCore.COMPILER_COMPLIANCE))); //$NON-NLS-1$ //$NON-NLS-2$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.invalidCompilerOption", compliance==null?"":compliance, JavaCore.COMPILER_COMPLIANCE))); //$NON-NLS-1$ //$NON-NLS-2$ } // Verify source value and set default for target if necessary @@ -774,7 +774,7 @@ public final class JavaConventions { sourceLevel = ClassFileConstants.JDK1_3; } else { // source is not valid - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.invalidCompilerOption", source==null?"":source, JavaCore.COMPILER_SOURCE))); //$NON-NLS-1$ //$NON-NLS-2$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.invalidCompilerOption", source==null?"":source, JavaCore.COMPILER_SOURCE))); //$NON-NLS-1$ //$NON-NLS-2$ } // Verify target value @@ -782,7 +782,7 @@ public final class JavaConventions { targetLevel = CompilerOptions.versionToJdkLevel(target); if (targetLevel == 0) { // target is not valid - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.invalidCompilerOption", target==null?"":target, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM))); //$NON-NLS-1$ //$NON-NLS-2$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.invalidCompilerOption", target==null?"":target, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM))); //$NON-NLS-1$ //$NON-NLS-2$ } } @@ -790,24 +790,24 @@ public final class JavaConventions { if (complianceLevel != 0 && sourceLevel != 0 && targetLevel != 0) { // target must be 1.5 if source is 1.5 if (sourceLevel >= ClassFileConstants.JDK1_5 && targetLevel < ClassFileConstants.JDK1_5) { - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleTargetForSource", target, JavaCore.VERSION_1_5))); //$NON-NLS-1$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.incompatibleTargetForSource", target, JavaCore.VERSION_1_5))); //$NON-NLS-1$ } else // target must be 1.4 if source is 1.4 if (sourceLevel >= ClassFileConstants.JDK1_4 && targetLevel < ClassFileConstants.JDK1_4) { - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleTargetForSource", target, JavaCore.VERSION_1_4))); //$NON-NLS-1$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.incompatibleTargetForSource", target, JavaCore.VERSION_1_4))); //$NON-NLS-1$ } // target cannot be greater than compliance level if (complianceLevel < targetLevel){ - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleComplianceForTarget", compliance, JavaCore.VERSION_1_4))); //$NON-NLS-1$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.incompatibleComplianceForTarget", compliance, JavaCore.VERSION_1_4))); //$NON-NLS-1$ } // compliance must be 1.5 if source is 1.5 if (source.equals(JavaCore.VERSION_1_5) && complianceLevel < ClassFileConstants.JDK1_5) { - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleComplianceForSource", compliance, JavaCore.VERSION_1_5))); //$NON-NLS-1$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.incompatibleComplianceForSource", compliance, JavaCore.VERSION_1_5))); //$NON-NLS-1$ } else // compliance must be 1.4 if source is 1.4 if (source.equals(JavaCore.VERSION_1_4) && complianceLevel < ClassFileConstants.JDK1_4) { - errors.add(new JavaModelStatus(IStatus.ERROR, Util.bind("convention.compiler.incompatibleComplianceForSource", compliance, JavaCore.VERSION_1_4))); //$NON-NLS-1$ + errors.add(new JavaModelStatus(IStatus.FAILED, Util.bind("convention.compiler.incompatibleComplianceForSource", compliance, JavaCore.VERSION_1_4))); //$NON-NLS-1$ } } diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/ClasspathEntry.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/ClasspathEntry.java index 16f572c4c4..570590e952 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/ClasspathEntry.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/ClasspathEntry.java @@ -1894,8 +1894,8 @@ tag if no children*/); // && !JavaCore.IGNORE.equals(option)) { // boolean opStartsWithProject = projectName.equals(otherEntry.getPath().segment(0)); // String otherPathMsg = opStartsWithProject ? otherEntry.getPath().removeFirstSegments(1).toString() : otherEntry.getPath().makeRelative().toString(); -// if (JavaCore.ERROR.equals(option)) { -// return new JavaModelStatus(IStatus.ERROR, IJavaModelStatusConstants.OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE, +// if (JavaCore.FAILED.equals(option)) { +// return new JavaModelStatus(IStatus.FAILED, IJavaModelStatusConstants.OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE, // Messages.bind(Messages.classpath_cannotUseDistinctSourceFolderAsOutput, new String[] { // entryPathMsg, otherPathMsg, projectName })); // } @@ -1923,7 +1923,7 @@ tag if no children*/); // } // // // NOTE: The above code that checks for IJavaModelStatusConstants.OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE, can be configured to return -// // a WARNING status and hence should be at the end of this validation method. Any other code that might return a more severe ERROR should be +// // a WARNING status and hence should be at the end of this validation method. Any other code that might return a more severe FAILED should be // // inserted before the mentioned code. // if (cachedStatus != null) return cachedStatus; diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/JavaModelManager.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/JavaModelManager.java index 5cd73572c4..1497d72956 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/JavaModelManager.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/JavaModelManager.java @@ -1548,7 +1548,7 @@ public class JavaModelManager { } // backward compatibility // if (isDeprecatedOption(optionName)) { -// return JavaCore.ERROR; +// return JavaCore.FAILED; // } int optionLevel = getOptionLevel(optionName); if (optionLevel != UNKNOWN_OPTION) { diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/util/Util.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/util/Util.java index 2cdaef014c..594d15d0f2 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/util/Util.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/util/Util.java @@ -2299,7 +2299,7 @@ public class Util { // try { // URI locationURI = file.getLocationURI(); // if (locationURI == null) -// throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Messages +// throw new CoreException(new Status(IStatus.FAILED, JavaCore.PLUGIN_ID, Messages // .bind(Messages.file_notFound, file.getFullPath().toString()))); // length = EFS.getStore(locationURI).fetchInfo().getLength(); // } catch (CoreException e) { diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/corext/refactoring/Checks.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/corext/refactoring/Checks.java index 06bbf4badc..58677395f9 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/corext/refactoring/Checks.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/corext/refactoring/Checks.java @@ -739,7 +739,7 @@ public class Checks { * Checks whether it is possible to modify the given IJavaElement. * The IJavaElement must exist and be non read-only to be modifiable. * Moreover, if it is a IMember it must not be binary. - * The returned RefactoringStatus has ERROR severity if + * The returned RefactoringStatus has FAILED severity if * it is not possible to modify the element. * @param javaElement * @return the status diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/dialogs/StatusInfo.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/dialogs/StatusInfo.java index 30dd3a7090..4cfe40925e 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/dialogs/StatusInfo.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/dialogs/StatusInfo.java @@ -35,8 +35,8 @@ public class StatusInfo implements IStatus { /** * Creates a status . - * @param severity The status severity: ERROR, WARNING, INFO and OK. - * @param message The message of the status. Applies only for ERROR, + * @param severity The status severity: FAILED, WARNING, INFO and OK. + * @param message The message of the status. Applies only for FAILED, * WARNING and INFO. */ public StatusInfo(int severity, String message) { @@ -66,7 +66,7 @@ public class StatusInfo implements IStatus { } /** - * Returns if the status' severity is ERROR. + * Returns if the status' severity is FAILED. */ public boolean isError() { return fSeverity == IStatus.ERROR; @@ -80,7 +80,7 @@ public class StatusInfo implements IStatus { } /** - * Sets the status to ERROR. + * Sets the status to FAILED. * @param errorMessage The error message (can be empty, but not null) */ public void setError(String errorMessage) { diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/ContributedProcessorDescriptor.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/ContributedProcessorDescriptor.java index 60c293416d..eaf2af88d6 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/ContributedProcessorDescriptor.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/ContributedProcessorDescriptor.java @@ -70,7 +70,7 @@ public final class ContributedProcessorDescriptor { // IConfigurationElement[] children= fConfigurationElement.getChildren(ExpressionTagNames.ENABLEMENT); // if (children.length > 1) { // String id= fConfigurationElement.getAttribute(ID); -// return new StatusInfo(IStatus.ERROR, "Only one < enablement > element allowed. Disabling " + id); //$NON-NLS-1$ +// return new StatusInfo(IStatus.FAILED, "Only one < enablement > element allowed. Disabling " + id); //$NON-NLS-1$ // } return new StatusInfo(IStatus.OK, "Syntactically correct quick assist/fix processor"); //$NON-NLS-1$ } @@ -118,7 +118,7 @@ public final class ContributedProcessorDescriptor { // } else { // String message= "Invalid extension to " + fConfigurationElement.getName() //$NON-NLS-1$ // + ". Must extends '" + expectedType.getName() + "'." + fConfigurationElement.getContributor().getName(); //$NON-NLS-1$ //$NON-NLS-2$ -// JavaPlugin.log(new Status(IStatus.ERROR, JavaPlugin.ID_PLUGIN, message)); +// JavaPlugin.log(new Status(IStatus.FAILED, JavaPlugin.ID_PLUGIN, message)); // fStatus= Boolean.FALSE; // return null; // } diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/GetterSetterCorrectionSubProcessor.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/GetterSetterCorrectionSubProcessor.java index bf69eb8c95..953a00af76 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/GetterSetterCorrectionSubProcessor.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/GetterSetterCorrectionSubProcessor.java @@ -145,7 +145,7 @@ public class GetterSetterCorrectionSubProcessor { // if (fNoDialog) { // IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); // final RefactoringExecutionHelper helper = -// new RefactoringExecutionHelper(refactoring, RefactoringStatus.ERROR, RefactoringSaveHelper.SAVE_REFACTORING, +// new RefactoringExecutionHelper(refactoring, RefactoringStatus.FAILED, RefactoringSaveHelper.SAVE_REFACTORING, // JavaPlugin.getActiveWorkbenchShell(), window); // if (Display.getCurrent() != null) { // try { diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java index 19395dfda0..d33058a448 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java @@ -702,7 +702,7 @@ public class UnresolvedElementsSubProcessor { // file.create(new BufferedInputStream(new FileInputStream(bundleFile)), false, pm); // return new DeleteResourceChange(file.getFullPath(), false); // } catch (FileNotFoundException e) { -// throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), e.getMessage())); +// throw new CoreException(new Status(IStatus.FAILED, JavaPlugin.getPluginId(), e.getMessage())); // } // } // @Override diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/proposals/FixCorrectionProposal.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/proposals/FixCorrectionProposal.java index b2d9e4964d..39a8391e5c 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/proposals/FixCorrectionProposal.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/proposals/FixCorrectionProposal.java @@ -63,8 +63,8 @@ public class FixCorrectionProposal extends LinkedCorrectionProposal implements I // ImageImageDescriptor image = new ImageImageDescriptor(super.getImage()); // // int flag = JavaElementImageDescriptor.WARNING; -// if (status.getSeverity() == IStatus.ERROR) { -// flag = JavaElementImageDescriptor.ERROR; +// if (status.getSeverity() == IStatus.FAILED) { +// flag = JavaElementImageDescriptor.FAILED; // } // // ImageDescriptor composite = @@ -200,7 +200,7 @@ public class FixCorrectionProposal extends LinkedCorrectionProposal implements I // if (cause instanceof CoreException) { // throw (CoreException)cause; // } else { -// throw new CoreException(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, cause.getLocalizedMessage(), cause)); +// throw new CoreException(new Status(IStatus.FAILED, JavaUI.ID_PLUGIN, cause.getLocalizedMessage(), cause)); // } // } // } diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/proposals/LinkedCorrectionProposal.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/proposals/LinkedCorrectionProposal.java index ffaa890291..1d55a5d0ed 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/proposals/LinkedCorrectionProposal.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/correction/proposals/LinkedCorrectionProposal.java @@ -218,7 +218,7 @@ public class LinkedCorrectionProposal extends ASTRewriteCorrectionProposal imple // } } // } catch (BadLocationException e) { -// throw new CoreException(JavaUIStatus.createError(IStatus.ERROR, e)); +// throw new CoreException(JavaUIStatus.createError(IStatus.FAILED, e)); // } } diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/template/contentassist/TemplateProposal.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/template/contentassist/TemplateProposal.java index e93f40a933..3fb0a6595e 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/template/contentassist/TemplateProposal.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/text/template/contentassist/TemplateProposal.java @@ -442,7 +442,7 @@ public class TemplateProposal implements IJavaCompletionProposal, ICompletionPro } catch (BadLocationException e) { // handleException( -// JavaPlugin.getActiveWorkbenchShell(), new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK, "", e))); //$NON-NLS-1$ +// JavaPlugin.getActiveWorkbenchShell(), new CoreException(new Status(IStatus.FAILED, JavaPlugin.getPluginId(), IStatus.OK, "", e))); //$NON-NLS-1$ JavaPlugin.log(e); return null; } diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/ui/JavaElementImageDescriptor.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/ui/JavaElementImageDescriptor.java index 3b92181d02..d77ce0818d 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/ui/JavaElementImageDescriptor.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/ui/JavaElementImageDescriptor.java @@ -329,7 +329,7 @@ public class JavaElementImageDescriptor extends ImageDescriptor { // // private void drawBottomLeft() { // Point pos= new Point(0, getSize().y); -// if ((fFlags & ERROR) != 0) { +// if ((fFlags & FAILED) != 0) { // addBottomLeftImage(JavaPluginImages.DESC_OVR_ERROR, pos); // } // if ((fFlags & BUILDPATH_ERROR) != 0) { diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/RefactoringStatus.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/RefactoringStatus.java index 83eeec781c..82b0baacaf 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/RefactoringStatus.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/RefactoringStatus.java @@ -27,7 +27,7 @@ import org.eclipse.core.runtime.IStatus; *

* Additionally a problem severity is managed. Severities are ordered as follows: * OK < INFO < WARNING < - * ERROR < FATAL. The status's problem severity is the maximum + * FAILED < FATAL. The status's problem severity is the maximum * of the severities of all entries. If the status doesn't have any entry the status's * severity is OK. *

@@ -199,7 +199,7 @@ public class RefactoringStatus { * entry matches. * * @param severity the severity to search for. Must be one of FATAL - * , ERROR, WARNING or INFO + * , FAILED, WARNING or INFO * @return the entry that matches the search criteria */ public RefactoringStatusEntry getEntryMatchingSeverity(int severity) { @@ -242,7 +242,7 @@ public class RefactoringStatus { * the first one is returned. Returns null if no entry matches. * * @param severity the severity to search for. Must be one of FATAL - * , ERROR, WARNING or INFO + * , FAILED, WARNING or INFO * @return the message of the entry that matches the search criteria */ public String getMessageMatchingSeverity(int severity) { @@ -330,7 +330,7 @@ public class RefactoringStatus { } /** - * Creates a new RefactoringStatus with one ERROR entry + * Creates a new RefactoringStatus with one FAILED entry * filled with the given message. * * @param msg the message of the error entry @@ -343,7 +343,7 @@ public class RefactoringStatus { } /** - * Creates a RefactoringStatus with one ERROR entry + * Creates a RefactoringStatus with one FAILED entry * fill with the given message and context. * * @param msg the message of the error entry @@ -500,9 +500,9 @@ public class RefactoringStatus { } /** - * Adds an ERROR entry filled with the given message to this status. + * Adds an FAILED entry filled with the given message to this status. * If the current severity is OK, INFO or WARNING - * it will be changed to ERROR. It will remain unchanged + * it will be changed to FAILED. It will remain unchanged * otherwise. * * @param msg the message of the error entry @@ -514,9 +514,9 @@ public class RefactoringStatus { } /** - * Adds an ERROR entry filled with the given message and context to + * Adds an FAILED entry filled with the given message and context to * this status. If the current severity is OK, INFO or - * WARNING it will be changed to ERROR. It will remain + * WARNING it will be changed to FAILED. It will remain * unchanged otherwise. * * @param msg the message of the error entry @@ -628,10 +628,10 @@ public class RefactoringStatus { /** * Returns true if the current severity is - * FATAL or ERROR. + * FATAL or FAILED. * * @return true if the current severity is - * FATAL or ERROR; otherwise false + * FATAL or FAILED; otherwise false * is returned */ public boolean hasError() { @@ -640,10 +640,10 @@ public class RefactoringStatus { /** * Returns true if the current severity is - * FATAL, ERROR or WARNING. + * FATAL, FAILED or WARNING. * * @return true if the current severity is - * FATAL, ERROR or WARNING; + * FATAL, FAILED or WARNING; * otherwise false is returned */ public boolean hasWarning() { @@ -652,11 +652,11 @@ public class RefactoringStatus { /** * Returns true if the current severity is - * FATAL, ERROR, WARNING or + * FATAL, FAILED, WARNING or * INFO. * * @return true if the current severity is - * FATAL, ERROR, WARNING or + * FATAL, FAILED, WARNING or * INFO; otherwise false is returned */ public boolean hasInfo() { diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/RefactoringStatusEntry.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/RefactoringStatusEntry.java index 85c4654434..be6c43981a 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/RefactoringStatusEntry.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/RefactoringStatusEntry.java @@ -201,7 +201,7 @@ public class RefactoringStatusEntry { /** * Returns whether the entry represents an error or not. * - * @return true if (severity ==RefactoringStatus.ERROR). + * @return true if (severity ==RefactoringStatus.FAILED). */ public boolean isError() { return fSeverity == RefactoringStatus.ERROR; diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/ParticipantDescriptor.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/ParticipantDescriptor.java index 36fba109d0..d468067a48 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/ParticipantDescriptor.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/ParticipantDescriptor.java @@ -51,16 +51,16 @@ public class ParticipantDescriptor { public IStatus checkSyntax() { // if (fConfigurationElement.getAttribute(ID) == null) { -// return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, +// return new Status(IStatus.FAILED, RefactoringCorePlugin.getPluginId(), IStatus.FAILED, // RefactoringCoreMessages.ParticipantDescriptor_error_id_missing, null); // } // if (fConfigurationElement.getAttribute(NAME) == null) { -// return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, +// return new Status(IStatus.FAILED, RefactoringCorePlugin.getPluginId(), IStatus.FAILED, // Messages.format( RefactoringCoreMessages.ParticipantDescriptor_error_name_missing, getId()), // null); // } // if (fConfigurationElement.getAttribute(CLASS) == null) { -// return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, +// return new Status(IStatus.FAILED, RefactoringCorePlugin.getPluginId(), IStatus.FAILED, // Messages.format( RefactoringCoreMessages.ParticipantDescriptor_error_class_missing, getId()), // null); // } diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-search/src/main/java/org/eclipse/search/NewSearchUI.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-search/src/main/java/org/eclipse/search/NewSearchUI.java index 926c5e7023..2dc1016ff7 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-search/src/main/java/org/eclipse/search/NewSearchUI.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-search/src/main/java/org/eclipse/search/NewSearchUI.java @@ -67,7 +67,7 @@ public class NewSearchUI { // if (status != null) { // if (!status.isOK()) // SearchPlugin.log(status); -// if (status.getSeverity() == IStatus.ERROR) { +// if (status.getSeverity() == IStatus.FAILED) { // ErrorDialog.openError(SearchPlugin.getActiveWorkbenchShell(), SearchMessages.NewSearchUI_error_title, SearchMessages // .NewSearchUI_error_label, status); // } diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/refactoring/move/wizard/MoveViewImpl.java b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/refactoring/move/wizard/MoveViewImpl.java index 5484e626e1..dea300a6a4 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/refactoring/move/wizard/MoveViewImpl.java +++ b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/refactoring/move/wizard/MoveViewImpl.java @@ -275,7 +275,7 @@ final class MoveViewImpl extends Window implements MoveView { * * @param severity * the severity to search for. Must be one of FATAL - * , ERROR, WARNING or INFO + * , FAILED, WARNING or INFO * @param entries * list of refactoring status * @return the entry that matches the search criteria diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/refactoring/preview/PreviewViewImpl.java b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/refactoring/preview/PreviewViewImpl.java index d6a361ae29..7afc0165ad 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/refactoring/preview/PreviewViewImpl.java +++ b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/refactoring/preview/PreviewViewImpl.java @@ -373,7 +373,7 @@ final class PreviewViewImpl extends Window implements PreviewView { * * @param severity * the severity to search for. Must be one of FATAL - * , ERROR, WARNING or INFO + * , FAILED, WARNING or INFO * @param entries * list of the refactoring status entries * @return the entry that matches the search criteria diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/refactoring/rename/wizard/RenameViewImpl.java b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/refactoring/rename/wizard/RenameViewImpl.java index 5521c1bc09..afaf5686eb 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/refactoring/rename/wizard/RenameViewImpl.java +++ b/plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/refactoring/rename/wizard/RenameViewImpl.java @@ -366,7 +366,7 @@ final class RenameViewImpl extends Window implements RenameView { * * @param severity * the severity to search for. Must be one of FATAL - * , ERROR, WARNING or INFO + * , FAILED, WARNING or INFO * @param entries * list of refactoring status * @return the entry that matches the search criteria diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/che/SourceFromBytecodeGeneratorTest.java b/plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/che/SourceFromBytecodeGeneratorTest.java index 8a75ab68e6..52ec49109d 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/che/SourceFromBytecodeGeneratorTest.java +++ b/plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/che/SourceFromBytecodeGeneratorTest.java @@ -147,7 +147,7 @@ public class SourceFromBytecodeGeneratorTest extends BaseTest { String source = new SourcesFromBytecodeGenerator().generateSource(enumType); assertThat(source).contains("\n" + "public final enum DispatcherType {\n" + - " FORWARD, INCLUDE, REQUEST, ASYNC, ERROR;\n" + + " FORWARD, INCLUDE, REQUEST, ASYNC, FAILED;\n" + "\n" + " public static javax.servlet.DispatcherType[] values() { /* compiled code */ }\n" + "\n" + diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/che/Utils.java b/plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/che/Utils.java index dd9e94af7f..0f7d48d7dc 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/che/Utils.java +++ b/plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/che/Utils.java @@ -164,7 +164,7 @@ public class Utils { } public static void appendProblem(StringBuffer problems, IProblem problem, char[] source, int problemCount) { - problems.append(problemCount + (problem.isError() ? ". ERROR" : ". WARNING")); + problems.append(problemCount + (problem.isError() ? ". FAILED" : ". WARNING")); problems.append(" in " + new String(problem.getOriginatingFileName())); if (source != null) { problems.append(((DefaultProblem)problem).errorReportSource(source)); diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/jdt/quickfix/LocalCorrectionsQuickFixTest.java b/plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/jdt/quickfix/LocalCorrectionsQuickFixTest.java index 6053ba0544..2684a90fed 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/jdt/quickfix/LocalCorrectionsQuickFixTest.java +++ b/plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/jdt/quickfix/LocalCorrectionsQuickFixTest.java @@ -6319,8 +6319,8 @@ public class LocalCorrectionsQuickFixTest extends QuickFixTest { // @Test // public void testHidingVariable1() throws Exception { // Hashtable hashtable= JavaCore.getOptions(); -// hashtable.put(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.ERROR); -// hashtable.put(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.ERROR); +// hashtable.put(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.FAILED); +// hashtable.put(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.FAILED); // JavaCore.setOptions(hashtable); // // IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); @@ -6344,8 +6344,8 @@ public class LocalCorrectionsQuickFixTest extends QuickFixTest { // @Test // public void testHidingVariable2() throws Exception { // Hashtable hashtable= JavaCore.getOptions(); -// hashtable.put(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.ERROR); -// hashtable.put(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.ERROR); +// hashtable.put(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.FAILED); +// hashtable.put(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.FAILED); // JavaCore.setOptions(hashtable); // // IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); @@ -6368,8 +6368,8 @@ public class LocalCorrectionsQuickFixTest extends QuickFixTest { // @Test // public void testHidingVariable3() throws Exception { // Hashtable hashtable= JavaCore.getOptions(); -// hashtable.put(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.ERROR); -// hashtable.put(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.ERROR); +// hashtable.put(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.FAILED); +// hashtable.put(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.FAILED); // JavaCore.setOptions(hashtable); // // IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); @@ -6393,8 +6393,8 @@ public class LocalCorrectionsQuickFixTest extends QuickFixTest { // // public void testHidingVariable4() throws Exception { // Hashtable hashtable= JavaCore.getOptions(); -// hashtable.put(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.ERROR); -// hashtable.put(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.ERROR); +// hashtable.put(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.FAILED); +// hashtable.put(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.FAILED); // JavaCore.setOptions(hashtable); // // IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); @@ -6419,8 +6419,8 @@ public class LocalCorrectionsQuickFixTest extends QuickFixTest { // // public void testHidingVariable5() throws Exception { // Hashtable hashtable= JavaCore.getOptions(); -// hashtable.put(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.ERROR); -// hashtable.put(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.ERROR); +// hashtable.put(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.FAILED); +// hashtable.put(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.FAILED); // JavaCore.setOptions(hashtable); // // IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); @@ -6446,8 +6446,8 @@ public class LocalCorrectionsQuickFixTest extends QuickFixTest { // // public void testHidingVariable6() throws Exception { // Hashtable hashtable= JavaCore.getOptions(); -// hashtable.put(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.ERROR); -// hashtable.put(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.ERROR); +// hashtable.put(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING, JavaCore.FAILED); +// hashtable.put(JavaCore.COMPILER_PB_FIELD_HIDING, JavaCore.FAILED); // JavaCore.setOptions(hashtable); // // IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); diff --git a/plugins/plugin-machine/che-plugin-machine-ext-server/src/main/java/org/eclipse/che/ide/ext/machine/server/ssh/KeysInjector.java b/plugins/plugin-machine/che-plugin-machine-ext-server/src/main/java/org/eclipse/che/ide/ext/machine/server/ssh/KeysInjector.java index d56c5a1f93..87bc4bf03d 100644 --- a/plugins/plugin-machine/che-plugin-machine-ext-server/src/main/java/org/eclipse/che/ide/ext/machine/server/ssh/KeysInjector.java +++ b/plugins/plugin-machine/che-plugin-machine-ext-server/src/main/java/org/eclipse/che/ide/ext/machine/server/ssh/KeysInjector.java @@ -12,7 +12,7 @@ package org.eclipse.che.ide.ext.machine.server.ssh; import org.eclipse.che.api.core.notification.EventService; import org.eclipse.che.api.core.notification.EventSubscriber; -import org.eclipse.che.api.machine.shared.dto.event.MachineStatusEvent; +import org.eclipse.che.api.workspace.shared.dto.event.MachineStatusEvent; import org.eclipse.che.api.ssh.server.SshManager; import org.eclipse.che.plugin.docker.client.DockerConnector; import org.eclipse.che.plugin.docker.client.DockerConnectorProvider; diff --git a/plugins/plugin-machine/che-plugin-machine-ext-server/src/test/java/org/eclipse/che/ide/ext/machine/server/ssh/KeysInjectorTest.java b/plugins/plugin-machine/che-plugin-machine-ext-server/src/test/java/org/eclipse/che/ide/ext/machine/server/ssh/KeysInjectorTest.java index edd3d52b9b..2a5ba9454f 100644 --- a/plugins/plugin-machine/che-plugin-machine-ext-server/src/test/java/org/eclipse/che/ide/ext/machine/server/ssh/KeysInjectorTest.java +++ b/plugins/plugin-machine/che-plugin-machine-ext-server/src/test/java/org/eclipse/che/ide/ext/machine/server/ssh/KeysInjectorTest.java @@ -15,7 +15,7 @@ import org.eclipse.che.api.core.model.user.User; import org.eclipse.che.api.core.notification.EventService; import org.eclipse.che.api.core.notification.EventSubscriber; import org.eclipse.che.api.core.util.LineConsumer; -import org.eclipse.che.api.machine.shared.dto.event.MachineStatusEvent; +import org.eclipse.che.api.workspace.shared.dto.event.MachineStatusEvent; import org.eclipse.che.api.ssh.server.SshManager; import org.eclipse.che.api.ssh.server.model.impl.SshPairImpl; import org.eclipse.che.plugin.docker.client.DockerConnector; diff --git a/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/exec/SshMachineExecAgentLauncher.java b/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/exec/SshMachineExecAgentLauncher.java index 949af58ad8..3b1f687718 100644 --- a/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/exec/SshMachineExecAgentLauncher.java +++ b/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/exec/SshMachineExecAgentLauncher.java @@ -192,7 +192,7 @@ public class SshMachineExecAgentLauncher { process.start(lineConsumer); } catch (ConflictException e) { try { - machine.getLogger().writeLine(format("[ERROR] %s", e.getMessage())); + machine.getLogger().writeLine(format("[FAILED] %s", e.getMessage())); } catch (IOException ignored) { } } finally { diff --git a/wsagent/che-wsagent-core/src/main/java/org/eclipse/che/wsagent/server/WsAgentURLProvider.java b/wsagent/che-wsagent-core/src/main/java/org/eclipse/che/wsagent/server/WsAgentURLProvider.java index 008662babe..6747008954 100644 --- a/wsagent/che-wsagent-core/src/main/java/org/eclipse/che/wsagent/server/WsAgentURLProvider.java +++ b/wsagent/che-wsagent-core/src/main/java/org/eclipse/che/wsagent/server/WsAgentURLProvider.java @@ -12,8 +12,8 @@ package org.eclipse.che.wsagent.server; import org.eclipse.che.api.core.ApiException; import org.eclipse.che.api.core.rest.HttpJsonRequestFactory; -import org.eclipse.che.api.machine.shared.dto.MachineDto; -import org.eclipse.che.api.machine.shared.dto.ServerDto; +import org.eclipse.che.api.workspace.shared.dto.MachineDto; +import org.eclipse.che.api.workspace.shared.dto.ServerDto; import org.eclipse.che.api.workspace.shared.dto.WorkspaceDto; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/MachineLimitsDto.java b/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/MachineLimitsDto.java deleted file mode 100644 index 8e4cf70aaf..0000000000 --- a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/MachineLimitsDto.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012-2017 Codenvy, S.A. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Codenvy, S.A. - initial API and implementation - *******************************************************************************/ -package org.eclipse.che.api.machine.shared.dto; - -import org.eclipse.che.api.core.model.machine.MachineLimits; -import org.eclipse.che.dto.shared.DTO; - -/** - * @author Alexander Garagatyi - */ -@DTO -public interface MachineLimitsDto extends MachineLimits { - MachineLimitsDto withRam(int memorySizeMB); -} diff --git a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/MachineSourceDto.java b/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/MachineSourceDto.java deleted file mode 100644 index af59c32441..0000000000 --- a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/MachineSourceDto.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012-2017 Codenvy, S.A. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Codenvy, S.A. - initial API and implementation - *******************************************************************************/ -package org.eclipse.che.api.machine.shared.dto; - -import org.eclipse.che.api.core.factory.FactoryParameter; -import org.eclipse.che.api.core.model.machine.MachineSource; -import org.eclipse.che.dto.shared.DTO; - -import static org.eclipse.che.api.core.factory.FactoryParameter.Obligation.MANDATORY; -import static org.eclipse.che.api.core.factory.FactoryParameter.Obligation.OPTIONAL; - -/** - * @author Alexander Garagatyi - */ -@DTO -public interface MachineSourceDto extends MachineSource { - @Override - @FactoryParameter(obligation = MANDATORY) - String getType(); - - void setType(String type); - - MachineSourceDto withType(String type); - - @Override - @FactoryParameter(obligation = OPTIONAL) - String getLocation(); - - void setLocation(String location); - - MachineSourceDto withLocation(String location); - - /** - * @return content of the machine source. No need to use an external link. - */ - @Override - @FactoryParameter(obligation = OPTIONAL) - String getContent(); - - /** - * Defines the new content to use for this machine source. - * Alternate way is to provide a location - * @param content the content instead of an external link like with location - */ - void setContent(String content); - - /** - * Defines the new content to use for this machine source. - * Alternate way is to provide a location - * @param content the content instead of an external link like with location - * @return the current intance of the object - */ - MachineSourceDto withContent(String content); - -} diff --git a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/NewSnapshotDescriptor.java b/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/NewSnapshotDescriptor.java deleted file mode 100644 index 3546a1d481..0000000000 --- a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/NewSnapshotDescriptor.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012-2017 Codenvy, S.A. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Codenvy, S.A. - initial API and implementation - *******************************************************************************/ -package org.eclipse.che.api.machine.shared.dto; - -import org.eclipse.che.dto.shared.DTO; - -/** - * Describes snapshot creation information - * - * @author Alexander Garagatyi - */ -@DTO -public interface NewSnapshotDescriptor { - /** - * Description of machine saved in snapshot - */ - String getDescription(); - - void setDescription(String description); - - NewSnapshotDescriptor withDescription(String description); -} diff --git a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/SnapshotDto.java b/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/SnapshotDto.java deleted file mode 100644 index 1bf92eca2b..0000000000 --- a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/SnapshotDto.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012-2017 Codenvy, S.A. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Codenvy, S.A. - initial API and implementation - *******************************************************************************/ -package org.eclipse.che.api.machine.shared.dto; - -import org.eclipse.che.api.core.rest.shared.dto.Hyperlinks; -import org.eclipse.che.api.core.rest.shared.dto.Link; -import org.eclipse.che.api.core.model.machine.Snapshot; -import org.eclipse.che.dto.shared.DTO; - -import java.util.List; - -/** - * @author Alexander Garagatyi - */ -@DTO -public interface SnapshotDto extends Snapshot, Hyperlinks { - void setId(String id); - - SnapshotDto withId(String id); - - void setType(String type); - - SnapshotDto withType(String type); - - void setDescription(String description); - - SnapshotDto withDescription(String description); - - void setCreationDate(long creationDate); - - SnapshotDto withCreationDate(long creationDate); - - void setWorkspaceId(String workspaceId); - - SnapshotDto withWorkspaceId(String workspaceId); - - void setDev(boolean isDev); - - SnapshotDto withDev(boolean isDev); - - SnapshotDto withMachineName(String name); - - void setMachineName(String name); - - SnapshotDto withEnvName(String envName); - - void setEnvName(String envName); - - @Override - SnapshotDto withLinks(List links); -} diff --git a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/MachineDto.java b/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/MachineDto.java similarity index 95% rename from wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/MachineDto.java rename to wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/MachineDto.java index 95c75ab842..1251dce398 100644 --- a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/MachineDto.java +++ b/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/MachineDto.java @@ -8,7 +8,7 @@ * Contributors: * Codenvy, S.A. - initial API and implementation *******************************************************************************/ -package org.eclipse.che.api.machine.shared.dto; +package org.eclipse.che.api.workspace.shared.dto; import org.eclipse.che.api.core.model.workspace.runtime.Machine; import org.eclipse.che.dto.shared.DTO; diff --git a/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/RuntimeDto.java b/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/RuntimeDto.java index 929e0f99ad..408ed4f21d 100644 --- a/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/RuntimeDto.java +++ b/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/RuntimeDto.java @@ -13,7 +13,6 @@ package org.eclipse.che.api.workspace.shared.dto; import org.eclipse.che.api.core.model.workspace.Runtime; import org.eclipse.che.api.core.rest.shared.dto.Hyperlinks; import org.eclipse.che.api.core.rest.shared.dto.Link; -import org.eclipse.che.api.machine.shared.dto.MachineDto; import org.eclipse.che.dto.shared.DTO; import java.util.List; diff --git a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/ServerDto.java b/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/ServerDto.java similarity index 95% rename from wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/ServerDto.java rename to wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/ServerDto.java index caf470666b..2889776187 100644 --- a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/ServerDto.java +++ b/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/ServerDto.java @@ -8,7 +8,7 @@ * Contributors: * Codenvy, S.A. - initial API and implementation *******************************************************************************/ -package org.eclipse.che.api.machine.shared.dto; +package org.eclipse.che.api.workspace.shared.dto; import org.eclipse.che.api.core.model.workspace.runtime.Server; import org.eclipse.che.api.core.model.workspace.runtime.ServerStatus; diff --git a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/event/MachineStatusEvent.java b/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/event/MachineStatusEvent.java similarity index 67% rename from wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/event/MachineStatusEvent.java rename to wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/event/MachineStatusEvent.java index 908a198eb7..6064566c07 100644 --- a/wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/event/MachineStatusEvent.java +++ b/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/event/MachineStatusEvent.java @@ -8,9 +8,9 @@ * Contributors: * Codenvy, S.A. - initial API and implementation *******************************************************************************/ -package org.eclipse.che.api.machine.shared.dto.event; +package org.eclipse.che.api.workspace.shared.dto.event; -import org.eclipse.che.api.core.notification.EventOrigin; +import org.eclipse.che.api.workspace.shared.dto.RuntimeIdentityDto; import org.eclipse.che.dto.shared.DTO; /** @@ -19,22 +19,16 @@ import org.eclipse.che.dto.shared.DTO; * @author Eugene Voevodin * @author Alexander Garagatyi */ -@EventOrigin("machine") +//@EventOrigin("machine") @DTO public interface MachineStatusEvent { enum EventType { - CREATING, + STARTING, RUNNING, - DESTROYING, - DESTROYED, - ERROR + STOPPED, + FAILED } - boolean isDev(); - - MachineStatusEvent withDev(boolean isDev); - - void setDev(boolean isDev); EventType getEventType(); @@ -42,23 +36,22 @@ public interface MachineStatusEvent { MachineStatusEvent withEventType(EventType eventType); - String getMachineId(); - - void setMachineId(String machineId); - - MachineStatusEvent withMachineId(String machineId); - String getError(); void setError(String error); MachineStatusEvent withError(String error); - String getWorkspaceId(); - - MachineStatusEvent withWorkspaceId(String workspaceId); String getMachineName(); MachineStatusEvent withMachineName(String machineName); + + /** + * @return runtime identity + */ + RuntimeIdentityDto getIdentity(); + + MachineStatusEvent withIdentity(RuntimeIdentityDto identity); + } diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/DtoConverter.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/DtoConverter.java index 00aff3719c..d4170d0482 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/DtoConverter.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/DtoConverter.java @@ -22,8 +22,8 @@ import org.eclipse.che.api.core.model.workspace.config.SourceStorage; import org.eclipse.che.api.core.model.workspace.runtime.Machine; import org.eclipse.che.api.core.model.workspace.runtime.Server; import org.eclipse.che.api.workspace.shared.dto.CommandDto; -import org.eclipse.che.api.machine.shared.dto.MachineDto; -import org.eclipse.che.api.machine.shared.dto.ServerDto; +import org.eclipse.che.api.workspace.shared.dto.MachineDto; +import org.eclipse.che.api.workspace.shared.dto.ServerDto; import org.eclipse.che.api.workspace.server.model.impl.stack.StackImpl; import org.eclipse.che.api.workspace.shared.dto.EnvironmentDto; import org.eclipse.che.api.workspace.shared.dto.MachineConfigDto; diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/NoopUrlRewriter.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/NoopUrlRewriter.java index f2dfb53ecb..4b8b4149fb 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/NoopUrlRewriter.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/NoopUrlRewriter.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.che.api.workspace.server; -import org.eclipse.che.api.workspace.server.spi.RuntimeIdentity; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import java.net.MalformedURLException; import java.net.URL; diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/URLRewriter.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/URLRewriter.java index 0bd9339d3d..59438950bc 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/URLRewriter.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/URLRewriter.java @@ -12,7 +12,7 @@ package org.eclipse.che.api.workspace.server; import com.google.inject.ImplementedBy; -import org.eclipse.che.api.workspace.server.spi.RuntimeIdentity; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import java.net.MalformedURLException; import java.net.URL; @@ -27,9 +27,9 @@ import java.net.URL; public interface URLRewriter { /** - * Rewrites URL according to Strategy rules. May depend on RuntimeIdentity(workspace, owner,..) and name (some id) + * Rewrites URL according to Strategy rules. May depend on RuntimeIdentityImpl(workspace, owner,..) and name (some id) * of this particular URL - * @param identity RuntimeIdentity (may be null) + * @param identity RuntimeIdentityImpl (may be null) * @param name symbolic name of the server (may be null) * @param url URL to rewrite * @return Result diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceRuntimes.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceRuntimes.java index 75e6878c77..1d3ec13856 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceRuntimes.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceRuntimes.java @@ -20,13 +20,14 @@ import org.eclipse.che.api.core.model.workspace.Runtime; import org.eclipse.che.api.core.model.workspace.Workspace; import org.eclipse.che.api.core.model.workspace.WorkspaceStatus; import org.eclipse.che.api.core.model.workspace.config.Environment; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import org.eclipse.che.api.core.notification.EventService; import org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl; import org.eclipse.che.api.workspace.server.model.impl.RuntimeImpl; import org.eclipse.che.api.workspace.server.spi.InfrastructureException; import org.eclipse.che.api.workspace.server.spi.InternalInfrastructureException; import org.eclipse.che.api.workspace.server.spi.InternalRuntime; -import org.eclipse.che.api.workspace.server.spi.RuntimeIdentity; +import org.eclipse.che.api.workspace.server.spi.RuntimeIdentityImpl; import org.eclipse.che.api.workspace.server.spi.RuntimeInfrastructure; import org.eclipse.che.api.workspace.shared.dto.event.WorkspaceStatusEvent; import org.eclipse.che.api.workspace.shared.dto.event.WorkspaceStatusEvent.EventType; @@ -66,7 +67,7 @@ public class WorkspaceRuntimes { private final ImmutableMap infraByRecipe; private final ConcurrentMap runtimes; - private final EventService eventsService; + private final EventService eventService; private final WorkspaceSharedPool sharedPool; @Inject @@ -74,7 +75,7 @@ public class WorkspaceRuntimes { Set infrastructures, WorkspaceSharedPool sharedPool) { this.runtimes = new ConcurrentHashMap<>(); - this.eventsService = eventsService; + this.eventService = eventsService; this.sharedPool = sharedPool; // TODO: consider extracting to a strategy interface(1. pick the last, 2. fail with conflict) @@ -93,6 +94,7 @@ public class WorkspaceRuntimes { } } infraByRecipe = ImmutableMap.copyOf(tmp); + } @PostConstruct @@ -112,7 +114,7 @@ public class WorkspaceRuntimes { } } - //TODO do we need some validation on start + //TODO do we need some validation on start? private InternalRuntime validate(InternalRuntime runtime) { return runtime; } @@ -232,11 +234,11 @@ public class WorkspaceRuntimes { InfrastructureException, ConflictException { - eventsService.publish(DtoFactory.newDto(WorkspaceStatusEvent.class) - .withWorkspaceId(workspaceId) - .withPrevStatus(WorkspaceStatus.RUNNING) - .withStatus(WorkspaceStatus.STOPPING) - .withEventType(EventType.STOPPING)); + eventService.publish(DtoFactory.newDto(WorkspaceStatusEvent.class) + .withWorkspaceId(workspaceId) + .withPrevStatus(WorkspaceStatus.RUNNING) + .withStatus(WorkspaceStatus.STOPPING) + .withEventType(EventType.STOPPING)); InternalRuntime runtime = runtimes.get(workspaceId); if (runtime == null) { @@ -252,7 +254,7 @@ public class WorkspaceRuntimes { .withPrevStatus(WorkspaceStatus.STOPPING); event.setStatus(WorkspaceStatus.STOPPED); event.setEventType(EventType.STOPPED); - eventsService.publish(event); + eventService.publish(event); } /** @@ -308,11 +310,11 @@ public class WorkspaceRuntimes { "' because its status is 'RUNNING'"); } - eventsService.publish(DtoFactory.newDto(WorkspaceStatusEvent.class) - .withWorkspaceId(workspaceId) - .withStatus(WorkspaceStatus.STARTING) - .withEventType(EventType.STARTING) - .withPrevStatus(WorkspaceStatus.STOPPED)); + eventService.publish(DtoFactory.newDto(WorkspaceStatusEvent.class) + .withWorkspaceId(workspaceId) + .withStatus(WorkspaceStatus.STARTING) + .withEventType(EventType.STARTING) + .withPrevStatus(WorkspaceStatus.STOPPED)); // Start environment @@ -321,7 +323,7 @@ public class WorkspaceRuntimes { } Subject subject = EnvironmentContext.getCurrent().getSubject(); - RuntimeIdentity runtimeId = new RuntimeIdentity(workspaceId, envName, subject.getUserName()); + RuntimeIdentity runtimeId = new RuntimeIdentityImpl(workspaceId, envName, subject.getUserName()); try { InternalRuntime runtime = infra.prepare(runtimeId, environment).start(options); @@ -333,11 +335,11 @@ public class WorkspaceRuntimes { } runtimes.put(workspaceId, runtime); - eventsService.publish(DtoFactory.newDto(WorkspaceStatusEvent.class) - .withWorkspaceId(workspaceId) - .withStatus(WorkspaceStatus.RUNNING) - .withEventType(EventType.RUNNING) - .withPrevStatus(WorkspaceStatus.STARTING)); + eventService.publish(DtoFactory.newDto(WorkspaceStatusEvent.class) + .withWorkspaceId(workspaceId) + .withStatus(WorkspaceStatus.RUNNING) + .withEventType(EventType.RUNNING) + .withPrevStatus(WorkspaceStatus.STARTING)); } catch (InternalInfrastructureException e) { LOG.error(format("Error occurs on workspace '%s' start. Error: %s", workspaceId, e)); throw new InfrastructureException(e.getMessage(), e); diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeContext.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeContext.java index 19f3707017..2152403c48 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeContext.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeContext.java @@ -17,6 +17,7 @@ import org.eclipse.che.api.core.model.workspace.WorkspaceStatus; import org.eclipse.che.api.core.model.workspace.config.Environment; import org.eclipse.che.api.core.model.workspace.config.MachineConfig; import org.eclipse.che.api.core.model.workspace.config.Recipe; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import org.eclipse.che.api.core.rest.HttpRequestHelper; import org.slf4j.Logger; @@ -39,20 +40,19 @@ public abstract class RuntimeContext { private static final Logger LOG = getLogger(RuntimeInfrastructure.class); protected final Environment environment; - protected final RuntimeIdentity identity; + protected final RuntimeIdentity identity; protected final RuntimeInfrastructure infrastructure; // TODO other than WorkspaceStatus impl private WorkspaceStatus state; protected final InternalRecipe recipe; protected final Map internalMachines = new HashMap<>(); - protected final URL statusChannel; + //protected final URL statusChannel; public RuntimeContext(Environment environment, RuntimeIdentity identity, RuntimeInfrastructure infrastructure, AgentSorter agentSorter, - AgentRegistry agentRegistry, - String statusChannel) + AgentRegistry agentRegistry) throws ValidationException, InfrastructureException { this.environment = environment; this.identity = identity; @@ -64,15 +64,6 @@ public abstract class RuntimeContext { internalMachines.put(entry.getKey(), new InternalMachineConfig(entry.getValue(), agentRegistry, agentSorter)); } - URL tmp; - try { - tmp = new URL(statusChannel); - } catch (MalformedURLException e) { - tmp = null; - LOG.error("URL building error for RuntimeContext status channel: " + infrastructure.getName() + " : " + e.getMessage()); - } - this.statusChannel = tmp; - } /** @@ -164,17 +155,18 @@ public abstract class RuntimeContext { UnsupportedOperationException; - /** - * Status Channel URL should be passed by Workspace API level. It is used for events about any kind of status changes, such as: - * - Agent installing statuses - * - Servers statuses - * - Infrastructure specific events - * Infrastructure MUST NOT use this channel for long-lived output (process stdout, logs etc) - * @return URL of status channel - */ - public URL getStatusChannel() { - return statusChannel; - } + +// /** +// * Status Channel URL should be passed by Workspace API level. It is used for events about any kind of status changes, such as: +// * - Agent installing statuses +// * - Servers statuses +// * - Infrastructure specific events +// * Infrastructure MUST NOT use this channel for long-lived output (process stdout, logs etc) +// * @return URL of status channel +// */ +// public URL getStatusChannel() { +// return statusChannel; +// } /** @@ -182,18 +174,18 @@ public abstract class RuntimeContext { * It is not necessary that all of this information is used for identifying * Runtime outside of SPI framework (in practice workspace ID looks like enough) * - * @return the RuntimeIdentity + * @return the RuntimeIdentityImpl */ public RuntimeIdentity getIdentity() { return identity; } - /** - * @return incoming Workspace Environment - */ - public Environment getEnvironment() { - return environment; - } +// /** +// * @return incoming Workspace Environment +// */ +// public Environment getEnvironment() { +// return environment; +// } /** * @return RuntimeInfrastructure the Context created from diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeIdentity.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeIdentityImpl.java similarity index 72% rename from wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeIdentity.java rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeIdentityImpl.java index fbbe796891..c72279fbf8 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeIdentity.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeIdentityImpl.java @@ -10,29 +10,34 @@ *******************************************************************************/ package org.eclipse.che.api.workspace.server.spi; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; + /** * @author gazarenkov */ -public final class RuntimeIdentity { +public final class RuntimeIdentityImpl implements RuntimeIdentity { private final String workspaceId; private final String envName; private final String owner; - public RuntimeIdentity(String workspaceId, String envName, String owner) { + public RuntimeIdentityImpl(String workspaceId, String envName, String owner) { this.workspaceId = workspaceId; this.envName = envName; this.owner = owner; } + @Override public String getWorkspaceId() { return workspaceId; } + @Override public String getEnvName() { return envName; } + @Override public String getOwner() { return owner; } @@ -44,14 +49,14 @@ public final class RuntimeIdentity { @Override public boolean equals(Object obj) { - if(! (obj instanceof RuntimeIdentity) ) + if(! (obj instanceof RuntimeIdentityImpl) ) return false; - RuntimeIdentity other = (RuntimeIdentity) obj; + RuntimeIdentityImpl other = (RuntimeIdentityImpl) obj; return workspaceId.equals(other.workspaceId) && envName.equals(other.envName); } @Override public String toString() { - return "RuntimeIdentity: { workspace: " + workspaceId + " environment: " + envName + " owner: " + owner +" }"; + return "RuntimeIdentityImpl: { workspace: " + workspaceId + " environment: " + envName + " owner: " + owner +" }"; } } diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeInfrastructure.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeInfrastructure.java index 05184781fe..08ad2a9a4a 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeInfrastructure.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/RuntimeInfrastructure.java @@ -15,6 +15,8 @@ import com.google.common.collect.ImmutableSet; import org.eclipse.che.api.core.ValidationException; import org.eclipse.che.api.core.model.workspace.config.Environment; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; +import org.eclipse.che.api.core.notification.EventService; import java.util.Collection; import java.util.Objects; @@ -28,13 +30,15 @@ import java.util.Set; */ public abstract class RuntimeInfrastructure { - protected final Set recipeTypes; - protected final String name; + protected final Set recipeTypes; + protected final String name; + protected final EventService eventService; - public RuntimeInfrastructure(String name, Collection types) { + public RuntimeInfrastructure(String name, Collection types, EventService eventService) { Preconditions.checkArgument(!types.isEmpty()); this.name = Objects.requireNonNull(name); this.recipeTypes = ImmutableSet.copyOf(types); + this.eventService = eventService; } /** @@ -52,6 +56,15 @@ public abstract class RuntimeInfrastructure { return recipeTypes; } + /** + * + * @return EventService + */ + public final EventService getEventService() { + return eventService; + } + + /** * An Infrastructure implementation should be able to preliminary estimate incoming Environment. * For example: for validating it before storing @@ -95,7 +108,7 @@ public abstract class RuntimeInfrastructure { * after shutting down Master server. * * @param id - * the RuntimeIdentity + * the RuntimeIdentityImpl * @return the Runtime * @throws UnsupportedOperationException * if implementation does not support runtimes tracking @@ -112,7 +125,7 @@ public abstract class RuntimeInfrastructure { * On the second phase Runtime is created with RuntimeContext.start() which is supposedly "long" method * * @param id - * the RuntimeIdentity + * the RuntimeIdentityImpl * @param environment * incoming Environment (configuration) * @return new RuntimeContext object diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/dummy/DummyRuntimeInfrastructure.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/dummy/DummyRuntimeInfrastructure.java index 386559a2bf..dfbacfe470 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/dummy/DummyRuntimeInfrastructure.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/dummy/DummyRuntimeInfrastructure.java @@ -14,9 +14,10 @@ import com.google.inject.Singleton; import org.eclipse.che.api.core.ValidationException; import org.eclipse.che.api.core.model.workspace.config.Environment; +import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; +import org.eclipse.che.api.core.notification.EventService; import org.eclipse.che.api.workspace.server.spi.InfrastructureException; import org.eclipse.che.api.workspace.server.spi.RuntimeContext; -import org.eclipse.che.api.workspace.server.spi.RuntimeIdentity; import org.eclipse.che.api.workspace.server.spi.RuntimeInfrastructure; import java.util.Collections; @@ -24,8 +25,8 @@ import java.util.Collections; @Singleton public class DummyRuntimeInfrastructure extends RuntimeInfrastructure { - public DummyRuntimeInfrastructure() { - super("dummy", Collections.singletonList("dummy")); + public DummyRuntimeInfrastructure(EventService eventService) { + super("dummy", Collections.singletonList("dummy"), eventService); } @Override diff --git a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/RuntimesTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/RuntimesTest.java index 1329f2856d..5177225063 100644 --- a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/RuntimesTest.java +++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/RuntimesTest.java @@ -348,7 +348,7 @@ public class RuntimesTest { // // then // verify(eventService).publish(DtoFactory.newDto(WorkspaceStatusEvent.class) // .withWorkspaceId(workspace.getId()) -// .withEventType(EventType.ERROR) +// .withEventType(EventType.FAILED) // .withPrevStatus(WorkspaceStatus.STARTING)); // } // } @@ -406,7 +406,7 @@ public class RuntimesTest { // // then // verify(eventService).publish(DtoFactory.newDto(WorkspaceStatusEvent.class) // .withWorkspaceId(workspace.getId()) -// .withEventType(WorkspaceStatusEvent.EventType.ERROR) +// .withEventType(WorkspaceStatusEvent.EventType.FAILED) // .withPrevStatus(WorkspaceStatus.STOPPING) // .withError("Test error")); // } @@ -755,7 +755,7 @@ public class RuntimesTest { // // public static class TestRuntimeInfra extends RuntimeInfrastructure { // -// private Map runtimes = new HashMap<>(); +// private Map runtimes = new HashMap<>(); // // public TestRuntimeInfra() throws ValidationException { // super("test", singleton("test")); @@ -767,17 +767,17 @@ public class RuntimesTest { // } // // @Override -// public Set getIdentities() { +// public Set getIdentities() { // return runtimes.keySet(); // } // // @Override -// public InternalRuntime getRuntime(RuntimeIdentity id) { +// public InternalRuntime getRuntime(RuntimeIdentityImpl id) { // return runtimes.get(id); // } // // @Override -// public RuntimeContext prepare(RuntimeIdentity id, Environment environment) throws ValidationException, ApiException, IOException { +// public RuntimeContext prepare(RuntimeIdentityImpl id, Environment environment) throws ValidationException, ApiException, IOException { // return new TestRuntimeContext(environment, id, this); // } // @@ -785,13 +785,13 @@ public class RuntimesTest { // // @Override -// public void stop(RuntimeIdentity runtimeId, Map options) { +// public void stop(RuntimeIdentityImpl runtimeId, Map options) { // LOG.info("Stopped " + runtimeId.getWorkspaceId()); // } // // // @Override -// public Runtime start(RuntimeIdentity runtimeId, Environment environment, MessageConsumer logger, +// public Runtime start(RuntimeIdentityImpl runtimeId, Environment environment, MessageConsumer logger, // Map options, Subject subject) // throws NotFoundException, ConflictException, ServerException { // @@ -801,13 +801,13 @@ public class RuntimesTest { // } // // @Override -// public Map getAll() { +// public Map getAll() { // return runtimes; // } // } // // public static class TestRuntimeContext extends RuntimeContext { -// public TestRuntimeContext(Environment environment, RuntimeIdentity identity, +// public TestRuntimeContext(Environment environment, RuntimeIdentityImpl identity, // RuntimeInfrastructure infrastructure) throws ApiException, IOException, ValidationException { // super(environment, identity, infrastructure, null); // }