]> git.somenet.org - pub/jan/dst18.git/blob - ass3-elastic/src/main/java/dst/ass3/elastic/IContainerService.java
Add template for assignment 3
[pub/jan/dst18.git] / ass3-elastic / src / main / java / dst / ass3 / elastic / IContainerService.java
1 package dst.ass3.elastic;
2
3 import dst.ass3.messaging.RequestType;
4
5 import java.util.List;
6
7 public interface IContainerService {
8
9     /**
10      * Returns a list of all running containers.
11      *
12      * @return a list of ContainerInfo objects
13      * @throws ContainerException if an error occurred when trying to fetch the running containers.
14      */
15     List<ContainerInfo> listContainers() throws ContainerException;
16
17     /**
18      * Stops the container with the given container ID.
19      *
20      * @param containerId ID of the container to stop.
21      * @throws ContainerNotFoundException if the container to stop is not running
22      * @throws ContainerException if another error occurred when trying to stop the container
23      */
24     void stopContainer(String containerId) throws ContainerException;
25
26     /**
27      * Starts a worker for the specific {@link RequestType}.
28      *
29      * @param type {@link RequestType} of the worker to start
30      * @return ContainerInfo of the started container / worker
31      * @throws ImageNotFoundException if the worker docker image is not available
32      * @throws ContainerException if another error occurred when trying to start the worker
33      */
34     ContainerInfo startWorker(RequestType type) throws ContainerException;
35
36 }