forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartContainerCmdImpl.java
More file actions
45 lines (37 loc) · 1.26 KB
/
Copy pathStartContainerCmdImpl.java
File metadata and controls
45 lines (37 loc) · 1.26 KB
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
package com.github.dockerjava.core.command;
import static com.google.common.base.Preconditions.checkNotNull;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.github.dockerjava.api.command.StartContainerCmd;
import com.github.dockerjava.api.exception.NotFoundException;
import com.github.dockerjava.api.exception.NotModifiedException;
/**
* Start a container
*/
public class StartContainerCmdImpl extends AbstrDockerCmd<StartContainerCmd, Void> implements StartContainerCmd {
@JsonIgnore
private String containerId;
public StartContainerCmdImpl(StartContainerCmd.Exec exec, String containerId) {
super(exec);
withContainerId(containerId);
}
@Override
public StartContainerCmd withContainerId(String containerId) {
checkNotNull(containerId, "containerId was not specified");
this.containerId = containerId;
return this;
}
@Override
public String getContainerId() {
return containerId;
}
/**
* @throws NotFoundException
* No such container
* @throws NotModifiedException
* Container already started
*/
@Override
public Void exec() throws NotFoundException, NotModifiedException {
return super.exec();
}
}