Package net.officefloor.docker.test
Class DockerContainerInstance
- java.lang.Object
-
- net.officefloor.docker.test.DockerContainerInstance
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class DockerContainerInstance extends java.lang.Object implements java.lang.AutoCloseable
Instance of running Docker.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description DockerContainerInstance(java.lang.String containerName, java.lang.String imageName, java.lang.String containerId, com.github.dockerjava.api.DockerClient docker)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
<R,T extends java.lang.Throwable>
RconnectToDockerInstance(DockerConnectOperation<R,T> connect)
Undertakes connection to the Docker container instance.
-
-
-
Constructor Detail
-
DockerContainerInstance
public DockerContainerInstance(java.lang.String containerName, java.lang.String imageName, java.lang.String containerId, com.github.dockerjava.api.DockerClient docker)
Instantiate.- Parameters:
containerId
- Identifier for the container of the docker instance.docker
-DockerClient
.
-
-
Method Detail
-
connectToDockerInstance
public <R,T extends java.lang.Throwable> R connectToDockerInstance(DockerConnectOperation<R,T> connect) throws T extends java.lang.Throwable
Undertakes connection to the Docker container instance.- Type Parameters:
R
- Result of connection.T
- Possible failure in connection.- Parameters:
connect
-DockerConnectOperation
.- Returns:
- Result of connection.
- Throws:
T
- Possible failure in connection.T extends java.lang.Throwable
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-