diff --git a/agents/che-core-api-agent/pom.xml b/agents/che-core-api-agent/pom.xml
index 0fd8453f0c..be684342b3 100644
--- a/agents/che-core-api-agent/pom.xml
+++ b/agents/che-core-api-agent/pom.xml
@@ -59,10 +59,6 @@
org.eclipse.che.core
che-core-api-dto
-
- org.eclipse.che.core
- che-core-api-machine
-
org.eclipse.che.core
che-core-api-model
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 5cbeee94ca..3d8e3bb686 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
@@ -21,10 +21,6 @@ import org.eclipse.che.api.core.model.workspace.config.Command;
import org.eclipse.che.api.core.util.AbstractLineConsumer;
import org.eclipse.che.api.core.util.LineConsumer;
import org.eclipse.che.api.core.util.ListLineConsumer;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
-import org.eclipse.che.api.machine.server.spi.Instance;
-import org.eclipse.che.api.machine.server.spi.InstanceProcess;
import org.eclipse.che.commons.lang.concurrent.LoggingUncaughtExceptionHandler;
import org.eclipse.che.commons.lang.concurrent.ThreadLocalPropagateContext;
import org.slf4j.Logger;
@@ -69,7 +65,7 @@ public abstract class AbstractAgentLauncher implements AgentLauncher {
this.agentLaunchingChecker = agentLaunchingChecker;
}
- @Override
+ /*@Override
public void launch(Instance machine, Agent agent) throws ServerException, AgentStartException {
if (isNullOrEmpty(agent.getScript())) {
return;
@@ -160,6 +156,6 @@ public abstract class AbstractAgentLauncher implements AgentLauncher {
machine.getId(),
machine.getNode());
}
- }
+ }*/
}
diff --git a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AgentLauncher.java b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AgentLauncher.java
index ab1d7584fc..76c2fa3a0f 100644
--- a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AgentLauncher.java
+++ b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AgentLauncher.java
@@ -13,7 +13,6 @@ package org.eclipse.che.api.agent.server.launcher;
import org.eclipse.che.api.agent.server.exception.AgentStartException;
import org.eclipse.che.api.agent.shared.model.Agent;
import org.eclipse.che.api.core.ServerException;
-import org.eclipse.che.api.machine.server.spi.Instance;
/**
* Launches {@link Agent#getScript()} on the {@link Instance}.
@@ -48,5 +47,5 @@ public interface AgentLauncher {
* @throws ServerException
* if script execution failed
*/
- void launch(Instance machine, Agent agent) throws ServerException, AgentStartException;
+// void launch(Instance machine, Agent agent) throws ServerException, AgentStartException;
}
diff --git a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AgentLaunchingChecker.java b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AgentLaunchingChecker.java
index 78a0113734..510b03954b 100644
--- a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AgentLaunchingChecker.java
+++ b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AgentLaunchingChecker.java
@@ -10,17 +10,12 @@
*******************************************************************************/
package org.eclipse.che.api.agent.server.launcher;
-import org.eclipse.che.api.agent.shared.model.Agent;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.spi.Instance;
-import org.eclipse.che.api.machine.server.spi.InstanceProcess;
-
/**
* Indicates if agent finished working.
*
* @author Anatoliy Bazko
*/
-@FunctionalInterface
+//@FunctionalInterface
public interface AgentLaunchingChecker {
/**
@@ -35,7 +30,7 @@ public interface AgentLaunchingChecker {
* @throws MachineException
* if unexpected error is occurred
*/
- boolean isLaunched(Agent agent, InstanceProcess process, Instance machine) throws MachineException;
-
- AgentLaunchingChecker DEFAULT = (agent, process, machine) -> !process.isAlive();
+// boolean isLaunched(Agent agent, InstanceProcess process, Instance machine) throws MachineException;
+//
+// AgentLaunchingChecker DEFAULT = (agent, process, machine) -> !process.isAlive();
}
diff --git a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/CommandExistsAgentChecker.java b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/CommandExistsAgentChecker.java
index dede9bb6cb..9265cb11e5 100644
--- a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/CommandExistsAgentChecker.java
+++ b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/CommandExistsAgentChecker.java
@@ -10,15 +10,6 @@
*******************************************************************************/
package org.eclipse.che.api.agent.server.launcher;
-import org.eclipse.che.api.agent.shared.model.Agent;
-import org.eclipse.che.api.core.ConflictException;
-import org.eclipse.che.api.core.model.workspace.config.Command;
-import org.eclipse.che.api.core.util.ListLineConsumer;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
-import org.eclipse.che.api.machine.server.spi.Instance;
-import org.eclipse.che.api.machine.server.spi.InstanceProcess;
-
import static java.lang.String.format;
/**
@@ -37,7 +28,7 @@ public class CommandExistsAgentChecker implements AgentLaunchingChecker {
this.checkingCommand = format(CHECK_COMMAND, commandToCheck);
}
- @Override
+ /*@Override
public boolean isLaunched(Agent agent, InstanceProcess process, Instance machine) throws MachineException {
Command command = new CommandImpl(format("Wait for %s, try %d", agent.getId(), ++counter),
checkingCommand,
@@ -50,5 +41,5 @@ public class CommandExistsAgentChecker implements AgentLaunchingChecker {
} catch (ConflictException e) {
throw new MachineException(e.getServiceError());
}
- }
+ }*/
}
diff --git a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/CompositeAgentLaunchingChecker.java b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/CompositeAgentLaunchingChecker.java
index 8d85663dda..84df90bde6 100644
--- a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/CompositeAgentLaunchingChecker.java
+++ b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/CompositeAgentLaunchingChecker.java
@@ -10,11 +10,6 @@
*******************************************************************************/
package org.eclipse.che.api.agent.server.launcher;
-import org.eclipse.che.api.agent.shared.model.Agent;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.spi.Instance;
-import org.eclipse.che.api.machine.server.spi.InstanceProcess;
-
import java.util.Arrays;
import java.util.List;
@@ -41,7 +36,7 @@ public class CompositeAgentLaunchingChecker implements AgentLaunchingChecker {
this.agentLaunchingCheckers = Arrays.asList(agentLaunchingCheckers);
}
- @Override
+ /*@Override
public boolean isLaunched(Agent agent, InstanceProcess process, Instance machine) throws MachineException {
for (AgentLaunchingChecker agentLaunchingChecker : agentLaunchingCheckers) {
if (!agentLaunchingChecker.isLaunched(agent, process, machine)) {
@@ -49,5 +44,5 @@ public class CompositeAgentLaunchingChecker implements AgentLaunchingChecker {
}
}
return true;
- }
+ }*/
}
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 42bfc50dd8..1ad4cf47b2 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
@@ -13,16 +13,6 @@ package org.eclipse.che.api.agent.server.launcher;
import com.google.inject.Inject;
import com.google.inject.Singleton;
-import org.eclipse.che.api.agent.shared.model.Agent;
-import org.eclipse.che.api.core.ServerException;
-import org.eclipse.che.api.core.util.AbstractLineConsumer;
-import org.eclipse.che.api.core.util.LineConsumer;
-import org.eclipse.che.api.machine.server.spi.Instance;
-
-import java.io.IOException;
-
-import static com.google.common.base.Strings.isNullOrEmpty;
-
/**
* Launches agent and waits while it is finished.
*
@@ -36,7 +26,7 @@ public class DefaultAgentLauncher implements AgentLauncher {
@Inject
public DefaultAgentLauncher() { }
- @Override
+ /*@Override
public void launch(Instance machine, Agent agent) throws ServerException {
if (isNullOrEmpty(agent.getScript())) {
return;
@@ -69,7 +59,7 @@ public class DefaultAgentLauncher implements AgentLauncher {
// }
// }
}
-
+*/
@Override
public String getAgentId() {
return "any";
diff --git a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/MappedPortIsListeningAgentChecker.java b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/MappedPortIsListeningAgentChecker.java
index 747ff90f88..f68392385f 100644
--- a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/MappedPortIsListeningAgentChecker.java
+++ b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/MappedPortIsListeningAgentChecker.java
@@ -10,12 +10,6 @@
*******************************************************************************/
package org.eclipse.che.api.agent.server.launcher;
-import org.eclipse.che.api.agent.shared.model.Agent;
-import org.eclipse.che.api.core.model.workspace.runtime.Server;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.spi.Instance;
-import org.eclipse.che.api.machine.server.spi.InstanceProcess;
-
/**
* Verifies that agent was started successfully by checking that specified local port is listened in a machine.
*
@@ -28,7 +22,7 @@ public class MappedPortIsListeningAgentChecker implements AgentLaunchingChecker
// normalize port/transport value
this.exposedPort = exposedPort.contains("/") ? exposedPort : exposedPort + "/tcp";
}
-
+/*
@Override
public boolean isLaunched(Agent agent, InstanceProcess process, Instance machine) throws MachineException {
Server server = machine.getRuntime().getServers().get(exposedPort);
@@ -45,5 +39,5 @@ public class MappedPortIsListeningAgentChecker implements AgentLaunchingChecker
// }
// }
return false;
- }
+ }*/
}
diff --git a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/NoOpAgentLaunchingChecker.java b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/NoOpAgentLaunchingChecker.java
index 0e68006535..b0b512d1fb 100644
--- a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/NoOpAgentLaunchingChecker.java
+++ b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/NoOpAgentLaunchingChecker.java
@@ -10,19 +10,14 @@
*******************************************************************************/
package org.eclipse.che.api.agent.server.launcher;
-import org.eclipse.che.api.agent.shared.model.Agent;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.spi.Instance;
-import org.eclipse.che.api.machine.server.spi.InstanceProcess;
-
/**
* Agent launching checker that does nothing. Useful when agent does not run in a machine as daemon.
*
* @author Alexander Garagatyi
*/
public class NoOpAgentLaunchingChecker implements AgentLaunchingChecker {
- @Override
+ /*@Override
public boolean isLaunched(Agent agent, InstanceProcess process, Instance machine) throws MachineException {
return true;
- }
+ }*/
}
diff --git a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/ProcessIsLaunchedChecker.java b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/ProcessIsLaunchedChecker.java
index b032c77d27..3a1a8a5894 100644
--- a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/ProcessIsLaunchedChecker.java
+++ b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/ProcessIsLaunchedChecker.java
@@ -10,17 +10,6 @@
*******************************************************************************/
package org.eclipse.che.api.agent.server.launcher;
-import org.eclipse.che.api.agent.shared.model.Agent;
-import org.eclipse.che.api.core.ConflictException;
-import org.eclipse.che.api.core.model.workspace.config.Command;
-import org.eclipse.che.api.core.util.ListLineConsumer;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
-import org.eclipse.che.api.machine.server.spi.Instance;
-import org.eclipse.che.api.machine.server.spi.InstanceProcess;
-
-import static java.lang.String.format;
-
/**
* Verifies if agent started a process with specific name.
* It is an indicator that process had been finished.
@@ -41,7 +30,7 @@ public class ProcessIsLaunchedChecker implements AgentLaunchingChecker {
this.processNameToWait = processNameToWait;
}
- @Override
+ /*@Override
public boolean isLaunched(Agent agent, InstanceProcess process, Instance machine) throws MachineException {
Command command = new CommandImpl(format("Wait for %s, try %d", agent.getId(), ++counter),
format(CHECK_COMMAND, processNameToWait),
@@ -54,5 +43,5 @@ public class ProcessIsLaunchedChecker implements AgentLaunchingChecker {
} catch (ConflictException e) {
throw new MachineException(e.getServiceError());
}
- }
+ }*/
}
diff --git a/agents/che-core-api-agent/src/test/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncherTest.java b/agents/che-core-api-agent/src/test/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncherTest.java
index 5f2090ff70..1bb80ae059 100644
--- a/agents/che-core-api-agent/src/test/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncherTest.java
+++ b/agents/che-core-api-agent/src/test/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncherTest.java
@@ -39,7 +39,6 @@ import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
diff --git a/agents/exec/pom.xml b/agents/exec/pom.xml
index 7c8ddc4c77..908ef36972 100644
--- a/agents/exec/pom.xml
+++ b/agents/exec/pom.xml
@@ -41,10 +41,6 @@
org.eclipse.che.core
che-core-api-core
-
- org.eclipse.che.core
- che-core-api-machine
-
diff --git a/agents/terminal/pom.xml b/agents/terminal/pom.xml
index 2b1673a71b..b177426063 100644
--- a/agents/terminal/pom.xml
+++ b/agents/terminal/pom.xml
@@ -41,10 +41,6 @@
org.eclipse.che.core
che-core-api-core
-
- org.eclipse.che.core
- che-core-api-machine
-
diff --git a/assembly/assembly-wsmaster-war/pom.xml b/assembly/assembly-wsmaster-war/pom.xml
index 5f5b932bd3..6cdf6a7fef 100644
--- a/assembly/assembly-wsmaster-war/pom.xml
+++ b/assembly/assembly-wsmaster-war/pom.xml
@@ -118,10 +118,6 @@
org.eclipse.che.core
che-core-api-factory
-
- org.eclipse.che.core
- che-core-api-machine
-
org.eclipse.che.core
che-core-api-project-templates
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 9799905107..34bb64cd01 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
@@ -31,6 +31,10 @@ import org.eclipse.che.api.factory.server.FactoryAcceptValidator;
import org.eclipse.che.api.factory.server.FactoryCreateValidator;
import org.eclipse.che.api.factory.server.FactoryEditValidator;
import org.eclipse.che.api.factory.server.FactoryParametersResolver;
+import org.eclipse.che.api.recipe.JpaRecipeDao;
+import org.eclipse.che.api.recipe.RecipeDao;
+import org.eclipse.che.api.recipe.RecipeLoader;
+import org.eclipse.che.api.recipe.RecipeService;
import org.eclipse.che.api.user.server.TokenValidator;
import org.eclipse.che.api.workspace.server.RemoveWorkspaceFilesAfterRemoveWorkspaceEventSubscriber;
import org.eclipse.che.api.workspace.server.adapter.StackMessageBodyAdapter;
@@ -42,6 +46,8 @@ import org.eclipse.che.inject.DynaModule;
import org.eclipse.che.plugin.github.factory.resolver.GithubFactoryParametersResolver;
import org.eclipse.che.workspace.infrastructure.docker.DockerInfraModule;
import org.eclipse.che.workspace.infrastructure.docker.local.LocalDockerModule;
+import org.eclipse.che.workspace.infrastructure.docker.snapshot.JpaSnapshotDao;
+import org.eclipse.che.workspace.infrastructure.docker.snapshot.SnapshotDao;
import org.flywaydb.core.internal.util.PlaceholderReplacer;
import javax.sql.DataSource;
@@ -59,7 +65,10 @@ public class WsMasterModule extends AbstractModule {
install(new org.eclipse.che.account.api.AccountModule());
install(new org.eclipse.che.api.user.server.jpa.UserJpaModule());
install(new org.eclipse.che.api.ssh.server.jpa.SshJpaModule());
- install(new org.eclipse.che.api.machine.server.jpa.MachineJpaModule());
+// install(new org.eclipse.che.api.machine.server.jpa.MachineJpaModule());
+ bind(RecipeDao.class).to(JpaRecipeDao.class);
+ // TODO spi move into docker infra impl
+ bind(SnapshotDao.class).to(JpaSnapshotDao.class);
install(new org.eclipse.che.api.workspace.server.jpa.WorkspaceJpaModule());
install(new org.eclipse.che.api.core.jsonrpc.JsonRpcModule());
install(new org.eclipse.che.api.core.websocket.WebSocketModule());
@@ -91,7 +100,7 @@ public class WsMasterModule extends AbstractModule {
bind(org.eclipse.che.api.project.server.template.ProjectTemplateRegistry.class);
bind(org.eclipse.che.api.project.server.template.ProjectTemplateService.class);
bind(org.eclipse.che.api.ssh.server.SshService.class);
- bind(org.eclipse.che.api.machine.server.recipe.RecipeService.class);
+ bind(RecipeService.class);
bind(org.eclipse.che.api.user.server.UserService.class);
bind(org.eclipse.che.api.user.server.ProfileService.class);
bind(org.eclipse.che.api.user.server.PreferencesService.class);
@@ -127,7 +136,7 @@ public class WsMasterModule extends AbstractModule {
bind(org.eclipse.che.api.agent.server.WsAgentHealthChecker.class)
.to(org.eclipse.che.api.agent.server.WsAgentHealthCheckerImpl.class);
- bind(org.eclipse.che.api.machine.server.recipe.RecipeLoader.class);
+ bind(RecipeLoader.class);
Multibinder.newSetBinder(binder(), String.class, Names.named("predefined.recipe.path"))
.addBinding()
.toInstance("predefined-recipes.json");
@@ -182,7 +191,7 @@ public class WsMasterModule extends AbstractModule {
install(new org.eclipse.che.api.core.util.FileCleaner.FileCleanerModule());
// FIXME: spi
// install(new org.eclipse.che.plugin.docker.machine.local.LocalDockerModule());
- install(new org.eclipse.che.api.machine.server.MachineModule());
+// install(new org.eclipse.che.api.machine.server.MachineModule());
// FIXME: spi
// install(new org.eclipse.che.plugin.docker.machine.ext.DockerExtServerModule());
install(new org.eclipse.che.swagger.deploy.DocsModule());
diff --git a/assembly/assembly-wsmaster-war/src/main/resources/META-INF/persistence.xml b/assembly/assembly-wsmaster-war/src/main/resources/META-INF/persistence.xml
index b876ac7680..9f2e8f33ef 100644
--- a/assembly/assembly-wsmaster-war/src/main/resources/META-INF/persistence.xml
+++ b/assembly/assembly-wsmaster-war/src/main/resources/META-INF/persistence.xml
@@ -33,10 +33,10 @@
org.eclipse.che.api.workspace.server.model.impl.ServerConfigImpl
org.eclipse.che.api.workspace.server.model.impl.stack.StackImpl
- org.eclipse.che.api.machine.server.model.impl.CommandImpl
- org.eclipse.che.api.machine.server.model.impl.MachineSourceImpl
- org.eclipse.che.api.machine.server.model.impl.SnapshotImpl
- org.eclipse.che.api.machine.server.recipe.OldRecipeImpl
+ org.eclipse.che.api.workspace.server.model.impl.CommandImpl
+ org.eclipse.che.api.workspace.server.model.impl.MachineSourceImpl
+ org.eclipse.che.workspace.infrastructure.docker.snapshot.SnapshotImpl
+ org.eclipse.che.api.recipe.OldRecipeImpl
org.eclipse.che.api.factory.server.model.impl.FactoryImpl
org.eclipse.che.api.factory.server.model.impl.OnAppClosedImpl
diff --git a/infrastructures/docker/pom.xml b/infrastructures/docker/pom.xml
index ad28aab409..6179b96cab 100644
--- a/infrastructures/docker/pom.xml
+++ b/infrastructures/docker/pom.xml
@@ -78,10 +78,6 @@
org.eclipse.che.core
che-core-api-core
-
- org.eclipse.che.core
- che-core-api-machine
-
org.eclipse.che.core
che-core-api-model
@@ -98,6 +94,30 @@
org.eclipse.che.core
che-core-commons-annotations
+
+ org.eclipse.persistence
+ eclipselink
+ provided
+
+
+ org.eclipse.persistence
+ javax.persistence
+ provided
+
+
+ com.google.code.gson
+ gson
+
+
+ com.google.inject.extensions
+ guice-persist
+ provided
+
+
+ org.eclipse.che.core
+ che-core-db
+ provided
+
org.eclipse.che.core
che-core-commons-lang
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/ServiceStarter.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/ServiceStarter.java
index 358842f602..78a924abc6 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/ServiceStarter.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/ServiceStarter.java
@@ -20,8 +20,7 @@ import org.eclipse.che.api.core.util.FileCleaner;
import org.eclipse.che.api.core.util.LineConsumer;
import org.eclipse.che.api.core.util.ListLineConsumer;
import org.eclipse.che.api.core.util.SystemInfo;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.model.impl.MachineSourceImpl;
+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.RuntimeIdentity;
import org.eclipse.che.commons.annotation.Nullable;
@@ -324,7 +323,7 @@ public class ServiceStarter {
String machineImageName,
boolean doForcePullOnBuild,
ProgressMonitor progressMonitor)
- throws MachineException {
+ throws ServerException {
File workDir = null;
try {
@@ -356,7 +355,7 @@ public class ServiceStarter {
docker.buildImage(buildImageParams, progressMonitor);
} catch (IOException e) {
- throw new MachineException(e.getLocalizedMessage(), e);
+ throw new ServerException(e.getLocalizedMessage(), e);
} finally {
if (workDir != null) {
FileCleaner.addFile(workDir);
@@ -375,16 +374,16 @@ public class ServiceStarter {
* consumer of output
* @throws SourceNotFoundException
* if image for pulling not found
- * @throws MachineException
+ * @throws ServerException
* if any other error occurs
*/
protected void pullImage(DockerService service,
String machineImageName,
- ProgressMonitor progressMonitor) throws MachineException, SourceNotFoundException {
+ ProgressMonitor progressMonitor) throws ServerException, SourceNotFoundException {
DockerMachineSource dockerMachineSource = new DockerMachineSource(
new MachineSourceImpl("image").setLocation(service.getImage()));
if (dockerMachineSource.getRepository() == null) {
- throw new MachineException(
+ throw new ServerException(
format("Machine creation failed. Machine source is invalid. No repository is defined. Found '%s'.",
dockerMachineSource));
}
@@ -413,7 +412,7 @@ public class ServiceStarter {
docker.removeImage(RemoveImageParams.create(fullNameOfPulledImage).withForce(false));
}
} catch (IOException e) {
- throw new MachineException("Can't create machine from image. Cause: " + e.getLocalizedMessage(), e);
+ throw new ServerException("Can't create machine from image. Cause: " + e.getLocalizedMessage(), e);
}
}
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 b6ff76ff75..d642614f01 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,7 +12,7 @@ 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.machine.server.util.RecipeDownloader;
+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;
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/ComposeEnvironmentParser.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/ComposeEnvironmentParser.java
index 0731626ad5..a22e053afe 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/ComposeEnvironmentParser.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/ComposeEnvironmentParser.java
@@ -21,7 +21,7 @@ import org.eclipse.che.api.core.ServerException;
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.config.Recipe;
-import org.eclipse.che.api.machine.server.util.RecipeDownloader;
+import org.eclipse.che.api.workspace.server.RecipeDownloader;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.workspace.infrastructure.docker.environment.TypeSpecificEnvironmentParser;
import org.eclipse.che.workspace.infrastructure.docker.environment.compose.model.ComposeEnvironment;
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/monit/DockerInstanceStopDetector.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/monit/DockerInstanceStopDetector.java
index a1f5268c65..ab9bfa652c 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/monit/DockerInstanceStopDetector.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/monit/DockerInstanceStopDetector.java
@@ -15,9 +15,8 @@ import com.google.common.cache.CacheBuilder;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import org.eclipse.che.api.core.notification.EventService;
-import org.eclipse.che.commons.lang.concurrent.LoggingUncaughtExceptionHandler;
-import org.eclipse.che.api.machine.server.event.InstanceStateEvent;
import org.eclipse.che.commons.lang.Pair;
+import org.eclipse.che.commons.lang.concurrent.LoggingUncaughtExceptionHandler;
import org.eclipse.che.plugin.docker.client.DockerConnector;
import org.eclipse.che.plugin.docker.client.DockerConnectorProvider;
import org.eclipse.che.plugin.docker.client.MessageProcessor;
@@ -141,7 +140,7 @@ public class DockerInstanceStopDetector {
LOG.info("OOM of process in container {} has been detected", message.getId());
break;
case "die":
- InstanceStateEvent.Type instanceStateChangeType;
+ /*InstanceStateEvent.Type instanceStateChangeType;
if (containersOomTimestamps.getIfPresent(message.getId()) != null) {
instanceStateChangeType = InstanceStateEvent.Type.OOM;
containersOomTimestamps.invalidate(message.getId());
@@ -155,7 +154,7 @@ public class DockerInstanceStopDetector {
instanceIds.second,
instanceStateChangeType));
lastProcessedEventDate = message.getTime();
- }
+ }*/
break;
default:
// we don't care about other event types
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/DockerInstance.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/DockerInstance.java
index c04dff119e..44f481e294 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/DockerInstance.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/DockerInstance.java
@@ -10,10 +10,8 @@
*******************************************************************************/
package org.eclipse.che.workspace.infrastructure.docker.old;
-import org.eclipse.che.api.machine.server.spi.Instance;
-
/**
- * Docker implementation of {@link Instance}
+ * Docker implementation of {@link }
*
* @author andrew00x
* @author Alexander Garagatyi
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/DockerInstanceProvider.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/DockerInstanceProvider.java
index 214f6356e1..2796ccf821 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/DockerInstanceProvider.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/DockerInstanceProvider.java
@@ -15,19 +15,12 @@ import com.google.inject.Singleton;
import org.eclipse.che.api.core.NotFoundException;
import org.eclipse.che.api.core.model.machine.MachineSource;
-import org.eclipse.che.api.core.model.workspace.runtime.Machine;
-import org.eclipse.che.api.core.util.LineConsumer;
-import org.eclipse.che.api.machine.server.exception.InvalidRecipeException;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.exception.SnapshotException;
-import org.eclipse.che.api.machine.server.exception.UnsupportedRecipeException;
-import org.eclipse.che.api.machine.server.spi.Instance;
-import org.eclipse.che.api.machine.server.spi.InstanceProvider;
import org.eclipse.che.commons.lang.IoUtil;
import org.eclipse.che.plugin.docker.client.DockerConnector;
import org.eclipse.che.plugin.docker.client.DockerConnectorProvider;
import org.eclipse.che.plugin.docker.client.DockerRegistryAuthResolver;
import org.eclipse.che.plugin.docker.client.params.RemoveImageParams;
+import org.eclipse.che.workspace.infrastructure.docker.snapshot.SnapshotException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,14 +34,13 @@ import java.net.URL;
import static org.eclipse.che.plugin.docker.client.DockerRegistryAuthResolver.DEFAULT_REGISTRY_SYNONYMS;
/**
- * Docker implementation of {@link InstanceProvider}
*
* @author andrew00x
* @author Alexander Garagatyi
* @author Roman Iuvshyn
* @author Mykola Morhun
*
- * @deprecated use {@link MachineProviderImpl} instead
+ * @deprecated use {@link } instead
*/
@Deprecated
@Singleton
@@ -93,7 +85,7 @@ public class DockerInstanceProvider {
* machine description
* @param creationLogsOutput
* output for instance creation logs
- * @return newly created {@link Instance}
+ * @return newly created {@link }
* @throws UnsupportedRecipeException
* if specified {@code recipe} is not supported
* @throws InvalidRecipeException
@@ -103,11 +95,11 @@ public class DockerInstanceProvider {
* @throws MachineException
* if other error occurs
*/
- public Instance createInstance(Machine machine,
+ /*public Instance createInstance(Machine machine,
LineConsumer creationLogsOutput) throws NotFoundException,
- MachineException {
+ Exception {
throw new UnsupportedOperationException("This machine provider is deprecated.");
- }
+ }*/
/**
* Removes snapshot of the instance in implementation specific way.
@@ -123,7 +115,7 @@ public class DockerInstanceProvider {
final DockerMachineSource dockerMachineSource;
try {
dockerMachineSource = new DockerMachineSource(machineSource);
- } catch (MachineException e) {
+ } catch (Exception e) {
throw new SnapshotException(e);
}
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/DockerMachineSource.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/DockerMachineSource.java
index 9bb51bc873..07f3e4d622 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/DockerMachineSource.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/DockerMachineSource.java
@@ -10,9 +10,9 @@
*******************************************************************************/
package org.eclipse.che.workspace.infrastructure.docker.old;
+import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.model.machine.MachineSource;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.model.impl.MachineSourceImpl;
+import org.eclipse.che.api.workspace.server.model.impl.MachineSourceImpl;
import org.eclipse.che.plugin.docker.client.DockerFileException;
import org.eclipse.che.plugin.docker.client.DockerRegistryAuthResolver;
import org.eclipse.che.plugin.docker.client.parser.DockerImageIdentifier;
@@ -50,10 +50,10 @@ public class DockerMachineSource extends MachineSourceImpl {
* Build a dedicated docker image source based on a given machine source object.
* @param machineSource the machine source used to parse data.
*/
- public DockerMachineSource(MachineSource machineSource) throws MachineException {
+ public DockerMachineSource(MachineSource machineSource) throws ServerException {
// check type
if (!DockerInstanceProvider.DOCKER_IMAGE_TYPE.equals(machineSource.getType())) {
- throw new MachineException("Docker machine source can only be built with '" + DockerInstanceProvider.DOCKER_IMAGE_TYPE + "' type");
+ throw new ServerException("Docker machine source can only be built with '" + DockerInstanceProvider.DOCKER_IMAGE_TYPE + "' type");
}
setType(DockerInstanceProvider.DOCKER_IMAGE_TYPE);
@@ -62,7 +62,7 @@ public class DockerMachineSource extends MachineSourceImpl {
try {
dockerImageIdentifier = DockerImageIdentifierParser.parse(machineSource.getLocation());
} catch (DockerFileException e) {
- throw new MachineException("Try to build a docker machine source with an invalid location/content. It is not in the expected format", e);
+ throw new ServerException("Try to build a docker machine source with an invalid location/content. It is not in the expected format", e);
}
// populate
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/AbstractAgentLauncher.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/AbstractAgentLauncher.java
index 0a03fa8d69..8c2d3cd070 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/AbstractAgentLauncher.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/AbstractAgentLauncher.java
@@ -16,7 +16,7 @@ import org.eclipse.che.api.agent.shared.model.Agent;
import org.eclipse.che.api.core.model.workspace.config.Command;
import org.eclipse.che.api.core.util.AbstractLineConsumer;
import org.eclipse.che.api.core.util.LineConsumer;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.commons.lang.concurrent.LoggingUncaughtExceptionHandler;
import org.eclipse.che.workspace.infrastructure.docker.model.DockerService;
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/CommandExistsAgentChecker.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/CommandExistsAgentChecker.java
index d7e3da2657..a22f9f763c 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/CommandExistsAgentChecker.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/CommandExistsAgentChecker.java
@@ -12,7 +12,7 @@ package org.eclipse.che.workspace.infrastructure.docker.old.agents;
import org.eclipse.che.api.agent.shared.model.Agent;
import org.eclipse.che.api.core.model.workspace.config.Command;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.workspace.infrastructure.docker.model.DockerService;
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/DefaultAgentLauncher.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/DefaultAgentLauncher.java
index 62c29c0940..67eeb494b7 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/DefaultAgentLauncher.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/DefaultAgentLauncher.java
@@ -14,15 +14,6 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.che.api.agent.server.launcher.AgentLauncher;
-import org.eclipse.che.api.agent.shared.model.Agent;
-import org.eclipse.che.api.core.ServerException;
-import org.eclipse.che.api.core.util.AbstractLineConsumer;
-import org.eclipse.che.api.core.util.LineConsumer;
-import org.eclipse.che.api.machine.server.spi.Instance;
-
-import java.io.IOException;
-
-import static com.google.common.base.Strings.isNullOrEmpty;
/**
* Launches agent and waits while it is finished.
@@ -37,7 +28,7 @@ public class DefaultAgentLauncher implements AgentLauncher {
@Inject
public DefaultAgentLauncher() { }
- @Override
+ /*@Override
public void launch(Instance machine, Agent agent) throws ServerException {
if (isNullOrEmpty(agent.getScript())) {
return;
@@ -69,7 +60,7 @@ public class DefaultAgentLauncher implements AgentLauncher {
// } catch (IOException ignored) {
// }
// }
- }
+ }*/
@Override
public String getAgentId() {
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/ProcessIsLaunchedChecker.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/ProcessIsLaunchedChecker.java
index ce444f4bbb..1ae0cf93d3 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/ProcessIsLaunchedChecker.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/ProcessIsLaunchedChecker.java
@@ -12,7 +12,7 @@ package org.eclipse.che.workspace.infrastructure.docker.old.agents;
import org.eclipse.che.api.agent.shared.model.Agent;
import org.eclipse.che.api.core.model.workspace.config.Command;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.workspace.infrastructure.docker.model.DockerService;
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/WsAgentLauncher.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/WsAgentLauncher.java
index 1dc36dfed9..6278670bcf 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/WsAgentLauncher.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/agents/WsAgentLauncher.java
@@ -16,7 +16,7 @@ import org.eclipse.che.api.core.ApiException;
import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.rest.HttpJsonRequest;
import org.eclipse.che.api.core.rest.HttpJsonResponse;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.commons.annotation.Nullable;
import org.eclipse.che.workspace.infrastructure.docker.model.DockerService;
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/local/node/DockerNode.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/local/node/DockerNode.java
index 2cf19d37c9..b9a6545e09 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/local/node/DockerNode.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/local/node/DockerNode.java
@@ -11,14 +11,13 @@
package org.eclipse.che.workspace.infrastructure.docker.old.local.node;
import org.eclipse.che.api.core.ServerException;
-import org.eclipse.che.api.machine.server.spi.InstanceNode;
/**
* Provides access to operation machines need but not supported by the Docker
*
* @author Alexander Garagatyi
*/
-public interface DockerNode extends InstanceNode {
+public interface DockerNode {
/**
* Bind the whole workspace on the Node.
*
@@ -35,7 +34,6 @@ public interface DockerNode extends InstanceNode {
*/
void unbindWorkspace() throws ServerException;
- @Override
String getHost();
/**
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/jpa/JpaSnapshotDao.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/JpaSnapshotDao.java
similarity index 91%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/jpa/JpaSnapshotDao.java
rename to infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/JpaSnapshotDao.java
index 541d6dcf1a..972ae103a9 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/jpa/JpaSnapshotDao.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/JpaSnapshotDao.java
@@ -8,15 +8,12 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.jpa;
+package org.eclipse.che.workspace.infrastructure.docker.snapshot;
import com.google.inject.persist.Transactional;
import org.eclipse.che.api.core.NotFoundException;
import org.eclipse.che.core.db.jpa.DuplicateKeyException;
-import org.eclipse.che.api.machine.server.exception.SnapshotException;
-import org.eclipse.che.api.machine.server.model.impl.SnapshotImpl;
-import org.eclipse.che.api.machine.server.spi.SnapshotDao;
import javax.inject.Inject;
import javax.inject.Provider;
@@ -98,11 +95,11 @@ public class JpaSnapshotDao implements SnapshotDao {
try {
doSave(snapshot);
} catch (DuplicateKeyException x) {
- throw new SnapshotException(format("Snapshot with id '%s' or for machine '%s:%s:%s' already exists",
- snapshot.getId(),
- snapshot.getWorkspaceId(),
- snapshot.getEnvName(),
- snapshot.getMachineName()));
+ throw new SnapshotException(String.format("Snapshot with id '%s' or for machine '%s:%s:%s' already exists",
+ snapshot.getId(),
+ snapshot.getWorkspaceId(),
+ snapshot.getEnvName(),
+ snapshot.getMachineName()));
} catch (RuntimeException x) {
throw new SnapshotException(x.getLocalizedMessage(), x);
}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/SnapshotDao.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/SnapshotDao.java
similarity index 95%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/SnapshotDao.java
rename to infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/SnapshotDao.java
index 4bc99ad5ff..4f873980b9 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/SnapshotDao.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/SnapshotDao.java
@@ -8,11 +8,9 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.spi;
+package org.eclipse.che.workspace.infrastructure.docker.snapshot;
import org.eclipse.che.api.core.NotFoundException;
-import org.eclipse.che.api.machine.server.exception.SnapshotException;
-import org.eclipse.che.api.machine.server.model.impl.SnapshotImpl;
import java.util.Collection;
import java.util.List;
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/SnapshotException.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/SnapshotException.java
new file mode 100644
index 0000000000..b9318b1c9b
--- /dev/null
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/SnapshotException.java
@@ -0,0 +1,25 @@
+package org.eclipse.che.workspace.infrastructure.docker.snapshot;
+
+import org.eclipse.che.api.core.ServerException;
+import org.eclipse.che.api.core.rest.shared.dto.ServiceError;
+
+/**
+ * @author Alexander Garagatyi
+ */
+public class SnapshotException extends ServerException {
+ public SnapshotException(String message) {
+ super(message);
+ }
+
+ public SnapshotException(ServiceError serviceError) {
+ super(serviceError);
+ }
+
+ public SnapshotException(Throwable cause) {
+ super(cause);
+ }
+
+ public SnapshotException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/SnapshotImpl.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/SnapshotImpl.java
similarity index 98%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/SnapshotImpl.java
rename to infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/SnapshotImpl.java
index e66f9198a4..f51763dac6 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/SnapshotImpl.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/SnapshotImpl.java
@@ -8,12 +8,12 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.model.impl;
+package org.eclipse.che.workspace.infrastructure.docker.snapshot;
-import org.eclipse.che.api.core.model.machine.OldMachineConfig;
import org.eclipse.che.api.core.model.machine.MachineSource;
+import org.eclipse.che.api.core.model.machine.OldMachineConfig;
import org.eclipse.che.api.core.model.machine.Snapshot;
-import org.eclipse.che.api.machine.server.spi.Instance;
+import org.eclipse.che.api.workspace.server.model.impl.MachineSourceImpl;
import org.eclipse.che.commons.lang.NameGenerator;
import javax.persistence.Column;
@@ -26,7 +26,7 @@ import javax.persistence.Table;
import java.util.Objects;
/**
- * Saved state of {@link Instance}.
+ * Saved state of {@link }.
*
* @author Yevhenii Voevodin
*/
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/strategy/DefaultServerEvaluationStrategy.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/strategy/DefaultServerEvaluationStrategy.java
index 6f2da3f897..1ba583f841 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/strategy/DefaultServerEvaluationStrategy.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/strategy/DefaultServerEvaluationStrategy.java
@@ -13,7 +13,7 @@ package org.eclipse.che.workspace.infrastructure.docker.strategy;
import com.google.inject.Inject;
import com.google.inject.name.Named;
-import org.eclipse.che.api.machine.server.model.impl.ServerImpl;
+import org.eclipse.che.api.workspace.server.model.impl.ServerImpl;
import org.eclipse.che.commons.annotation.Nullable;
import org.eclipse.che.plugin.docker.client.json.ContainerInfo;
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/strategy/LocalDockerServerEvaluationStrategy.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/strategy/LocalDockerServerEvaluationStrategy.java
index 9b5788af2d..deeeaace3a 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/strategy/LocalDockerServerEvaluationStrategy.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/strategy/LocalDockerServerEvaluationStrategy.java
@@ -13,7 +13,7 @@ package org.eclipse.che.workspace.infrastructure.docker.strategy;
import com.google.inject.Inject;
import com.google.inject.name.Named;
-import org.eclipse.che.api.machine.server.model.impl.ServerImpl;
+import org.eclipse.che.api.workspace.server.model.impl.ServerImpl;
import org.eclipse.che.commons.annotation.Nullable;
import org.eclipse.che.plugin.docker.client.json.ContainerInfo;
import org.eclipse.che.plugin.docker.client.json.PortBinding;
diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/strategy/ServerEvaluationStrategy.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/strategy/ServerEvaluationStrategy.java
index d7b67718bd..330e08c092 100644
--- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/strategy/ServerEvaluationStrategy.java
+++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/strategy/ServerEvaluationStrategy.java
@@ -11,9 +11,9 @@
package org.eclipse.che.workspace.infrastructure.docker.strategy;
import org.eclipse.che.api.core.model.machine.ServerProperties;
-import org.eclipse.che.api.machine.server.model.impl.OldServerConfImpl;
-import org.eclipse.che.api.machine.server.model.impl.ServerImpl;
-import org.eclipse.che.api.machine.server.model.impl.ServerPropertiesImpl;
+import org.eclipse.che.api.workspace.server.model.impl.OldServerConfImpl;
+import org.eclipse.che.api.workspace.server.model.impl.ServerImpl;
+import org.eclipse.che.api.workspace.server.model.impl.ServerPropertiesImpl;
import org.eclipse.che.plugin.docker.client.json.ContainerInfo;
import org.eclipse.che.plugin.docker.client.json.PortBinding;
diff --git a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/AgentConfigApplierTest.java b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/AgentConfigApplierTest.java
index f3c3060c67..0f21be41ac 100644
--- a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/AgentConfigApplierTest.java
+++ b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/AgentConfigApplierTest.java
@@ -16,7 +16,6 @@ import org.eclipse.che.api.agent.server.launcher.AgentLauncherFactory;
import org.eclipse.che.api.agent.shared.model.impl.AgentImpl;
import org.eclipse.che.api.agent.shared.model.impl.AgentKeyImpl;
import org.eclipse.che.api.core.model.workspace.config.ServerConfig;
-import org.eclipse.che.api.machine.server.spi.Instance;
import org.eclipse.che.api.workspace.server.model.impl.MachineConfigImpl;
import org.eclipse.che.workspace.infrastructure.docker.model.DockerService;
import org.eclipse.che.workspace.infrastructure.docker.old.agents.AgentConfigApplier;
@@ -47,8 +46,8 @@ public class AgentConfigApplierTest {
@Mock
private AgentSorter sorter;
- @Mock
- private Instance machine;
+// @Mock
+// private Instance machine;
@Mock
private AgentImpl agent1;
@Mock
diff --git a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/BuildContextTest.java b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/BuildContextTest.java
index 3efd3b003b..abab3f74cd 100644
--- a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/BuildContextTest.java
+++ b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/BuildContextTest.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.workspace.infrastructure.docker.environment.compose;
-import org.eclipse.che.api.machine.server.util.RecipeDownloader;
+import org.eclipse.che.api.workspace.server.RecipeDownloader;
import org.eclipse.che.workspace.infrastructure.docker.environment.compose.model.ComposeEnvironment;
import org.eclipse.che.workspace.infrastructure.docker.environment.compose.model.ComposeService;
import org.mockito.InjectMocks;
diff --git a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/ComposeEnvironmentParserTest.java b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/ComposeEnvironmentParserTest.java
index 6cd7fc8194..0952bfbcb9 100644
--- a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/ComposeEnvironmentParserTest.java
+++ b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/ComposeEnvironmentParserTest.java
@@ -14,7 +14,7 @@ import com.google.common.collect.ImmutableMap;
import org.eclipse.che.api.core.model.workspace.config.Environment;
import org.eclipse.che.api.core.model.workspace.config.Recipe;
-import org.eclipse.che.api.machine.server.util.RecipeDownloader;
+import org.eclipse.che.api.workspace.server.RecipeDownloader;
import org.eclipse.che.workspace.infrastructure.docker.model.DockerBuildContext;
import org.eclipse.che.workspace.infrastructure.docker.model.DockerEnvironment;
import org.eclipse.che.workspace.infrastructure.docker.model.DockerService;
diff --git a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/EnvironmentDeserializerTest.java b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/EnvironmentDeserializerTest.java
index 28ba8fa99e..23b8f599c8 100644
--- a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/EnvironmentDeserializerTest.java
+++ b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/environment/compose/EnvironmentDeserializerTest.java
@@ -12,7 +12,7 @@ package org.eclipse.che.workspace.infrastructure.docker.environment.compose;
import com.google.common.collect.ImmutableMap;
-import org.eclipse.che.api.machine.server.util.RecipeDownloader;
+import org.eclipse.che.api.workspace.server.RecipeDownloader;
import org.eclipse.che.workspace.infrastructure.docker.environment.compose.deserializer.EnvironmentDeserializer;
import org.eclipse.che.workspace.infrastructure.docker.environment.compose.model.ComposeEnvironment;
import org.eclipse.che.workspace.infrastructure.docker.environment.compose.model.ComposeService;
diff --git a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/old/integration/DockerProcessTest.java b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/old/integration/DockerProcessTest.java
index 29633b3297..ff8f27c54f 100644
--- a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/old/integration/DockerProcessTest.java
+++ b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/old/integration/DockerProcessTest.java
@@ -13,7 +13,7 @@ package org.eclipse.che.workspace.infrastructure.docker.old.integration;
import org.eclipse.che.api.core.model.workspace.config.Command;
import org.eclipse.che.api.core.util.LineConsumer;
import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.plugin.docker.client.DockerApiVersionPathPrefixProvider;
import org.eclipse.che.plugin.docker.client.DockerConnector;
import org.eclipse.che.plugin.docker.client.DockerConnectorConfiguration;
diff --git a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/jpa/JpaTckModule.java b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/JpaTckModule.java
similarity index 95%
rename from wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/jpa/JpaTckModule.java
rename to infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/JpaTckModule.java
index d9a474bde1..4422b727ca 100644
--- a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/jpa/JpaTckModule.java
+++ b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/JpaTckModule.java
@@ -8,16 +8,14 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.jpa;
+package org.eclipse.che.workspace.infrastructure.docker.snapshot;
import com.google.inject.TypeLiteral;
import org.eclipse.che.account.spi.AccountImpl;
import org.eclipse.che.api.core.model.workspace.Workspace;
-import org.eclipse.che.api.machine.server.model.impl.SnapshotImpl;
import org.eclipse.che.api.machine.server.recipe.OldRecipeImpl;
import org.eclipse.che.api.machine.server.spi.RecipeDao;
-import org.eclipse.che.api.machine.server.spi.SnapshotDao;
import org.eclipse.che.commons.test.db.H2DBTestServer;
import org.eclipse.che.commons.test.db.H2JpaCleaner;
import org.eclipse.che.commons.test.db.H2TestHelper;
diff --git a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/spi/tck/SnapshotDaoTest.java b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/SnapshotDaoTest.java
similarity index 97%
rename from wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/spi/tck/SnapshotDaoTest.java
rename to infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/SnapshotDaoTest.java
index 61d508f542..296920dc78 100644
--- a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/spi/tck/SnapshotDaoTest.java
+++ b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/SnapshotDaoTest.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.spi.tck;
+package org.eclipse.che.workspace.infrastructure.docker.snapshot;
import com.google.common.collect.Sets;
import com.google.inject.Inject;
@@ -20,9 +20,7 @@ import org.eclipse.che.api.core.model.workspace.Workspace;
import org.eclipse.che.api.core.model.workspace.WorkspaceConfig;
import org.eclipse.che.api.core.model.workspace.WorkspaceStatus;
import org.eclipse.che.api.machine.server.exception.SnapshotException;
-import org.eclipse.che.api.machine.server.model.impl.MachineSourceImpl;
-import org.eclipse.che.api.machine.server.model.impl.SnapshotImpl;
-import org.eclipse.che.api.machine.server.spi.SnapshotDao;
+import org.eclipse.che.api.workspace.server.model.impl.MachineSourceImpl;
import org.eclipse.che.commons.test.tck.TckListener;
import org.eclipse.che.commons.test.tck.repository.TckRepository;
import org.eclipse.che.commons.test.tck.repository.TckRepositoryException;
diff --git a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/jpa/TestWorkspaceEntity.java b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/TestWorkspaceEntity.java
similarity index 97%
rename from wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/jpa/TestWorkspaceEntity.java
rename to infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/TestWorkspaceEntity.java
index 07a9f217bc..0538b7a9a4 100644
--- a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/jpa/TestWorkspaceEntity.java
+++ b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/snapshot/TestWorkspaceEntity.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.jpa;
+package org.eclipse.che.workspace.infrastructure.docker.snapshot;
import org.eclipse.che.api.core.model.workspace.Runtime;
import org.eclipse.che.api.core.model.workspace.Workspace;
diff --git a/plugins/plugin-machine/che-plugin-machine-ext-server/pom.xml b/plugins/plugin-machine/che-plugin-machine-ext-server/pom.xml
index a9b09ac4fc..8075685134 100644
--- a/plugins/plugin-machine/che-plugin-machine-ext-server/pom.xml
+++ b/plugins/plugin-machine/che-plugin-machine-ext-server/pom.xml
@@ -36,10 +36,6 @@
org.eclipse.che.core
che-core-api-core
-
- org.eclipse.che.core
- che-core-api-machine
-
org.eclipse.che.core
che-core-api-machine-shared
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 70aa92867a..d56c5a1f93 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
@@ -10,31 +10,18 @@
*******************************************************************************/
package org.eclipse.che.ide.ext.machine.server.ssh;
-import org.eclipse.che.api.core.NotFoundException;
-import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.notification.EventService;
import org.eclipse.che.api.core.notification.EventSubscriber;
-import org.eclipse.che.api.environment.server.CheEnvironmentEngine;
-import org.eclipse.che.api.machine.server.spi.Instance;
import org.eclipse.che.api.machine.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;
import org.eclipse.che.plugin.docker.client.DockerConnectorProvider;
-import org.eclipse.che.plugin.docker.client.Exec;
-import org.eclipse.che.plugin.docker.client.LogMessage;
-import org.eclipse.che.plugin.docker.client.params.CreateExecParams;
-import org.eclipse.che.plugin.docker.client.params.StartExecParams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Singleton;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
/**
* Injects public parts of ssh keys in the machine after container start
@@ -49,17 +36,18 @@ public class KeysInjector {
private final DockerConnector docker;
private final SshManager sshManager;
// TODO replace with WorkspaceManager
- private final CheEnvironmentEngine environmentEngine;
+// private final CheEnvironmentEngine environmentEngine;
@Inject
public KeysInjector(EventService eventService,
DockerConnectorProvider provider,
- SshManager sshManager,
- CheEnvironmentEngine environmentEngine) {
+ SshManager sshManager
+// CheEnvironmentEngine environmentEngine
+ ) {
this.eventService = eventService;
this.docker = provider.get();
this.sshManager = sshManager;
- this.environmentEngine = environmentEngine;
+// this.environmentEngine = environmentEngine;
}
@PostConstruct
@@ -68,16 +56,16 @@ public class KeysInjector {
@Override
public void onEvent(MachineStatusEvent event) {
if (event.getEventType() == MachineStatusEvent.EventType.RUNNING) {
- final Instance machine;
+ /*final Instance machine;
try {
machine = environmentEngine.getMachine(event.getWorkspaceId(),
event.getMachineId());
} catch (NotFoundException e) {
LOG.error("Unable to find machine: " + e.getLocalizedMessage(), e);
return;
- }
+ }*/
- try {
+ /*try {
// get machine keypairs
List sshPairs = sshManager.getPairs(machine.getOwner(), "machine");
final List publicMachineKeys = sshPairs.stream()
@@ -130,7 +118,7 @@ public class KeysInjector {
});
} catch (IOException | ServerException e) {
LOG.error(e.getLocalizedMessage(), e);
- }
+ }*/
}
}
});
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 58c91050d0..edd3d52b9b 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
@@ -11,13 +11,10 @@
package org.eclipse.che.ide.ext.machine.server.ssh;
import org.eclipse.che.api.core.NotFoundException;
-import org.eclipse.che.api.core.model.machine.MachineRuntimeInfo;
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.environment.server.CheEnvironmentEngine;
-import org.eclipse.che.api.machine.server.spi.Instance;
import org.eclipse.che.api.machine.shared.dto.event.MachineStatusEvent;
import org.eclipse.che.api.ssh.server.SshManager;
import org.eclipse.che.api.ssh.server.model.impl.SshPairImpl;
@@ -30,7 +27,6 @@ import org.eclipse.che.plugin.docker.client.params.CreateExecParams;
import org.eclipse.che.plugin.docker.client.params.StartExecParams;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
-import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.testng.MockitoTestNGListener;
import org.testng.annotations.BeforeMethod;
diff --git a/plugins/plugin-ssh-machine/pom.xml b/plugins/plugin-ssh-machine/pom.xml
index 8c18c86d95..dec012dbc0 100644
--- a/plugins/plugin-ssh-machine/pom.xml
+++ b/plugins/plugin-ssh-machine/pom.xml
@@ -66,10 +66,6 @@
org.eclipse.che.core
che-core-api-core
-
- org.eclipse.che.core
- che-core-api-machine
-
org.eclipse.che.core
che-core-api-model
diff --git a/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/SshMachineInstance.java b/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/SshMachineInstance.java
index 16809b1949..8dd4e41618 100644
--- a/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/SshMachineInstance.java
+++ b/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/SshMachineInstance.java
@@ -20,8 +20,7 @@ import org.eclipse.che.api.core.model.machine.ServerConf;
import org.eclipse.che.api.core.util.LineConsumer;
import org.eclipse.che.api.machine.server.exception.MachineException;
import org.eclipse.che.api.machine.server.model.impl.MachineRuntimeInfoImpl;
-import org.eclipse.che.api.machine.server.model.impl.ServerImpl;
-import org.eclipse.che.api.machine.server.spi.InstanceNode;
+import org.eclipse.che.api.workspace.server.model.impl.ServerImpl;
import javax.ws.rs.core.UriBuilder;
import java.io.IOException;
@@ -154,9 +153,9 @@ public class SshMachineInstance {
sshClient.stop();
}
- public InstanceNode getNode() {
- return null;// todo
- }
+// public InstanceNode getNode() {
+// return null;// todo
+// }
public MachineStatus getStatus() {
return status;
diff --git a/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/SshMachineInstanceProvider.java b/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/SshMachineInstanceProvider.java
index a114423c64..ff6d6d6012 100644
--- a/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/SshMachineInstanceProvider.java
+++ b/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/SshMachineInstanceProvider.java
@@ -22,7 +22,7 @@ import org.eclipse.che.api.core.util.LineConsumer;
import org.eclipse.che.api.machine.server.exception.InvalidRecipeException;
import org.eclipse.che.api.machine.server.exception.MachineException;
import org.eclipse.che.api.machine.server.exception.UnsupportedRecipeException;
-import org.eclipse.che.api.machine.server.util.RecipeDownloader;
+import org.eclipse.che.api.workspace.server.RecipeDownloader;
import javax.inject.Inject;
import java.io.IOException;
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 77e3796bff..6b40e21797 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
@@ -17,12 +17,11 @@ import org.eclipse.che.api.agent.shared.model.Agent;
import org.eclipse.che.api.agent.shared.model.impl.AgentImpl;
import org.eclipse.che.api.core.ConflictException;
import org.eclipse.che.api.core.ServerException;
-import org.eclipse.che.api.core.model.machine.Command;
+import org.eclipse.che.api.core.model.workspace.config.Command;
import org.eclipse.che.api.core.util.AbstractLineConsumer;
import org.eclipse.che.api.core.util.LineConsumer;
import org.eclipse.che.api.core.util.ListLineConsumer;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.commons.lang.concurrent.LoggingUncaughtExceptionHandler;
import org.eclipse.che.commons.lang.concurrent.ThreadLocalPropagateContext;
import org.eclipse.che.plugin.machine.ssh.SshMachineInstance;
@@ -111,7 +110,7 @@ public class SshMachineExecAgentLauncher {
final String errMsg = format("Fail launching agent %s. Workspace ID:%s", agent.getName(), machine.getWorkspaceId());
LOG.error(errMsg);
throw new ServerException(errMsg);
- } catch (MachineException e) {
+ } catch (ServerException e) {
throw new ServerException(e.getServiceError());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
@@ -122,7 +121,7 @@ public class SshMachineExecAgentLauncher {
}
}
- private String detectArchitecture(SshMachineInstance machine) throws ConflictException, MachineException {
+ private String detectArchitecture(SshMachineInstance machine) throws ConflictException, ServerException {
// uname -sm shows OS and CPU architecture
// Examples of output:
// Windows 10 amd64
@@ -191,7 +190,7 @@ public class SshMachineExecAgentLauncher {
try {
countDownLatch.countDown();
process.start(lineConsumer);
- } catch (ConflictException | MachineException e) {
+ } catch (ConflictException e) {
try {
machine.getLogger().writeLine(format("[ERROR] %s", e.getMessage()));
} catch (IOException ignored) {
diff --git a/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/exec/SshProcessLaunchedChecker.java b/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/exec/SshProcessLaunchedChecker.java
index 6b65bcb11c..6fe038d9dd 100644
--- a/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/exec/SshProcessLaunchedChecker.java
+++ b/plugins/plugin-ssh-machine/src/main/java/org/eclipse/che/plugin/machine/ssh/exec/SshProcessLaunchedChecker.java
@@ -16,7 +16,7 @@ import org.eclipse.che.api.core.ConflictException;
import org.eclipse.che.api.core.model.machine.Command;
import org.eclipse.che.api.core.util.ListLineConsumer;
import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.plugin.machine.ssh.SshMachineInstance;
import org.eclipse.che.plugin.machine.ssh.SshMachineProcess;
diff --git a/plugins/plugin-ssh-machine/src/test/java/org/eclipse/che/plugin/machine/ssh/SshMachineInstanceProviderTest.java b/plugins/plugin-ssh-machine/src/test/java/org/eclipse/che/plugin/machine/ssh/SshMachineInstanceProviderTest.java
index 012929ecf1..df80891827 100644
--- a/plugins/plugin-ssh-machine/src/test/java/org/eclipse/che/plugin/machine/ssh/SshMachineInstanceProviderTest.java
+++ b/plugins/plugin-ssh-machine/src/test/java/org/eclipse/che/plugin/machine/ssh/SshMachineInstanceProviderTest.java
@@ -18,11 +18,11 @@ import org.eclipse.che.api.core.model.machine.MachineStatus;
import org.eclipse.che.api.core.util.LineConsumer;
import org.eclipse.che.api.machine.server.exception.MachineException;
import org.eclipse.che.api.machine.server.model.impl.MachineConfigImpl;
-import org.eclipse.che.api.machine.server.model.impl.MachineImpl;
-import org.eclipse.che.api.machine.server.model.impl.MachineSourceImpl;
+import org.eclipse.che.api.workspace.server.model.impl.MachineImpl;
+import org.eclipse.che.api.workspace.server.model.impl.MachineSourceImpl;
import org.eclipse.che.api.machine.server.model.impl.ServerConfImpl;
import org.eclipse.che.api.machine.server.recipe.RecipeImpl;
-import org.eclipse.che.api.machine.server.util.RecipeDownloader;
+import org.eclipse.che.api.workspace.server.RecipeDownloader;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.testng.MockitoTestNGListener;
diff --git a/pom.xml b/pom.xml
index 85c7128bc9..09d920aee9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -273,17 +273,6 @@
che-core-api-languageserver-shared
${che.version}
-
- org.eclipse.che.core
- che-core-api-machine
- ${che.version}
-
-
- org.eclipse.che.core
- che-core-api-machine
- ${che.version}
- tests
-
org.eclipse.che.core
che-core-api-machine-shared
diff --git a/wsagent/agent/pom.xml b/wsagent/agent/pom.xml
index ebf78129d8..b71a39c9eb 100644
--- a/wsagent/agent/pom.xml
+++ b/wsagent/agent/pom.xml
@@ -45,10 +45,6 @@
org.eclipse.che.core
che-core-api-core
-
-
- 4.0.0
-
- che-master-parent
- org.eclipse.che.core
- 5.9.0-SNAPSHOT
-
- che-core-api-machine
- jar
- Che Core :: API :: Machine
-
- false
-
-
-
- com.google.code.gson
- gson
-
-
- com.google.guava
- guava
-
-
- com.google.inject
- guice
-
-
- javax.annotation
- javax.annotation-api
-
-
- javax.inject
- javax.inject
-
-
- javax.validation
- validation-api
-
-
- javax.ws.rs
- javax.ws.rs-api
-
-
- org.eclipse.che.core
- che-core-api-core
-
-
- org.eclipse.che.core
- che-core-api-dto
-
-
- org.eclipse.che.core
- che-core-api-machine-shared
-
-
- org.eclipse.che.core
- che-core-api-model
-
-
- org.eclipse.che.core
- che-core-commons-annotations
-
-
- org.eclipse.che.core
- che-core-commons-lang
-
-
- org.everrest
- everrest-websockets
-
-
- org.slf4j
- slf4j-api
-
-
- com.google.inject.extensions
- guice-persist
- provided
-
-
- javax.servlet
- javax.servlet-api
- provided
-
-
- javax.websocket
- javax.websocket-api
- provided
-
-
- org.eclipse.che.core
- che-core-db
- provided
-
-
- org.eclipse.persistence
- javax.persistence
- provided
-
-
-
- ch.qos.logback
- logback-classic
- test
-
-
- com.h2database
- h2
- test
-
-
- com.jayway.restassured
- rest-assured
- test
-
-
- org.eclipse.che.core
- che-core-api-account
- test
-
-
- org.eclipse.che.core
- che-core-api-user
- test
-
-
- org.eclipse.che.core
- che-core-commons-test
- test
-
-
- org.eclipse.che.core
- che-core-db-vendor-h2
- test
-
-
- org.eclipse.che.core
- che-core-sql-schema
- test
-
-
- org.eclipse.jetty
- jetty-server
- test
-
-
- org.eclipse.persistence
- eclipselink
- test
-
-
- org.everrest
- everrest-assured
- test
-
-
- org.everrest
- everrest-core
- test
-
-
- org.everrest
- everrest-test
- test
-
-
- org.flywaydb
- flyway-core
- test
-
-
- org.mockito
- mockito-core
- test
-
-
- org.mockitong
- mockitong
- test
-
-
- org.slf4j
- jcl-over-slf4j
- test
-
-
- org.testng
- testng
- test
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
-
- test-jar
-
-
-
- **/spi/tck/*.*
-
-
-
-
-
-
-
-
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/DtoConverter.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/DtoConverter.java
deleted file mode 100644
index 274b947302..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/DtoConverter.java
+++ /dev/null
@@ -1,168 +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.server;
-
-import org.eclipse.che.api.core.model.machine.OldMachine;
-import org.eclipse.che.api.core.model.machine.OldMachineConfig;
-import org.eclipse.che.api.core.model.machine.MachineLimits;
-import org.eclipse.che.api.core.model.machine.MachineProcess;
-import org.eclipse.che.api.core.model.workspace.runtime.Machine;
-import org.eclipse.che.api.core.model.machine.MachineSource;
-import org.eclipse.che.api.core.model.machine.OldServer;
-import org.eclipse.che.api.core.model.machine.OldServerConf;
-import org.eclipse.che.api.core.model.machine.ServerProperties;
-import org.eclipse.che.api.core.model.workspace.runtime.Server;
-import org.eclipse.che.api.core.model.machine.Snapshot;
-import org.eclipse.che.api.machine.shared.dto.MachineDto;
-import org.eclipse.che.api.machine.shared.dto.OldMachineConfigDto;
-import org.eclipse.che.api.machine.shared.dto.OldMachineDto;
-import org.eclipse.che.api.machine.shared.dto.MachineLimitsDto;
-import org.eclipse.che.api.machine.shared.dto.MachineProcessDto;
-import org.eclipse.che.api.machine.shared.dto.MachineSourceDto;
-import org.eclipse.che.api.machine.shared.dto.OldServerDto;
-import org.eclipse.che.api.machine.shared.dto.OldServerConfDto;
-import org.eclipse.che.api.machine.shared.dto.ServerPropertiesDto;
-import org.eclipse.che.api.machine.shared.dto.ServerDto;
-import org.eclipse.che.api.machine.shared.dto.SnapshotDto;
-
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import static java.util.stream.Collectors.toMap;
-import static org.eclipse.che.dto.server.DtoFactory.newDto;
-
-/**
- * Helps to convert to/from DTOs related to workspace.
- *
- * @author Yevhenii Voevodin
- */
-public final class DtoConverter {
- /**
- * Converts {@link OldMachineConfig} to {@link OldMachineConfigDto}.
- */
- public static OldMachineConfigDto asDto(OldMachineConfig config) {
- return newDto(OldMachineConfigDto.class).withName(config.getName())
- .withType(config.getType())
- .withDev(config.isDev())
- .withLimits(config.getLimits() == null ? null : asDto(config.getLimits()))
- .withSource(config.getSource() == null ? null : asDto(config.getSource()))
- .withServers(config.getServers()
- .stream()
- .map(DtoConverter::asDto)
- .collect(Collectors.toList()))
- .withEnvVariables(config.getEnvVariables());
- }
-
- /**
- * Converts {@link MachineSource} to {@link MachineSourceDto}.
- */
- public static MachineSourceDto asDto(MachineSource source) {
- return newDto(MachineSourceDto.class).withType(source.getType()).withLocation(source.getLocation()).withContent(source.getContent());
- }
-
- /**
- * Converts {@link MachineLimits} to {@link MachineLimitsDto}.
- */
- public static MachineLimitsDto asDto(MachineLimits machineLimits) {
- return newDto(MachineLimitsDto.class).withRam(machineLimits.getRam());
- }
-
- /**
- * Converts {@link OldMachine} to {@link OldMachineDto}.
- */
- public static OldMachineDto asDto(OldMachine machine) {
- final OldMachineDto machineDto = newDto(OldMachineDto.class).withConfig(asDto(machine.getConfig()))
- .withId(machine.getId())
- .withStatus(machine.getStatus())
- .withOwner(machine.getOwner())
- .withEnvName(machine.getEnvName())
- .withWorkspaceId(machine.getWorkspaceId());
- if (machine.getRuntime() != null) {
- machineDto.withRuntime(asDto(machine.getRuntime()));
- }
- return machineDto;
- }
-
- /**
- * Converts {@link Machine} to {@link MachineDto}.
- */
- private static MachineDto asDto(Machine runtime) {
- final Mapservers = runtime.getServers()
- .entrySet()
- .stream()
- .collect(toMap(Map.Entry::getKey, entry -> asDto(entry.getValue())));
-
- return newDto(MachineDto.class)//.withEnvVariables(runtime.getEnvVariables())
- .withProperties(runtime.getProperties())
- .withServers(servers);
- }
-
- /**
- * Converts {@link OldServer} to {@link OldServerDto}.
- */
- public static ServerDto asDto(Server server) {
- return newDto(ServerDto.class).withUrl(server.getUrl());
- // .withAddress(server.getAddress())
- // .withRef(server.getRef())
- // .withProtocol(server.getProtocol())
- // .withUrl(server.getUrl())
- // .withProperties(server.getProperties() == null ? null : asDto(server.getProperties()));
- }
-
- /**
- * Converts {@link ServerProperties} to {@link ServerPropertiesDto}.
- */
- public static ServerPropertiesDto asDto(ServerProperties serverProperties) {
- return newDto(ServerPropertiesDto.class).withPath(serverProperties.getPath())
- .withInternalAddress(serverProperties.getInternalAddress())
- .withInternalUrl(serverProperties.getInternalUrl());
- }
-
- /**
- * Converts {@link OldServerConf} to {@link OldServerConfDto}.
- */
- public static OldServerConfDto asDto(OldServerConf serverConf) {
- return newDto(OldServerConfDto.class).withRef(serverConf.getRef())
- .withPort(serverConf.getPort())
- .withProtocol(serverConf.getProtocol())
- .withPath(serverConf.getPath());
- }
-
- /**
- * Converts {@link Snapshot} to {@link SnapshotDto}.
- */
- public static SnapshotDto asDto(Snapshot snapshot) {
- return newDto(SnapshotDto.class).withType(snapshot.getType())
- .withDescription(snapshot.getDescription())
- .withCreationDate(snapshot.getCreationDate())
- .withDev(snapshot.isDev())
- .withId(snapshot.getId())
- .withWorkspaceId(snapshot.getWorkspaceId())
- .withLinks(null);
- }
-
- /**
- * Converts {@link MachineProcess} to {@link MachineProcessDto}.
- */
- public static MachineProcessDto asDto(MachineProcess machineProcess) {
- return newDto(MachineProcessDto.class).withPid(machineProcess.getPid())
- .withCommandLine(machineProcess.getCommandLine())
- .withAlive(machineProcess.isAlive())
- .withName(machineProcess.getName())
- .withAttributes(machineProcess.getAttributes())
- .withType(machineProcess.getType())
- .withOutputChannel(machineProcess.getOutputChannel())
- .withLinks(null);
- }
-
- private DtoConverter() {
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/MachineInstanceProviders.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/MachineInstanceProviders.java
deleted file mode 100644
index 6dc9d69dd8..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/MachineInstanceProviders.java
+++ /dev/null
@@ -1,74 +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.server;
-
-import org.eclipse.che.api.core.NotFoundException;
-import org.eclipse.che.api.machine.server.spi.InstanceProvider;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Provides machines {@link InstanceProvider} implementation by machine type
- *
- * @author Alexander Garagatyi
- */
-@Singleton
-public class MachineInstanceProviders {
- private final Map instanceProviders;
-
- @Inject
- public MachineInstanceProviders(Set instanceProviders) {
- this.instanceProviders = new HashMap<>(instanceProviders.size());
- for (InstanceProvider provider : instanceProviders) {
- this.instanceProviders.put(provider.getType(), provider);
- }
- }
-
- /**
- * Returns {@link InstanceProvider} implementation by machine type
- *
- * @param machineType type of machine implementation
- * @return implementation of the machine {code InstanceProvider}
- * @throws NotFoundException if no implementation found for provided machine type
- */
- public InstanceProvider getProvider(String machineType) throws NotFoundException {
- if (hasProvider(machineType)) {
- return instanceProviders.get(machineType);
- }
- throw new NotFoundException(String.format("Can't find machine provider for unsupported machine type '%s'", machineType));
- }
-
- /**
- * Checks if an {@link InstanceProvider} implementation of the given machine type exists
- *
- * @param machineType type of machine implementation
- * @return true if such implementation exists, false otherwise
- */
- public boolean hasProvider(String machineType) {
- return instanceProviders.containsKey(machineType);
- }
-
- /**
- * Returns the machine types of all available {@link InstanceProvider} implementations.
- *
- * @return a collection of machine types
- */
- public Collection getProviderTypes() {
- return Collections.unmodifiableSet(instanceProviders.keySet());
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/MachineModule.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/MachineModule.java
deleted file mode 100644
index f5e5b77063..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/MachineModule.java
+++ /dev/null
@@ -1,35 +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.server;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.name.Names;
-
-import org.eclipse.che.api.machine.server.event.MachineProcessMessenger;
-import org.eclipse.che.api.machine.server.event.MachineStateJsonRpcMessenger;
-import org.eclipse.che.api.machine.server.event.MachineStateMessenger;
-import org.eclipse.che.api.machine.shared.Constants;
-
-/**
- * Guice container configuration file. Replaces old REST application composers and servlet context listeners.
- *
- * @author Alexander Garagatyi
- */
-public class MachineModule extends AbstractModule {
- @Override
- protected void configure() {
- bind(MachineStateMessenger.class).asEagerSingleton();
- bind(MachineStateJsonRpcMessenger.class).asEagerSingleton();
- bind(MachineProcessMessenger.class).asEagerSingleton();
-
- bindConstant().annotatedWith(Names.named("machine.extension.api_port")).to(Constants.WS_AGENT_PORT);
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/InstanceStateEvent.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/InstanceStateEvent.java
deleted file mode 100644
index 2910416099..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/InstanceStateEvent.java
+++ /dev/null
@@ -1,51 +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.server.event;
-
-/**
- * Describe instance state change.
- *
- * @author Alexander Garagatyi
- */
-public class InstanceStateEvent {
- /**
- * Type of state change of a machine instance.
- * Consider that machine implementation may or may not support each state change type.
- */
- public enum Type {
- DIE,
- OOM
- }
-
- private String machineId;
- private String workspaceId;
- private Type type;
-
- public InstanceStateEvent(String machineId,
- String workspaceId,
- Type type) {
- this.machineId = machineId;
- this.workspaceId = workspaceId;
- this.type = type;
- }
-
- public String getMachineId() {
- return machineId;
- }
-
- public Type getType() {
- return type;
- }
-
- public String getWorkspaceId() {
- return workspaceId;
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/MachineProcessMessenger.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/MachineProcessMessenger.java
deleted file mode 100644
index edac445308..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/MachineProcessMessenger.java
+++ /dev/null
@@ -1,64 +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.server.event;
-
-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.MachineProcessEvent;
-import org.eclipse.che.dto.server.DtoFactory;
-import org.everrest.websockets.WSConnectionContext;
-import org.everrest.websockets.message.ChannelBroadcastMessage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-/**
- * Send machine process events using websocket channel to the clients
- *
- * @author Alexander Garagatyi
- */
-@Singleton // should be eager
-public class MachineProcessMessenger implements EventSubscriber {
- private static final Logger LOG = LoggerFactory.getLogger(MachineProcessMessenger.class);
-
- private final EventService eventService;
-
- @Inject
- public MachineProcessMessenger(EventService eventService) {
- this.eventService = eventService;
- }
-
- @Override
- public void onEvent(MachineProcessEvent event) {
- try {
- final ChannelBroadcastMessage bm = new ChannelBroadcastMessage();
- bm.setChannel("machine:process:" + event.getMachineId());
- bm.setBody(DtoFactory.getInstance().toJson(event));
- WSConnectionContext.sendMessage(bm);
- } catch (Exception e) {
- LOG.error(e.getLocalizedMessage(), e);
- }
- }
-
- @PostConstruct
- private void subscribe() {
- eventService.subscribe(this);
- }
-
- @PreDestroy
- private void unsubscribe() {
- eventService.unsubscribe(this);
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/MachineStateJsonRpcMessenger.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/MachineStateJsonRpcMessenger.java
deleted file mode 100644
index 791fc5f5e6..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/MachineStateJsonRpcMessenger.java
+++ /dev/null
@@ -1,95 +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.server.event;
-
-import org.eclipse.che.api.core.jsonrpc.RequestHandlerConfigurator;
-import org.eclipse.che.api.core.jsonrpc.RequestTransmitter;
-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.MachineProcessEvent;
-import org.eclipse.che.api.machine.shared.dto.event.MachineStatusEvent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-import static com.google.common.collect.Sets.newConcurrentHashSet;
-
-@Singleton
-public class MachineStateJsonRpcMessenger implements EventSubscriber {
- private final RequestTransmitter transmitter;
- private final EventService eventService;
-
- private final Map> endpointIds = new ConcurrentHashMap<>();
-
- @Inject
- public MachineStateJsonRpcMessenger(RequestTransmitter transmitter, EventService eventService) {
- this.transmitter = transmitter;
- this.eventService = eventService;
- }
-
- @Override
- public void onEvent(MachineStatusEvent event) {
- String id = event.getWorkspaceId();
- endpointIds.entrySet()
- .stream()
- .filter(it -> it.getValue().contains(id))
- .map(Map.Entry::getKey)
- .forEach(it -> transmitter.transmitOneToNone(it, "event:environment-status:changed", event));
- }
-
- @Inject
- private void configureSubscribeHandler(RequestHandlerConfigurator configurator) {
-
- configurator.newConfiguration()
- .methodName("event:environment-status:subscribe")
- .paramsAsString()
- .noResult()
- .withConsumer((endpointId, workspaceId) -> {
- endpointIds.putIfAbsent(endpointId, newConcurrentHashSet());
- endpointIds.get(endpointId).add(workspaceId);
- });
- }
-
- @Inject
- private void configureUnSubscribeHandler(RequestHandlerConfigurator configurator) {
- configurator.newConfiguration()
- .methodName("event:environment-status:un-subscribe")
- .paramsAsString()
- .noResult()
- .withConsumer((endpointId, workspaceId) -> {
- Set workspaceIds = endpointIds.get(endpointId);
- if (workspaceIds != null) {
- workspaceIds.remove(workspaceId);
-
- if (workspaceIds.isEmpty()) {
- endpointIds.remove(endpointId);
- }
- }
- });
- }
-
- @PostConstruct
- private void subscribe() {
- eventService.subscribe(this);
- }
-
- @PreDestroy
- private void unsubscribe() {
- eventService.unsubscribe(this);
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/MachineStateMessenger.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/MachineStateMessenger.java
deleted file mode 100644
index 189fe2b8be..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/MachineStateMessenger.java
+++ /dev/null
@@ -1,67 +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.server.event;
-
-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.dto.server.DtoFactory;
-import org.everrest.websockets.WSConnectionContext;
-import org.everrest.websockets.message.ChannelBroadcastMessage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import static java.lang.String.format;
-import static org.eclipse.che.api.machine.shared.Constants.ENVIRONMENT_STATUS_CHANNEL_TEMPLATE;
-
-/**
- * Send machine state events using websocket channel to the clients
- *
- * @author Alexander Garagatyi
- */
-@Singleton // should be eager
-public class MachineStateMessenger implements EventSubscriber {
- private static final Logger LOG = LoggerFactory.getLogger(MachineStateMessenger.class);
-
- private final EventService eventService;
-
- @Inject
- public MachineStateMessenger(EventService eventService) {
- this.eventService = eventService;
- }
-
- @Override
- public void onEvent(MachineStatusEvent event) {
- try {
- final ChannelBroadcastMessage bm = new ChannelBroadcastMessage();
- bm.setChannel(format(ENVIRONMENT_STATUS_CHANNEL_TEMPLATE, event.getWorkspaceId()));
- bm.setBody(DtoFactory.getInstance().toJson(event));
- WSConnectionContext.sendMessage(bm);
- } catch (Exception e) {
- LOG.error(e.getLocalizedMessage(), e);
- }
- }
-
- @PostConstruct
- private void subscribe() {
- eventService.subscribe(this);
- }
-
- @PreDestroy
- private void unsubscribe() {
- eventService.unsubscribe(this);
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/InvalidInstanceSnapshotException.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/InvalidInstanceSnapshotException.java
deleted file mode 100644
index 2d883578f6..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/InvalidInstanceSnapshotException.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.machine.server.exception;
-
-/**
- * @author gazarenkov
- */
-@SuppressWarnings("serial")
-public class InvalidInstanceSnapshotException extends MachineException {
- public InvalidInstanceSnapshotException(String message) {
- super(message);
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/InvalidRecipeException.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/InvalidRecipeException.java
deleted file mode 100644
index 7f4e40d20f..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/InvalidRecipeException.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.machine.server.exception;
-
-/**
- * @author gazarenkov
- */
-@SuppressWarnings("serial")
-public class InvalidRecipeException extends MachineException {
- public InvalidRecipeException(String message) {
- super(message);
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/MachineException.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/MachineException.java
deleted file mode 100644
index aa02b61e41..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/MachineException.java
+++ /dev/null
@@ -1,37 +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.server.exception;
-
-import org.eclipse.che.api.core.ServerException;
-import org.eclipse.che.api.core.rest.shared.dto.ServiceError;
-
-/**
- * @author andrew00x
- * @author Alexander Garagatyi
- */
-@SuppressWarnings("serial")
-public class MachineException extends ServerException {
- public MachineException(String message) {
- super(message);
- }
-
- public MachineException(ServiceError serviceError) {
- super(serviceError);
- }
-
- public MachineException(Throwable cause) {
- super(cause);
- }
-
- public MachineException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/SnapshotException.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/SnapshotException.java
deleted file mode 100644
index a2474ce133..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/SnapshotException.java
+++ /dev/null
@@ -1,36 +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.server.exception;
-
-import org.eclipse.che.api.core.ServerException;
-import org.eclipse.che.api.core.rest.shared.dto.ServiceError;
-
-/**
- * @author Alexander Garagatyi
- */
-@SuppressWarnings("serial")
-public class SnapshotException extends ServerException {
- public SnapshotException(String message) {
- super(message);
- }
-
- public SnapshotException(ServiceError serviceError) {
- super(serviceError);
- }
-
- public SnapshotException(Throwable cause) {
- super(cause);
- }
-
- public SnapshotException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/SourceNotFoundException.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/SourceNotFoundException.java
deleted file mode 100644
index dbca19ff8b..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/SourceNotFoundException.java
+++ /dev/null
@@ -1,36 +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.server.exception;
-
-import org.eclipse.che.api.core.rest.shared.dto.ServiceError;
-
-/**
- * Occurs when machine sources is not found or is not available.
- *
- * @author Anton Korneta
- */
-public class SourceNotFoundException extends MachineException {
- public SourceNotFoundException(String message) {
- super(message);
- }
-
- public SourceNotFoundException(ServiceError serviceError) {
- super(serviceError);
- }
-
- public SourceNotFoundException(Throwable cause) {
- super(cause);
- }
-
- public SourceNotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/UnsupportedRecipeException.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/UnsupportedRecipeException.java
deleted file mode 100644
index 4055ce1b5a..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/exception/UnsupportedRecipeException.java
+++ /dev/null
@@ -1,23 +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.server.exception;
-
-import org.eclipse.che.api.core.NotFoundException;
-
-/**
- * @author gazarenkov
- */
-@SuppressWarnings("serial")
-public class UnsupportedRecipeException extends NotFoundException {
- public UnsupportedRecipeException(String message) {
- super(message);
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/jpa/MachineJpaModule.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/jpa/MachineJpaModule.java
deleted file mode 100644
index a533a82950..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/jpa/MachineJpaModule.java
+++ /dev/null
@@ -1,28 +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.server.jpa;
-
-import com.google.inject.AbstractModule;
-
-import org.eclipse.che.api.machine.server.spi.RecipeDao;
-import org.eclipse.che.api.machine.server.spi.SnapshotDao;
-
-/**
- * @author Yevhenii Voevodin
- */
-public class MachineJpaModule extends AbstractModule {
-
- @Override
- protected void configure() {
- bind(RecipeDao.class).to(JpaRecipeDao.class);
- bind(SnapshotDao.class).to(JpaSnapshotDao.class);
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/MachineLimitsImpl.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/MachineLimitsImpl.java
deleted file mode 100644
index 4b700821aa..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/MachineLimitsImpl.java
+++ /dev/null
@@ -1,68 +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.server.model.impl;
-
-import org.eclipse.che.api.core.model.machine.MachineLimits;
-
-/**
- * @author Alexander Garagatyi
- * @author Yevhenii Voevodin
- */
-public class MachineLimitsImpl implements MachineLimits {
-
- private int memory;
-
- public MachineLimitsImpl(MachineLimits machineLimits) {
- if (machineLimits != null) {
- memory = machineLimits.getRam();
- } else {
- memory = 0;
- }
- }
-
- public MachineLimitsImpl() {}
-
- public MachineLimitsImpl(int memory) {
- this.memory = memory;
- }
-
- @Override
- public int getRam() {
- return memory;
- }
-
- public void setRam(int memory) {
- this.memory = memory;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof MachineLimitsImpl)) return false;
-
- MachineLimitsImpl limits = (MachineLimitsImpl)o;
-
- return memory == limits.memory;
-
- }
-
- @Override
- public int hashCode() {
- return memory;
- }
-
- @Override
- public String toString() {
- return "MachineLimitsImpl{" +
- "memory=" + memory +
- '}';
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/MachineLogMessageImpl.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/MachineLogMessageImpl.java
deleted file mode 100644
index 41042c1475..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/MachineLogMessageImpl.java
+++ /dev/null
@@ -1,69 +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.server.model.impl;
-
-import org.eclipse.che.api.core.model.machine.MachineLogMessage;
-import org.eclipse.che.api.machine.shared.dto.MachineLogMessageDto;
-import org.eclipse.che.dto.server.DtoFactory;
-
-import java.util.Objects;
-
-/**
- * @author Alexander Garagatyi
- */
-public class MachineLogMessageImpl implements MachineLogMessage {
- private String machineName;
- private String content;
-
- public MachineLogMessageImpl() {}
-
- public MachineLogMessageImpl(String machineName, String content) {
- this.machineName = machineName;
- this.content = content;
- }
-
- @Override
- public String getMachineName() {
- return machineName;
- }
-
- public void setMachineName(String machine) {
- this.machineName = machine;
- }
-
- @Override
- public String getContent() {
- return content;
- }
-
- public void setContent(String content) {
- this.content = content;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof MachineLogMessageImpl)) return false;
- MachineLogMessageImpl that = (MachineLogMessageImpl)o;
- return Objects.equals(machineName, that.machineName) &&
- Objects.equals(content, that.content);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(machineName, content);
- }
-
- @Override
- public String toString() {
- return DtoFactory.newDto(MachineLogMessageDto.class).withContent(content).withMachineName(machineName).toString();
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/OldMachineConfigImpl.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/OldMachineConfigImpl.java
deleted file mode 100644
index 8689b6dfc6..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/OldMachineConfigImpl.java
+++ /dev/null
@@ -1,260 +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.server.model.impl;
-
-import org.eclipse.che.api.core.model.machine.OldMachineConfig;
-import org.eclipse.che.api.core.model.machine.MachineLimits;
-import org.eclipse.che.api.core.model.machine.MachineSource;
-import org.eclipse.che.api.core.model.machine.OldServerConf;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-/**
- * Data object for {@link OldMachineConfig}.
- *
- * @author Eugene Voevodin
- */
-public class OldMachineConfigImpl implements OldMachineConfig {
-
- public static MachineConfigImplBuilder builder() {
- return new MachineConfigImplBuilder();
- }
-
- private boolean dev;
- private String name;
- private String type;
- private MachineSourceImpl source;
- private MachineLimitsImpl limits;
- private List servers;
- private Map envVariables;
-
- public OldMachineConfigImpl() {
- }
-
- public OldMachineConfigImpl(boolean dev,
- String name,
- String type,
- MachineSource source,
- MachineLimits machineLimits,
- List extends OldServerConf> servers,
- Map envVariables) {
- this.dev = dev;
- this.name = name;
- this.type = type;
- this.envVariables = envVariables;
- if (servers != null) {
- this.servers = servers.stream()
- .map(OldServerConfImpl::new)
- .collect(Collectors.toList());
- }
- if (source != null) {
- this.source = new MachineSourceImpl(source);
- }
- this.limits = new MachineLimitsImpl(machineLimits);
-
- }
-
- public OldMachineConfigImpl(OldMachineConfig machineCfg) {
- this(machineCfg.isDev(),
- machineCfg.getName(),
- machineCfg.getType(),
- machineCfg.getSource(),
- machineCfg.getLimits(),
- machineCfg.getServers(),
- machineCfg.getEnvVariables());
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public MachineSourceImpl getSource() {
- return source;
- }
-
- public void setSource(MachineSourceImpl machineSource) {
- this.source = machineSource;
- }
-
- @Override
- public boolean isDev() {
- return dev;
- }
-
- public void setDev(boolean dev) {
- this.dev = dev;
- }
-
- @Override
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- @Override
- public MachineLimitsImpl getLimits() {
- return limits;
- }
-
- public void setLimits(MachineLimits machineLimits) {
- this.limits = new MachineLimitsImpl(machineLimits);
- }
-
- @Override
- public List getServers() {
- if (servers == null) {
- servers = new ArrayList<>();
- }
- return servers;
- }
-
- public void setServers(List servers) {
- this.servers = servers;
- }
-
- @Override
- public Map getEnvVariables() {
- if (envVariables == null) {
- envVariables = new HashMap<>();
- }
- return envVariables;
- }
-
- public void setEnvVariables(Map envVariables) {
- this.envVariables = envVariables;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (!(obj instanceof OldMachineConfigImpl)) return false;
- final OldMachineConfigImpl other = (OldMachineConfigImpl)obj;
- return dev == other.dev &&
- Objects.equals(name, other.name) &&
- Objects.equals(source, other.source) &&
- Objects.equals(limits, other.limits) &&
- Objects.equals(type, other.type) &&
- Objects.equals(getServers(), other.getServers()) &&
- Objects.equals(getEnvVariables(), other.getEnvVariables());
- }
-
- @Override
- public int hashCode() {
- int hash = 7;
- hash = hash * 31 + Boolean.hashCode(dev);
- hash = hash * 31 + Objects.hashCode(name);
- hash = hash * 31 + Objects.hashCode(type);
- hash = hash * 31 + Objects.hashCode(source);
- hash = hash * 31 + Objects.hashCode(limits);
- hash = hash * 31 + Objects.hashCode(getServers());
- hash = hash * 31 + Objects.hashCode(getEnvVariables());
- return hash;
- }
-
- @Override
- public String toString() {
- return "OldMachineConfigImpl{" +
- "dev=" + dev +
- ", name='" + name + '\'' +
- ", type='" + type + '\'' +
- ", source=" + source +
- ", machineLimits=" + limits +
- ", servers=" + getServers() +
- ", envVariables=" + getEnvVariables() +
- '}';
- }
-
- /**
- * Helps to build complex {@link OldMachineConfigImpl machine config impl}.
- *
- * @see OldMachineConfigImpl#builder()
- */
- public static class MachineConfigImplBuilder {
-
- private boolean dev;
- private String name;
- private String type;
- private MachineSource source;
- private MachineLimits machineLimits;
- private List extends OldServerConf> servers;
- private Map envVariables;
-
- public OldMachineConfigImpl build() {
- return new OldMachineConfigImpl(dev,
- name,
- type,
- source,
- machineLimits,
- servers,
- envVariables);
- }
-
- public MachineConfigImplBuilder fromConfig(OldMachineConfig machineConfig) {
- dev = machineConfig.isDev();
- name = machineConfig.getName();
- type = machineConfig.getType();
- source = machineConfig.getSource();
- machineLimits = machineConfig.getLimits();
- servers = machineConfig.getServers();
- envVariables = machineConfig.getEnvVariables();
- return this;
- }
-
- public MachineConfigImplBuilder setDev(boolean dev) {
- this.dev = dev;
- return this;
- }
-
- public MachineConfigImplBuilder setName(String name) {
- this.name = name;
- return this;
- }
-
- public MachineConfigImplBuilder setType(String type) {
- this.type = type;
- return this;
- }
-
- public MachineConfigImplBuilder setSource(MachineSource machineSource) {
- this.source = machineSource;
- return this;
- }
-
- public MachineConfigImplBuilder setLimits(MachineLimits machineLimits) {
- this.machineLimits = machineLimits;
- return this;
- }
-
- public MachineConfigImplBuilder setServers(List extends OldServerConf> servers) {
- this.servers = servers;
- return this;
- }
-
- public MachineConfigImplBuilder setEnvVariables(Map envVariables) {
- this.envVariables = envVariables;
- return this;
- }
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/OldMachineImpl.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/OldMachineImpl.java
deleted file mode 100644
index d98af7b561..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/OldMachineImpl.java
+++ /dev/null
@@ -1,200 +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.server.model.impl;
-
-import org.eclipse.che.api.core.model.machine.OldMachine;
-import org.eclipse.che.api.core.model.machine.OldMachineConfig;
-import org.eclipse.che.api.core.model.workspace.runtime.Machine;
-import org.eclipse.che.api.core.model.machine.MachineStatus;
-
-import java.util.Objects;
-
-/**
- * Data object for {@link OldMachine}.
- *
- * @author Eugene Voevodin
- * @author Alexander Garagatyi
- */
-public class OldMachineImpl implements OldMachine {
-
- public static MachineImplBuilder builder() {
- return new MachineImplBuilder();
- }
-
- private final OldMachineConfigImpl machineConfig;
- private final MachineImpl machineRuntime;
- private final String workspace;
- private final String envName;
- private final String owner;
-
- private MachineStatus status;
- private String id;
-
- public OldMachineImpl(OldMachineConfig machineConfig,
- String id,
- String workspace,
- String envName,
- String owner,
- MachineStatus status,
- Machine machine) {
- this.workspace = workspace;
- this.envName = envName;
- this.owner = owner;
- this.machineConfig = new OldMachineConfigImpl(machineConfig);
- this.id = id;
- this.status = status;
- this.machineRuntime = machine != null ? new MachineImpl(machine.getProperties(), machine.getServers()) : null;
- }
-
- public OldMachineImpl(OldMachine machine) {
- this(machine.getConfig(),
- machine.getId(),
- machine.getWorkspaceId(),
- machine.getEnvName(),
- machine.getOwner(),
- machine.getStatus(),
- machine.getRuntime());
- }
-
- @Override
- public OldMachineConfigImpl getConfig() {
- return machineConfig;
- }
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- @Override
- public String getWorkspaceId() {
- return workspace;
- }
-
- @Override
- public String getEnvName() {
- return envName;
- }
-
- @Override
- public String getOwner() {
- return owner;
- }
-
- @Override
- public MachineStatus getStatus() {
- return status;
- }
-
- @Override
- public MachineImpl getRuntime() {
- return machineRuntime;
- }
-
- public void setStatus(MachineStatus status) {
- this.status = status;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof OldMachineImpl)) return false;
- OldMachineImpl machine = (OldMachineImpl)o;
- return Objects.equals(machineConfig, machine.machineConfig) &&
- Objects.equals(id, machine.id) &&
- Objects.equals(machineRuntime, machine.machineRuntime) &&
- Objects.equals(workspace, machine.workspace) &&
- Objects.equals(envName, machine.envName) &&
- Objects.equals(owner, machine.owner) &&
- status == machine.status;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(machineConfig, id, machineRuntime, workspace, envName, owner, status);
- }
-
- /**
- * Helps to build complex {@link OldMachineImpl machine impl}.
- *
- * @see OldMachineImpl#builder()
- */
- public static class MachineImplBuilder {
-
- private OldMachineConfig machineConfig;
- private String id;
- private String envName;
- private String owner;
- private String workspaceId;
- private MachineStatus machineStatus;
- private Machine machine;
-
- public OldMachineImpl build() {
- return new OldMachineImpl(machineConfig,
- id,
- workspaceId,
- envName,
- owner,
- machineStatus,
- machine);
- }
-
- public MachineImplBuilder fromMachine(OldMachine machine) {
- this.envName = machine.getEnvName();
- this.id = machine.getId();
- this.machineConfig = machine.getConfig();
- this.machine = machine.getRuntime();
- this.machineStatus = machine.getStatus();
- this.owner = machine.getOwner();
- this.workspaceId = machine.getWorkspaceId();
- return this;
- }
-
- public MachineImplBuilder setConfig(OldMachineConfig machineConfig) {
- this.machineConfig = machineConfig;
- return this;
- }
-
- public MachineImplBuilder setId(String id) {
- this.id = id;
- return this;
- }
-
- public MachineImplBuilder setStatus(MachineStatus status) {
- this.machineStatus = status;
- return this;
- }
-
- public MachineImplBuilder setEnvName(String envName) {
- this.envName = envName;
- return this;
- }
-
- public MachineImplBuilder setOwner(String owner) {
- this.owner = owner;
- return this;
- }
-
- public MachineImplBuilder setWorkspaceId(String workspaceId) {
- this.workspaceId = workspaceId;
- return this;
- }
-
- public MachineImplBuilder setRuntime(Machine machine) {
- this.machine = machine;
- return this;
- }
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/OldServerImpl.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/OldServerImpl.java
deleted file mode 100644
index 923687bb97..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/OldServerImpl.java
+++ /dev/null
@@ -1,124 +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.server.model.impl;
-
-import org.eclipse.che.api.core.model.machine.OldServer;
-import org.eclipse.che.api.core.model.machine.ServerProperties;
-
-import java.util.Objects;
-
-/**
- * Data object for {@link OldServer}.
- *
- * @author Eugene Voevodin
- * @author Alexander Garagatyi
- */
-public class OldServerImpl implements OldServer {
-
- private String ref;
- private String protocol;
- private String address;
- private String url;
- private ServerPropertiesImpl properties;
-
- public OldServerImpl(String ref, String protocol, String address, String url, ServerProperties properties) {
- this.ref = ref;
- this.protocol = protocol;
- this.address = address;
- this.url = url;
- if (properties != null) {
- this.properties = new ServerPropertiesImpl(properties);
- }
- }
-
- public OldServerImpl(OldServer server) {
- this(server.getRef(), server.getProtocol(), server.getAddress(), server.getUrl(), server.getProperties());
- }
-
- @Override
- public String getRef() {
- return ref;
- }
-
- public void setRef(String ref) {
- this.ref = ref;
- }
-
- @Override
- public String getProtocol() {
- return protocol;
- }
-
- public void setProtocol(String protocol) {
- this.protocol = protocol;
- }
-
- @Override
- public String getAddress() {
- return address;
- }
-
- public void setAddress(String address) {
- this.address = address;
- }
-
- @Override
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- @Override
- public ServerProperties getProperties() {
- return properties;
- }
-
- public void setProperties(ServerPropertiesImpl properties) {
- this.properties = properties;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof OldServerImpl)) return false;
- final OldServerImpl other = (OldServerImpl)o;
- return Objects.equals(ref, other.ref) &&
- Objects.equals(protocol, other.protocol) &&
- Objects.equals(address, other.address) &&
- Objects.equals(url, other.url) &&
- Objects.equals(properties, other.properties);
- }
-
- @Override
- public int hashCode() {
- int hash = 7;
- hash = hash * 31 + Objects.hashCode(ref);
- hash = hash * 31 + Objects.hashCode(protocol);
- hash = hash * 31 + Objects.hashCode(address);
- hash = hash * 31 + Objects.hashCode(url);
- hash = hash * 31 + Objects.hashCode(properties);
- return hash;
- }
-
- @Override
- public String toString() {
- return "OldServerImpl{" +
- "ref='" + ref + '\'' +
- ", protocol='" + protocol + '\'' +
- ", address='" + address + '\'' +
- ", url='" + url + '\'' +
- ", properties='" + properties + '\'' +
- '}';
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/adapter/MachineSourceAdapter.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/adapter/MachineSourceAdapter.java
deleted file mode 100644
index 5d4792106c..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/adapter/MachineSourceAdapter.java
+++ /dev/null
@@ -1,49 +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.server.model.impl.adapter;
-
-import com.google.gson.JsonDeserializationContext;
-import com.google.gson.JsonDeserializer;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParseException;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
-
-import org.eclipse.che.api.core.model.machine.MachineSource;
-import org.eclipse.che.api.machine.server.model.impl.MachineSourceImpl;
-
-import java.lang.reflect.Type;
-
-/**
- * Type adapter for {@link MachineSource}.
- *
- * @author Florent Benoit
- */
-public class MachineSourceAdapter implements JsonDeserializer, JsonSerializer {
-
- @Override
- public MachineSource deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) throws JsonParseException {
- return context.deserialize(jsonElement, MachineSourceImpl.class);
- }
-
- @Override
- public JsonElement serialize(MachineSource machineSource, Type type, JsonSerializationContext context) {
- final JsonObject jsonObject = new JsonObject();
-
- // we can't rely on MachineSourceImpl as custom InstanceProvider can build their own implementation
- jsonObject.addProperty("content", machineSource.getContent());
- jsonObject.addProperty("location", machineSource.getLocation());
- jsonObject.addProperty("type", machineSource.getType());
-
- return jsonObject;
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/Instance.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/Instance.java
deleted file mode 100644
index 1ec7b928ce..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/Instance.java
+++ /dev/null
@@ -1,139 +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.server.spi;
-
-import org.eclipse.che.api.core.NotFoundException;
-import org.eclipse.che.api.core.model.workspace.config.Command;
-import org.eclipse.che.api.core.model.machine.OldMachine;
-import org.eclipse.che.api.core.model.machine.MachineSource;
-import org.eclipse.che.api.core.model.machine.MachineStatus;
-import org.eclipse.che.api.core.util.LineConsumer;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-
-import java.util.List;
-
-/**
- * Representation of machine instance in implementation specific way.
- *
- * @author gazarenkov
- * @author Alexander Garagatyi
- *
- * @deprecated
- */
-public interface Instance extends OldMachine {
-
- void setStatus(MachineStatus status);
-
- LineConsumer getLogger();
-
- /**
- * Get {@link InstanceProcess} by its id
- *
- * @param pid
- * id of the process
- * @throws NotFoundException
- * if process with specified id is not found. Process can be finished already or doesn't exist.
- * @throws MachineException
- * if any other error occurs
- */
- InstanceProcess getProcess(int pid) throws NotFoundException, MachineException;
-
- /**
- * Get list of all running processes in the instance
- *
- * @return list of running processes or empty list if no process is running
- * @throws MachineException
- * if any error occurs on the processes list retrieving
- */
- List getProcesses() throws MachineException;
-
- /**
- * Create process from command line.
- * Returned {@link InstanceProcess#getPid()} should return unique pid on this stage.
- * This pid allow to control process from clients and save process logs if needed.
- *
- * @param command
- * command from which process should be created
- * @param outputChannel
- * websocket chanel for execution logs
- * @return {@link InstanceProcess} with unique pid, that can't be used in future for other process of instance
- * @throws MachineException
- * if error occurs on creating process
- */
- InstanceProcess createProcess(Command command, String outputChannel) throws MachineException;
-
- /**
- * Save state of the instance
- *
- * @return {@code InstanceSnapshotKey} that describe implementation specific keys of snapshot
- * @throws MachineException
- * if error occurs on storing state of the instance
- */
- MachineSource saveToSnapshot() throws MachineException;
-
- /**
- * Destroy instance
- *
- * @throws MachineException
- * if error occurs on instance destroying
- */
- void destroy() throws MachineException;
-
- /**
- * Returns {@link InstanceNode} that represents server where machine is launched
- */
- InstanceNode getNode();
-
- /**
- * Reads file content from machine by specified path.
- *
- * @param filePath
- * path to file on machine instance
- * @param startFrom
- * line number to start reading from
- * @param limit
- * limitation on line
- * @return file content
- * @throws MachineException
- * if any error occurs with file reading
- */
- String readFileContent(String filePath, int startFrom, int limit) throws MachineException;
-
-
- /**
- * Copies files from specified machine into current machine.
- *
- * @param sourceMachine
- * source machine
- * @param sourcePath
- * path to file or directory inside specified machine
- * @param targetPath
- * path to destination file or directory inside machine
- * @param overwriteDirNonDir
- * If "false" then it will be an error if unpacking the given content would cause
- * an existing directory to be replaced with a non-directory and vice versa.
- * @throws MachineException
- * if any error occurs when files are being copied
- */
- void copy(Instance sourceMachine, String sourcePath, String targetPath, boolean overwriteDirNonDir) throws MachineException;
-
- /**
- * Copies files from CHE server into current machine.
- *
- * @param sourcePath
- * path to file or directory inside CHE server
- * @param targetPath
- * path to destination file or directory inside machine
- * @throws MachineException
- * if any error occurs when files are being copied
- */
- void copy(String sourcePath, String targetPath) throws MachineException;
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/InstanceNode.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/InstanceNode.java
deleted file mode 100644
index ba13e62cd4..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/InstanceNode.java
+++ /dev/null
@@ -1,25 +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.server.spi;
-
-/**
- * Represents server where machine is launched
- *
- * @author Alexander Garagatyi
- *
- * @deprecated
- */
-public interface InstanceNode {
- /**
- * Host of the server where machine is launched
- */
- String getHost();
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/InstanceProcess.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/InstanceProcess.java
deleted file mode 100644
index bed9364498..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/InstanceProcess.java
+++ /dev/null
@@ -1,70 +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.server.spi;
-
-import org.eclipse.che.api.core.ConflictException;
-import org.eclipse.che.api.core.NotFoundException;
-import org.eclipse.che.api.core.util.LineConsumer;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.core.model.machine.MachineProcess;
-
-/**
- * Represents process in the machine created by command.
- *
- * @author andrew00x
- * @author Alexander Garagatyi
- *
- * @deprecated
- */
-public interface InstanceProcess extends MachineProcess {
- /**
- * Starts process in the background.
- *
- * @throws org.eclipse.che.api.core.ConflictException
- * if process is started already
- * @throws MachineException
- * if internal error occurs
- * @see #start()
- * @see #isAlive()
- */
- void start() throws ConflictException, MachineException;
-
- /**
- * Starts process.
- *
- * @param output
- * consumer for process' output. If this parameter is {@code null} process started in the background. If this parameter is
- * specified then this method is blocked until process is running.
- * @throws org.eclipse.che.api.core.ConflictException
- * if process is started already
- * @throws MachineException
- * if internal error occurs
- */
- void start(LineConsumer output) throws ConflictException, MachineException;
-
- /**
- * Kills this process.
- *
- * @throws MachineException
- * if internal error occurs
- */
- void kill() throws MachineException;
-
- /**
- * Check if process is alive
- *
- * @throws NotFoundException
- * if process is not found. It possible if it is finished, was killed.
- * @throws MachineException
- * if internal error occurs
- */
- void checkAlive() throws NotFoundException, MachineException;
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/InstanceProvider.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/InstanceProvider.java
deleted file mode 100644
index eccfdbe41b..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/InstanceProvider.java
+++ /dev/null
@@ -1,85 +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.server.spi;
-
-import org.eclipse.che.api.core.NotFoundException;
-import org.eclipse.che.api.core.model.machine.OldMachine;
-import org.eclipse.che.api.core.model.machine.MachineSource;
-import org.eclipse.che.api.core.model.machine.OldMachineConfig;
-import org.eclipse.che.api.core.model.machine.OldRecipe;
-import org.eclipse.che.api.core.util.LineConsumer;
-import org.eclipse.che.api.machine.server.exception.InvalidRecipeException;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.exception.SnapshotException;
-import org.eclipse.che.api.machine.server.exception.SourceNotFoundException;
-import org.eclipse.che.api.machine.server.exception.UnsupportedRecipeException;
-
-import java.util.Set;
-
-/**
- * Provides instances of {@link Instance} in implementation specific way.
- *
- * @author gazarenkov
- * @author Alexander Garagatyi
- *
- * @deprecated
- */
-public interface InstanceProvider {
- /**
- * Gets type of instance that this provider supports. Must be unique per system.
- *
- * @return type of instance that this provider supports
- */
- String getType();
-
- /**
- * Gets supported recipe types.
- *
- * @return supported recipe types
- * @see OldRecipe#getType()
- */
- Set getRecipeTypes();
-
- /**
- * Creates instance from scratch or by reusing a previously one by using specified {@link org.eclipse.che.api.core.model.machine.MachineSource}
- * data in {@link OldMachineConfig}.
- *
- * @param machine
- * machine description
- * @param creationLogsOutput
- * output for instance creation logs
- * @return newly created {@link Instance}
- * @throws UnsupportedRecipeException
- * if specified {@code recipe} is not supported
- * @throws InvalidRecipeException
- * if {@code recipe} is invalid
- * @throws NotFoundException
- * if instance described by {@link org.eclipse.che.api.core.model.machine.MachineSource} doesn't exists
- * @throws MachineException
- * if other error occurs
- */
- Instance createInstance(OldMachine machine,
- LineConsumer creationLogsOutput) throws UnsupportedRecipeException,
- InvalidRecipeException,
- SourceNotFoundException,
- NotFoundException,
- MachineException;
-
- /**
- * Removes snapshot of the instance in implementation specific way.
- *
- * @param machineSource
- * contains implementation specific key of the snapshot of the instance that should be removed
- * @throws SnapshotException
- * if exception occurs on instance snapshot removal
- */
- void removeInstanceSnapshot(MachineSource machineSource) throws SnapshotException;
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/impl/AbstractInstance.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/impl/AbstractInstance.java
deleted file mode 100644
index 8065a22eea..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/impl/AbstractInstance.java
+++ /dev/null
@@ -1,39 +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.server.spi.impl;
-
-import org.eclipse.che.api.core.model.machine.OldMachine;
-import org.eclipse.che.api.core.model.machine.MachineStatus;
-import org.eclipse.che.api.machine.server.model.impl.MachineImpl;
-import org.eclipse.che.api.machine.server.model.impl.OldMachineImpl;
-import org.eclipse.che.api.machine.server.spi.Instance;
-
-/**
- * @author Alexander Garagatyi
- */
-public abstract class AbstractInstance extends OldMachineImpl implements Instance {
- public AbstractInstance(OldMachine machine) {
- super(machine);
- }
-
- @Override
- public synchronized MachineStatus getStatus() {
- return super.getStatus();
- }
-
- @Override
- public synchronized void setStatus(MachineStatus status) {
- super.setStatus(status);
- }
-
- @Override
- public abstract MachineImpl getRuntime();
-}
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/impl/AbstractMachineProcess.java b/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/impl/AbstractMachineProcess.java
deleted file mode 100644
index 421cd72f45..0000000000
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/impl/AbstractMachineProcess.java
+++ /dev/null
@@ -1,83 +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.server.spi.impl;
-
-import org.eclipse.che.api.core.model.workspace.config.Command;
-import org.eclipse.che.api.machine.server.spi.InstanceProcess;
-
-import java.util.Map;
-
-/**
- * @author Alexander Garagatyi
- */
-public abstract class AbstractMachineProcess implements InstanceProcess {
- private final String name;
- private final String commandLine;
- private final String type;
- private final Map attributes;
- private final int pid;
- private final String outputChannel;
-
- public AbstractMachineProcess(String name,
- String commandLine,
- String type,
- Map attributes,
- int pid,
- String outputChannel) {
- this.name = name;
- this.commandLine = commandLine;
- this.type = type;
- this.attributes = attributes;
- this.outputChannel = outputChannel;
- this.pid = pid;
- }
-
- public AbstractMachineProcess(Command command,
- int pid,
- String outputChannel) {
- this.name = command.getName();
- this.commandLine = command.getCommandLine();
- this.type = command.getType();
- this.attributes = command.getAttributes();
- this.pid = pid;
- this.outputChannel = outputChannel;
- }
-
- @Override
- public int getPid() {
- return pid;
- }
-
- @Override
- public String getOutputChannel() {
- return outputChannel;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getCommandLine() {
- return commandLine;
- }
-
- @Override
- public String getType() {
- return type;
- }
-
- @Override
- public Map getAttributes() {
- return attributes;
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/model/impl/adapter/MachineSourceAdapterTest.java b/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/model/impl/adapter/MachineSourceAdapterTest.java
deleted file mode 100644
index 7e25550444..0000000000
--- a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/model/impl/adapter/MachineSourceAdapterTest.java
+++ /dev/null
@@ -1,70 +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.server.model.impl.adapter;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonDeserializationContext;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonSerializationContext;
-
-import org.eclipse.che.api.core.model.machine.MachineSource;
-import org.eclipse.che.api.machine.server.model.impl.MachineSourceImpl;
-import org.mockito.Mockito;
-import org.testng.annotations.Test;
-
-import java.io.StringReader;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.spy;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-/**
- * Test {@link MachineSourceAdapter} on serialization
- *
- * @author Florent Benoit
- */
-public class MachineSourceAdapterTest {
-
- /**
- * Check we can transform object into JSON and JSON into object
- */
- @Test
- public void testSerializeAndDeserialize() {
-
- MachineSourceAdapter machineSourceAdapter = spy(new MachineSourceAdapter());
-
- Gson gson = new GsonBuilder().registerTypeAdapter(MachineSource.class, machineSourceAdapter).setPrettyPrinting().create();
-
- final String TYPE = "myType";
- final String LOCATION = "myLocation";
- final String CONTENT = "myContent";
-
- // serialize
- MachineSource machineSource = new MachineSourceImpl(TYPE).setLocation(LOCATION).setContent(CONTENT);
- String json = gson.toJson(machineSource, MachineSource.class);
- assertNotNull(json);
-
- // verify we called serializer
- Mockito.verify(machineSourceAdapter).serialize(eq(machineSource), eq(MachineSource.class), any(JsonSerializationContext.class));
-
- // now deserialize
- MachineSource machineSourceDeserialize = gson.fromJson(new StringReader(json), MachineSource.class);
- assertNotNull(machineSourceDeserialize);
- assertEquals(machineSourceDeserialize.getLocation(), LOCATION);
- assertEquals(machineSourceDeserialize.getType(), TYPE);
- assertEquals(machineSourceDeserialize.getContent(), CONTENT);
- // verify we called deserializer
- Mockito.verify(machineSourceAdapter).deserialize(any(JsonElement.class), eq(MachineSource.class), any(JsonDeserializationContext.class));
- }
-}
diff --git a/wsmaster/che-core-api-machine/src/test/resources/META-INF/services/org.eclipse.che.commons.test.tck.TckModule b/wsmaster/che-core-api-machine/src/test/resources/META-INF/services/org.eclipse.che.commons.test.tck.TckModule
deleted file mode 100644
index aac7532421..0000000000
--- a/wsmaster/che-core-api-machine/src/test/resources/META-INF/services/org.eclipse.che.commons.test.tck.TckModule
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.che.api.machine.server.jpa.JpaTckModule
diff --git a/wsmaster/che-core-api-machine/src/test/resources/logback-test.xml b/wsmaster/che-core-api-machine/src/test/resources/logback-test.xml
deleted file mode 100644
index 2a7fd9851a..0000000000
--- a/wsmaster/che-core-api-machine/src/test/resources/logback-test.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
- %-41(%date[%.25thread]) %-45([%-5level] [%.30logger{30} %L]) - %msg%n%nopex
-
-
-
-
-
-
-
-
diff --git a/wsmaster/che-core-api-workspace/pom.xml b/wsmaster/che-core-api-workspace/pom.xml
index dccd5d3bfb..ce05cf3a88 100644
--- a/wsmaster/che-core-api-workspace/pom.xml
+++ b/wsmaster/che-core-api-workspace/pom.xml
@@ -69,10 +69,6 @@
org.eclipse.che.core
che-core-api-dto
-
- org.eclipse.che.core
- che-core-api-machine
-
org.eclipse.che.core
che-core-api-machine-shared
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/BeforeRecipeRemovedEvent.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/BeforeRecipeRemovedEvent.java
similarity index 89%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/BeforeRecipeRemovedEvent.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/BeforeRecipeRemovedEvent.java
index ea20d99022..7709517b13 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/BeforeRecipeRemovedEvent.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/BeforeRecipeRemovedEvent.java
@@ -8,9 +8,8 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.event;
+package org.eclipse.che.api.recipe;
-import org.eclipse.che.api.machine.server.recipe.OldRecipeImpl;
import org.eclipse.che.core.db.cascade.event.RemoveEvent;
/**
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/jpa/JpaRecipeDao.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/JpaRecipeDao.java
similarity index 95%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/jpa/JpaRecipeDao.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/JpaRecipeDao.java
index 89c9631993..c538f8bb92 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/jpa/JpaRecipeDao.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/JpaRecipeDao.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.jpa;
+package org.eclipse.che.api.recipe;
import com.google.inject.persist.Transactional;
@@ -17,10 +17,6 @@ import org.eclipse.che.api.core.ConflictException;
import org.eclipse.che.api.core.NotFoundException;
import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.notification.EventService;
-import org.eclipse.che.api.machine.server.event.BeforeRecipeRemovedEvent;
-import org.eclipse.che.api.machine.server.event.RecipePersistedEvent;
-import org.eclipse.che.api.machine.server.recipe.OldRecipeImpl;
-import org.eclipse.che.api.machine.server.spi.RecipeDao;
import org.eclipse.che.core.db.jpa.DuplicateKeyException;
import org.eclipse.che.core.db.jpa.IntegrityConstraintViolationException;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/OldRecipeImpl.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/OldRecipeImpl.java
similarity index 99%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/OldRecipeImpl.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/OldRecipeImpl.java
index 2f49b8930d..7c557049ee 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/OldRecipeImpl.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/OldRecipeImpl.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.recipe;
+package org.eclipse.che.api.recipe;
import org.eclipse.che.api.core.model.machine.OldRecipe;
import org.eclipse.che.api.machine.shared.ManagedOldRecipe;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/RecipeDao.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/RecipeDao.java
similarity index 97%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/RecipeDao.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/RecipeDao.java
index 71b0fdc119..b920f8ffe3 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/spi/RecipeDao.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/RecipeDao.java
@@ -8,12 +8,11 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.spi;
+package org.eclipse.che.api.recipe;
import org.eclipse.che.api.core.ConflictException;
import org.eclipse.che.api.core.NotFoundException;
import org.eclipse.che.api.core.ServerException;
-import org.eclipse.che.api.machine.server.recipe.OldRecipeImpl;
import org.eclipse.che.api.machine.shared.ManagedOldRecipe;
import java.util.List;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/RecipeLoader.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/RecipeLoader.java
similarity index 97%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/RecipeLoader.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/RecipeLoader.java
index 0a61db5cba..c4f42224d5 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/RecipeLoader.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/RecipeLoader.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.recipe;
+package org.eclipse.che.api.recipe;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
@@ -20,7 +20,6 @@ import com.google.inject.Inject;
import org.eclipse.che.api.core.ConflictException;
import org.eclipse.che.api.core.NotFoundException;
import org.eclipse.che.api.core.ServerException;
-import org.eclipse.che.api.machine.server.spi.RecipeDao;
import org.eclipse.che.commons.annotation.Nullable;
import javax.annotation.PostConstruct;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/RecipePersistedEvent.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/RecipePersistedEvent.java
similarity index 95%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/RecipePersistedEvent.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/RecipePersistedEvent.java
index c3b561af79..c5c7332e55 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/event/RecipePersistedEvent.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/RecipePersistedEvent.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.event;
+package org.eclipse.che.api.recipe;
import org.eclipse.che.api.core.notification.EventOrigin;
import org.eclipse.che.api.machine.shared.ManagedOldRecipe;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/RecipeService.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/RecipeService.java
similarity index 98%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/RecipeService.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/RecipeService.java
index f1f47a3f66..b2725b34fa 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/RecipeService.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/RecipeService.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.recipe;
+package org.eclipse.che.api.recipe;
import org.eclipse.che.api.core.ApiException;
import org.eclipse.che.api.core.BadRequestException;
@@ -16,7 +16,6 @@ import org.eclipse.che.api.core.rest.Service;
import org.eclipse.che.api.core.rest.annotations.GenerateLink;
import org.eclipse.che.api.core.rest.shared.dto.Link;
import org.eclipse.che.api.core.util.LinksHelper;
-import org.eclipse.che.api.machine.server.spi.RecipeDao;
import org.eclipse.che.api.machine.shared.ManagedOldRecipe;
import org.eclipse.che.api.machine.shared.dto.recipe.NewOldRecipe;
import org.eclipse.che.api.machine.shared.dto.recipe.OldRecipeDescriptor;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/adapters/RecipeTypeAdapter.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/adapters/RecipeTypeAdapter.java
similarity index 93%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/adapters/RecipeTypeAdapter.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/adapters/RecipeTypeAdapter.java
index 064995c29f..f3822101cb 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/adapters/RecipeTypeAdapter.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/adapters/RecipeTypeAdapter.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.recipe.adapters;
+package org.eclipse.che.api.recipe.adapters;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
@@ -19,7 +19,7 @@ import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import org.eclipse.che.api.core.model.machine.OldRecipe;
-import org.eclipse.che.api.machine.server.recipe.OldRecipeImpl;
+import org.eclipse.che.api.recipe.OldRecipeImpl;
import java.lang.reflect.Type;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/providers/RecipeProvider.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/providers/RecipeProvider.java
similarity index 93%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/providers/RecipeProvider.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/providers/RecipeProvider.java
index db567f1722..a2bbc1ddc8 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/recipe/providers/RecipeProvider.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/recipe/providers/RecipeProvider.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.recipe.providers;
+package org.eclipse.che.api.recipe.providers;
import com.google.inject.Provider;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/util/RecipeDownloader.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/RecipeDownloader.java
similarity index 92%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/util/RecipeDownloader.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/RecipeDownloader.java
index 0fd56a980e..f3cc069622 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/util/RecipeDownloader.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/RecipeDownloader.java
@@ -8,13 +8,12 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.util;
+package org.eclipse.che.api.workspace.server;
import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.model.machine.OldMachineConfig;
import org.eclipse.che.api.core.model.machine.MachineSource;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.recipe.OldRecipeImpl;
+import org.eclipse.che.api.recipe.OldRecipeImpl;
import org.eclipse.che.commons.env.EnvironmentContext;
import org.eclipse.che.commons.lang.IoUtil;
import org.slf4j.Logger;
@@ -55,10 +54,10 @@ public class RecipeDownloader {
* @param machineConfig
* config used to get recipe location
* @return recipe with set content and type
- * @throws MachineException
+ * @throws ServerException
* if any error occurs
*/
- public OldRecipeImpl getRecipe(OldMachineConfig machineConfig) throws MachineException {
+ public OldRecipeImpl getRecipe(OldMachineConfig machineConfig) throws ServerException {
URL recipeUrl;
File file = null;
final String location = machineConfig.getSource().getLocation();
@@ -81,7 +80,7 @@ public class RecipeDownloader {
return new OldRecipeImpl().withType(machineConfig.getSource().getType())
.withScript(IoUtil.readAndCloseQuietly(new FileInputStream(file)));
} catch (IOException | IllegalArgumentException e) {
- throw new MachineException(format("Failed to download recipe for machine %s. OldRecipe url %s. Error: %s",
+ throw new ServerException(format("Failed to download recipe for machine %s. OldRecipe url %s. Error: %s",
machineConfig.getName(),
location,
e.getLocalizedMessage()));
@@ -122,7 +121,7 @@ public class RecipeDownloader {
return IoUtil.readAndCloseQuietly(new FileInputStream(file));
} catch (IOException | IllegalArgumentException | UriBuilderException e) {
- throw new MachineException(format("Failed to download recipe %s. Error: %s",
+ throw new ServerException(format("Failed to download recipe %s. Error: %s",
location,
e.getLocalizedMessage()));
} finally {
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/util/RecipeRetriever.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/RecipeRetriever.java
similarity index 88%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/util/RecipeRetriever.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/RecipeRetriever.java
index fc753b14b7..0d63ce8f3f 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/util/RecipeRetriever.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/RecipeRetriever.java
@@ -8,15 +8,15 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.util;
+package org.eclipse.che.api.workspace.server;
import com.google.common.base.Strings;
-import org.eclipse.che.api.core.model.machine.OldMachineConfig;
+import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.model.machine.MachineSource;
+import org.eclipse.che.api.core.model.machine.OldMachineConfig;
import org.eclipse.che.api.core.model.machine.OldRecipe;
-import org.eclipse.che.api.machine.server.exception.MachineException;
-import org.eclipse.che.api.machine.server.recipe.OldRecipeImpl;
+import org.eclipse.che.api.recipe.OldRecipeImpl;
import javax.inject.Inject;
import javax.validation.constraints.NotNull;
@@ -40,10 +40,10 @@ public class RecipeRetriever {
* @param machineConfig
* the machine configuration that is containing the content or a location to get recipe
* @return recipe with set content and type
- * @throws MachineException
+ * @throws ServerException
* if any error occurs
*/
- public OldRecipe getRecipe(@NotNull OldMachineConfig machineConfig) throws MachineException {
+ public OldRecipe getRecipe(@NotNull OldMachineConfig machineConfig) throws ServerException {
MachineSource machineSource = machineConfig.getSource();
if (!Strings.isNullOrEmpty(machineSource.getContent())) {
return new OldRecipeImpl().withType(machineSource.getType())
diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceManager.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceManager.java
index 8186b81951..8f4bc2dc4d 100644
--- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceManager.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceManager.java
@@ -23,7 +23,6 @@ import org.eclipse.che.api.core.model.workspace.WorkspaceConfig;
import org.eclipse.che.api.core.model.workspace.Runtime;
import org.eclipse.che.api.core.model.workspace.WorkspaceStatus;
import org.eclipse.che.api.core.notification.EventService;
-import org.eclipse.che.api.machine.server.exception.SourceNotFoundException;
import org.eclipse.che.api.workspace.server.event.WorkspaceCreatedEvent;
import org.eclipse.che.api.workspace.server.model.impl.WorkspaceConfigImpl;
import org.eclipse.che.api.workspace.server.model.impl.WorkspaceImpl;
@@ -504,9 +503,10 @@ public class WorkspaceManager {
removeWorkspaceQuietly(workspace);
}
for (Throwable cause : getCausalChain(ex)) {
- if (cause instanceof SourceNotFoundException) {
- return;
- }
+ // TODO spi
+// if (cause instanceof SourceNotFoundException) {
+// return;
+// }
}
LOG.error(ex.getLocalizedMessage(), ex);
}
diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceService.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceService.java
index f12a8dae27..a34fe219fc 100644
--- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceService.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceService.java
@@ -31,7 +31,7 @@ import org.eclipse.che.api.core.model.workspace.Workspace;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.core.model.workspace.WorkspaceStatus;
import org.eclipse.che.api.core.rest.Service;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.api.machine.shared.dto.CommandDto;
import org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl;
import org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl;
@@ -63,19 +63,12 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static com.google.common.base.MoreObjects.firstNonNull;
import static java.lang.String.format;
import static java.util.Collections.emptyMap;
import static java.util.stream.Collectors.toList;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import static org.eclipse.che.api.workspace.server.DtoConverter.asDto;
-import static org.eclipse.che.api.workspace.shared.Constants.CHE_WORKSPACE_AUTO_RESTORE;
-import static org.eclipse.che.api.workspace.shared.Constants.CHE_WORKSPACE_AUTO_SNAPSHOT;
-import static org.eclipse.che.api.workspace.shared.Constants.CHE_WORKSPACE_AUTO_START;
-import static org.eclipse.che.api.workspace.shared.Constants.LINK_REL_CREATE_WORKSPACE;
-import static org.eclipse.che.api.workspace.shared.Constants.LINK_REL_GET_BY_NAMESPACE;
-import static org.eclipse.che.api.workspace.shared.Constants.LINK_REL_GET_WORKSPACES;
import static org.eclipse.che.dto.server.DtoFactory.newDto;
/**
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/CommandImpl.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/CommandImpl.java
similarity index 98%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/CommandImpl.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/CommandImpl.java
index 338bbcc893..8b08f9863a 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/CommandImpl.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/CommandImpl.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.model.impl;
+package org.eclipse.che.api.workspace.server.model.impl;
import org.eclipse.che.api.core.model.workspace.config.Command;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/MachineImpl.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/MachineImpl.java
similarity index 98%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/MachineImpl.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/MachineImpl.java
index a36a46c4d3..f1305d2824 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/MachineImpl.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/MachineImpl.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.model.impl;
+package org.eclipse.che.api.workspace.server.model.impl;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Server;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/MachineSourceImpl.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/MachineSourceImpl.java
similarity index 98%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/MachineSourceImpl.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/MachineSourceImpl.java
index 1b29a711ad..b29382c777 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/MachineSourceImpl.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/MachineSourceImpl.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.model.impl;
+package org.eclipse.che.api.workspace.server.model.impl;
import org.eclipse.che.api.core.model.machine.MachineSource;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/OldServerConfImpl.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/OldServerConfImpl.java
similarity index 98%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/OldServerConfImpl.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/OldServerConfImpl.java
index 091b6db75d..401c5c8524 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/OldServerConfImpl.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/OldServerConfImpl.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.model.impl;
+package org.eclipse.che.api.workspace.server.model.impl;
import org.eclipse.che.api.core.model.machine.OldServerConf;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/ServerImpl.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/ServerImpl.java
similarity index 93%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/ServerImpl.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/ServerImpl.java
index 5de1953d10..99583ff16e 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/ServerImpl.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/ServerImpl.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.model.impl;
+package org.eclipse.che.api.workspace.server.model.impl;
import org.eclipse.che.api.core.model.workspace.runtime.Server;
diff --git a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/ServerPropertiesImpl.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/ServerPropertiesImpl.java
similarity index 97%
rename from wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/ServerPropertiesImpl.java
rename to wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/ServerPropertiesImpl.java
index d022030b90..7ae1b1ae8d 100644
--- a/wsmaster/che-core-api-machine/src/main/java/org/eclipse/che/api/machine/server/model/impl/ServerPropertiesImpl.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/ServerPropertiesImpl.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.model.impl;
+package org.eclipse.che.api.workspace.server.model.impl;
import org.eclipse.che.api.core.model.machine.ServerProperties;
diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/WorkspaceConfigImpl.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/WorkspaceConfigImpl.java
index 56f8285d61..a376817652 100644
--- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/WorkspaceConfigImpl.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/WorkspaceConfigImpl.java
@@ -14,7 +14,6 @@ import org.eclipse.che.api.core.model.workspace.config.Command;
import org.eclipse.che.api.core.model.workspace.config.ProjectConfig;
import org.eclipse.che.api.core.model.workspace.config.Environment;
import org.eclipse.che.api.core.model.workspace.WorkspaceConfig;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
import org.eclipse.che.commons.annotation.Nullable;
import javax.persistence.CascadeType;
diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/WorkspaceImpl.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/WorkspaceImpl.java
index 058a116498..d1386f0d4e 100644
--- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/WorkspaceImpl.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/WorkspaceImpl.java
@@ -12,11 +12,10 @@ package org.eclipse.che.api.workspace.server.model.impl;
import org.eclipse.che.account.shared.model.Account;
import org.eclipse.che.account.spi.AccountImpl;
+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.WorkspaceConfig;
-import org.eclipse.che.api.core.model.workspace.Runtime;
import org.eclipse.che.api.core.model.workspace.WorkspaceStatus;
-import org.eclipse.che.api.machine.server.model.impl.SnapshotImpl;
import org.eclipse.che.commons.lang.NameGenerator;
import org.eclipse.persistence.descriptors.DescriptorEvent;
import org.eclipse.persistence.descriptors.DescriptorEventAdapter;
@@ -34,14 +33,12 @@ import javax.persistence.ManyToOne;
import javax.persistence.MapKeyColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
-import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -104,9 +101,9 @@ public class WorkspaceImpl implements Workspace {
// This mapping is for explicit constraint between
// snapshots and workspace, it's impossible to do so on snapshot side
// as workspace and machine are different modules and cyclic reference will appear.
- @OneToMany(fetch = FetchType.LAZY)
- @JoinColumn(name = "workspaceId", insertable = false, updatable = false)
- private List snapshots;
+// @OneToMany(fetch = FetchType.LAZY)
+// @JoinColumn(name = "workspaceId", insertable = false, updatable = false)
+// private List snapshots;
@Transient
private WorkspaceStatus status;
diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/InternalRuntime.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/InternalRuntime.java
index 78b1aaca6c..cefe4b746a 100644
--- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/InternalRuntime.java
+++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/InternalRuntime.java
@@ -14,8 +14,8 @@ import org.eclipse.che.api.core.model.workspace.Runtime;
import org.eclipse.che.api.core.model.workspace.Warning;
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.server.model.impl.MachineImpl;
-import org.eclipse.che.api.machine.server.model.impl.ServerImpl;
+import org.eclipse.che.api.workspace.server.model.impl.MachineImpl;
+import org.eclipse.che.api.workspace.server.model.impl.ServerImpl;
import org.eclipse.che.api.workspace.server.URLRewriter;
import java.net.MalformedURLException;
diff --git a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/spi/tck/RecipeDaoTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/recipe/RecipeDaoTest.java
similarity index 98%
rename from wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/spi/tck/RecipeDaoTest.java
rename to wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/recipe/RecipeDaoTest.java
index 2b09f08e6d..999294bdcc 100644
--- a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/spi/tck/RecipeDaoTest.java
+++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/recipe/RecipeDaoTest.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.spi.tck;
+package org.eclipse.che.api.recipe;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
@@ -17,8 +17,6 @@ import org.eclipse.che.api.core.ConflictException;
import org.eclipse.che.api.core.NotFoundException;
import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.notification.EventService;
-import org.eclipse.che.api.machine.server.event.BeforeRecipeRemovedEvent;
-import org.eclipse.che.api.machine.server.event.RecipePersistedEvent;
import org.eclipse.che.api.machine.server.recipe.OldRecipeImpl;
import org.eclipse.che.api.machine.server.spi.RecipeDao;
import org.eclipse.che.commons.lang.NameGenerator;
diff --git a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/recipe/RecipeLoaderTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/recipe/RecipeLoaderTest.java
similarity index 96%
rename from wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/recipe/RecipeLoaderTest.java
rename to wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/recipe/RecipeLoaderTest.java
index bf0bc26ffe..cc91470b0b 100644
--- a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/recipe/RecipeLoaderTest.java
+++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/recipe/RecipeLoaderTest.java
@@ -8,12 +8,11 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.recipe;
+package org.eclipse.che.api.recipe;
import org.eclipse.che.api.core.ConflictException;
import org.eclipse.che.api.core.NotFoundException;
import org.eclipse.che.api.core.ServerException;
-import org.eclipse.che.api.machine.server.spi.RecipeDao;
import org.mockito.Mock;
import org.mockito.testng.MockitoTestNGListener;
import org.testng.annotations.Listeners;
diff --git a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/recipe/RecipeServiceTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/recipe/RecipeServiceTest.java
similarity index 99%
rename from wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/recipe/RecipeServiceTest.java
rename to wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/recipe/RecipeServiceTest.java
index 53bfe91abc..3b84976538 100644
--- a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/recipe/RecipeServiceTest.java
+++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/recipe/RecipeServiceTest.java
@@ -8,14 +8,13 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.recipe;
+package org.eclipse.che.api.recipe;
import com.google.common.collect.FluentIterable;
import com.jayway.restassured.response.Response;
import org.eclipse.che.api.core.rest.ApiExceptionMapper;
import org.eclipse.che.api.core.rest.shared.dto.ServiceError;
-import org.eclipse.che.api.machine.server.spi.RecipeDao;
import org.eclipse.che.api.machine.shared.dto.recipe.NewOldRecipe;
import org.eclipse.che.api.machine.shared.dto.recipe.OldRecipeDescriptor;
import org.eclipse.che.api.machine.shared.dto.recipe.OldRecipeUpdate;
diff --git a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/util/RecipeRetrieverTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/RecipeRetrieverTest.java
similarity index 98%
rename from wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/util/RecipeRetrieverTest.java
rename to wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/RecipeRetrieverTest.java
index 9bd66b09e8..921d991af5 100644
--- a/wsmaster/che-core-api-machine/src/test/java/org/eclipse/che/api/machine/server/util/RecipeRetrieverTest.java
+++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/RecipeRetrieverTest.java
@@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package org.eclipse.che.api.machine.server.util;
+package org.eclipse.che.api.workspace.server;
import org.eclipse.che.api.core.model.machine.OldMachineConfig;
import org.eclipse.che.api.core.model.machine.MachineSource;
diff --git a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceManagerTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceManagerTest.java
index 1d34fa25d3..5eec96cf01 100644
--- a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceManagerTest.java
+++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceManagerTest.java
@@ -10,47 +10,26 @@
*******************************************************************************/
package org.eclipse.che.api.workspace.server;
-import org.eclipse.che.account.api.AccountManager;
-import org.eclipse.che.account.spi.AccountImpl;
import org.eclipse.che.api.core.ConflictException;
import org.eclipse.che.api.core.NotFoundException;
import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
-import org.eclipse.che.api.core.model.workspace.WorkspaceConfig;
import org.eclipse.che.api.core.model.workspace.WorkspaceStatus;
-import org.eclipse.che.api.core.notification.EventService;
-import org.eclipse.che.api.machine.server.model.impl.MachineImpl;
+import org.eclipse.che.api.workspace.server.model.impl.MachineImpl;
import org.eclipse.che.api.machine.server.spi.SnapshotDao;
-import org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl;
-import org.eclipse.che.api.workspace.server.model.impl.RecipeImpl;
-import org.eclipse.che.api.workspace.server.model.impl.MachineConfigImpl;
import org.eclipse.che.api.workspace.server.model.impl.RuntimeImpl;
-import org.eclipse.che.api.workspace.server.model.impl.WorkspaceConfigImpl;
import org.eclipse.che.api.workspace.server.model.impl.WorkspaceImpl;
-import org.eclipse.che.api.workspace.server.spi.WorkspaceDao;
-import org.eclipse.che.commons.env.EnvironmentContext;
-import org.eclipse.che.commons.subject.Subject;
-import org.eclipse.che.commons.subject.SubjectImpl;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
import org.mockito.testng.MockitoTestNGListener;
-import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Listeners;
-import org.testng.annotations.Test;
import java.util.HashMap;
import java.util.Map;
-import static java.util.Collections.singletonList;
-import static java.util.Collections.singletonMap;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;
-import static org.testng.util.Strings.isNullOrEmpty;
/**
* Covers main cases of {@link WorkspaceManager}.
diff --git a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceRuntimeIntegrationTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceRuntimeIntegrationTest.java
index e72cfc843f..185bbe1225 100644
--- a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceRuntimeIntegrationTest.java
+++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceRuntimeIntegrationTest.java
@@ -10,18 +10,9 @@
*******************************************************************************/
package org.eclipse.che.api.workspace.server;
-import org.eclipse.che.api.machine.server.MachineInstanceProviders;
-import org.eclipse.che.api.machine.server.spi.SnapshotDao;
-import org.eclipse.che.api.machine.server.util.RecipeDownloader;
-import org.mockito.Mock;
import org.mockito.testng.MockitoTestNGListener;
-import org.slf4j.Logger;
import org.testng.annotations.Listeners;
-import java.util.concurrent.ExecutorService;
-
-import static org.slf4j.LoggerFactory.getLogger;
-
/**
* @author Alexander Garagatyi
*/
diff --git a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/jpa/WorkspaceTckModule.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/jpa/WorkspaceTckModule.java
index 592c11bd7e..df7106580d 100644
--- a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/jpa/WorkspaceTckModule.java
+++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/jpa/WorkspaceTckModule.java
@@ -13,8 +13,7 @@ package org.eclipse.che.api.workspace.server.jpa;
import com.google.inject.TypeLiteral;
import org.eclipse.che.account.spi.AccountImpl;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
-import org.eclipse.che.api.machine.server.model.impl.SnapshotImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl;
import org.eclipse.che.api.workspace.server.model.impl.MachineConfigImpl;
import org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl;
diff --git a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/spi/tck/WorkspaceDaoTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/spi/tck/WorkspaceDaoTest.java
index 1435512879..627c544147 100644
--- a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/spi/tck/WorkspaceDaoTest.java
+++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/spi/tck/WorkspaceDaoTest.java
@@ -18,7 +18,7 @@ import org.eclipse.che.api.core.ConflictException;
import org.eclipse.che.api.core.NotFoundException;
import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.notification.EventService;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.api.workspace.server.event.BeforeWorkspaceRemovedEvent;
import org.eclipse.che.api.workspace.server.event.WorkspaceRemovedEvent;
import org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl;
diff --git a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/stack/StackServiceTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/stack/StackServiceTest.java
index de40812e06..4bf9800048 100644
--- a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/stack/StackServiceTest.java
+++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/stack/StackServiceTest.java
@@ -17,7 +17,7 @@ import org.eclipse.che.api.core.NotFoundException;
import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.rest.ApiExceptionMapper;
import org.eclipse.che.api.core.rest.shared.dto.ServiceError;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl;
import org.eclipse.che.api.workspace.server.model.impl.WorkspaceConfigImpl;
import org.eclipse.che.api.workspace.server.model.impl.stack.StackComponentImpl;
diff --git a/wsmaster/che-core-api-machine/src/test/resources/invalid-recipes.json b/wsmaster/che-core-api-workspace/src/test/resources/invalid-recipes.json
similarity index 100%
rename from wsmaster/che-core-api-machine/src/test/resources/invalid-recipes.json
rename to wsmaster/che-core-api-workspace/src/test/resources/invalid-recipes.json
diff --git a/wsmaster/che-core-api-machine/src/test/resources/recipes.json b/wsmaster/che-core-api-workspace/src/test/resources/recipes.json
similarity index 100%
rename from wsmaster/che-core-api-machine/src/test/resources/recipes.json
rename to wsmaster/che-core-api-workspace/src/test/resources/recipes.json
diff --git a/wsmaster/integration-tests/cascade-removal/pom.xml b/wsmaster/integration-tests/cascade-removal/pom.xml
index 0788e6319c..95a614c20e 100644
--- a/wsmaster/integration-tests/cascade-removal/pom.xml
+++ b/wsmaster/integration-tests/cascade-removal/pom.xml
@@ -66,11 +66,6 @@
che-core-api-core
test
-
- org.eclipse.che.core
- che-core-api-machine
- test
-
org.eclipse.che.core
che-core-api-model
diff --git a/wsmaster/integration-tests/cascade-removal/src/test/java/org/eclipse/che/core/db/jpa/CascadeRemovalTest.java b/wsmaster/integration-tests/cascade-removal/src/test/java/org/eclipse/che/core/db/jpa/CascadeRemovalTest.java
index ff645073bd..8d7864836c 100644
--- a/wsmaster/integration-tests/cascade-removal/src/test/java/org/eclipse/che/core/db/jpa/CascadeRemovalTest.java
+++ b/wsmaster/integration-tests/cascade-removal/src/test/java/org/eclipse/che/core/db/jpa/CascadeRemovalTest.java
@@ -25,11 +25,7 @@ import org.eclipse.che.api.core.ConflictException;
import org.eclipse.che.api.core.NotFoundException;
import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.notification.EventService;
-import org.eclipse.che.api.machine.server.jpa.MachineJpaModule;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
-import org.eclipse.che.api.machine.server.model.impl.SnapshotImpl;
-import org.eclipse.che.api.machine.server.recipe.RecipeImpl;
-import org.eclipse.che.api.machine.server.spi.SnapshotDao;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.api.ssh.server.jpa.JpaSshDao.RemoveSshKeysBeforeUserRemovedEventSubscriber;
import org.eclipse.che.api.ssh.server.jpa.SshJpaModule;
import org.eclipse.che.api.ssh.server.model.impl.SshPairImpl;
@@ -51,10 +47,7 @@ import org.eclipse.che.api.workspace.server.jpa.JpaWorkspaceDao.RemoveSnapshotsB
import org.eclipse.che.api.workspace.server.jpa.JpaWorkspaceDao.RemoveWorkspaceBeforeAccountRemovedEventSubscriber;
import org.eclipse.che.api.workspace.server.jpa.WorkspaceJpaModule;
import org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl;
-import org.eclipse.che.api.workspace.server.model.impl.EnvironmentRecipeImpl;
-import org.eclipse.che.api.workspace.server.model.impl.ExtendedMachineImpl;
import org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl;
-import org.eclipse.che.api.workspace.server.model.impl.ServerConf2Impl;
import org.eclipse.che.api.workspace.server.model.impl.SourceStorageImpl;
import org.eclipse.che.api.workspace.server.model.impl.WorkspaceConfigImpl;
import org.eclipse.che.api.workspace.server.model.impl.WorkspaceImpl;
@@ -184,7 +177,7 @@ public class CascadeRemovalTest {
install(new AccountModule());
install(new SshJpaModule());
install(new WorkspaceJpaModule());
- install(new MachineJpaModule());
+// install(new MachineJpaModule());
bind(WorkspaceManager.class);
final WorkspaceRuntimes wR = mock(WorkspaceRuntimes.class);
when(wR.hasRuntime(anyString())).thenReturn(false);
diff --git a/wsmaster/integration-tests/cascade-removal/src/test/java/org/eclipse/che/core/db/jpa/TestObjectsFactory.java b/wsmaster/integration-tests/cascade-removal/src/test/java/org/eclipse/che/core/db/jpa/TestObjectsFactory.java
index bbcb86a14b..98241bb20c 100644
--- a/wsmaster/integration-tests/cascade-removal/src/test/java/org/eclipse/che/core/db/jpa/TestObjectsFactory.java
+++ b/wsmaster/integration-tests/cascade-removal/src/test/java/org/eclipse/che/core/db/jpa/TestObjectsFactory.java
@@ -15,7 +15,7 @@ import com.google.common.collect.ImmutableMap;
import org.eclipse.che.account.shared.model.Account;
import org.eclipse.che.account.spi.AccountImpl;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.api.machine.server.model.impl.SnapshotImpl;
import org.eclipse.che.api.machine.server.recipe.RecipeImpl;
import org.eclipse.che.api.ssh.server.model.impl.SshPairImpl;
diff --git a/wsmaster/integration-tests/postgresql-tck/pom.xml b/wsmaster/integration-tests/postgresql-tck/pom.xml
index d9c34b05c9..fa40331065 100644
--- a/wsmaster/integration-tests/postgresql-tck/pom.xml
+++ b/wsmaster/integration-tests/postgresql-tck/pom.xml
@@ -74,17 +74,6 @@
che-core-api-account
test
-
- org.eclipse.che.core
- che-core-api-machine
- tests
- test
-
-
- org.eclipse.che.core
- che-core-api-machine
- test
-
org.eclipse.che.core
che-core-api-model
@@ -224,7 +213,6 @@
che-core-api-account,
che-core-api-user,
che-core-api-ssh,
- che-core-api-machine,
che-core-api-workspace
test
tests
diff --git a/wsmaster/integration-tests/postgresql-tck/src/test/java/PostgreSqlTckModule.java b/wsmaster/integration-tests/postgresql-tck/src/test/java/PostgreSqlTckModule.java
index ab9f8a4f4d..43908dba35 100644
--- a/wsmaster/integration-tests/postgresql-tck/src/test/java/PostgreSqlTckModule.java
+++ b/wsmaster/integration-tests/postgresql-tck/src/test/java/PostgreSqlTckModule.java
@@ -16,12 +16,12 @@ import org.eclipse.che.account.spi.AccountDao;
import org.eclipse.che.account.spi.AccountImpl;
import org.eclipse.che.account.spi.jpa.JpaAccountDao;
import org.eclipse.che.api.core.model.workspace.Workspace;
-import org.eclipse.che.api.machine.server.jpa.JpaRecipeDao;
+import org.eclipse.che.api.recipe.JpaRecipeDao;
import org.eclipse.che.api.machine.server.jpa.JpaSnapshotDao;
-import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
+import org.eclipse.che.api.workspace.server.model.impl.CommandImpl;
import org.eclipse.che.api.machine.server.model.impl.SnapshotImpl;
import org.eclipse.che.api.machine.server.recipe.RecipeImpl;
-import org.eclipse.che.api.machine.server.spi.RecipeDao;
+import org.eclipse.che.api.recipe.RecipeDao;
import org.eclipse.che.api.machine.server.spi.SnapshotDao;
import org.eclipse.che.api.ssh.server.jpa.JpaSshDao;
import org.eclipse.che.api.ssh.server.model.impl.SshPairImpl;
diff --git a/wsmaster/pom.xml b/wsmaster/pom.xml
index 3f68437d5d..dcf5511acf 100644
--- a/wsmaster/pom.xml
+++ b/wsmaster/pom.xml
@@ -28,7 +28,6 @@
che-core-api-project-templates-shared
che-core-api-project-templates
che-core-api-machine-shared
- che-core-api-machine
che-core-api-workspace-shared
che-core-api-workspace
che-core-api-user-shared