/
MachineManager.java
92 lines (80 loc) · 2.66 KB
/
MachineManager.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*******************************************************************************
* Copyright (c) 2012-2016 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.gwt.client;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.machine.shared.dto.MachineConfigDto;
import org.eclipse.che.api.machine.shared.dto.MachineDto;
import org.eclipse.che.api.promises.client.Promise;
/**
* Manager for machine.
*
* @author Roman Nikitenko
*/
public interface MachineManager {
/** The set of machine operation types */
enum MachineOperationType {
START, RESTART, DESTROY
}
/**
* Performs some actions when dev machine is creating.
*
* @param machineConfig
* contains information about dev machine configuration
*/
void onDevMachineCreating(MachineConfigDto machineConfig);
/**
* Performs some actions when machine is running.
*
* @param machineId
* ID of machine
*/
void onMachineRunning(String machineId);
/**
* Start new machine as dev-machine (bind workspace to running machine).
*
* @param recipeURL
* special recipe url to get docker image.
* @param displayName
* display name for machine
*/
void startDevMachine(String recipeURL, String displayName);
/**
* Start new machine in workspace.
*
* @param recipeURL
* special recipe url to get docker image.
* @param displayName
* display name for machine
*/
void startMachine(String recipeURL, String displayName);
/**
* Destroy machine.
*
* @param machine
* contains information about machine state
*/
Promise<Void> destroyMachine(Machine machine);
/**
* Restart machine.
*
* @param machine
* contains information about machine state
*/
void restartMachine(final Machine machine);
/**
* Checks if the the status for dev machine is tracked by machine manager.
*
* @param machine
* contains information about machine state
* @return {@code true} if status for dev machine is tracked by machine manager and {@code false} - otherwise.
*/
boolean isDevMachineStatusTracked(MachineDto machine);
}