public final class ResourceReaper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static ResourceReaper |
instance() |
void |
performCleanup()
Perform a cleanup.
|
void |
registerContainerForCleanup(java.lang.String containerId,
java.lang.String imageName)
Register a container to be cleaned up, either on explicit call to stopAndRemoveContainer, or at JVM shutdown.
|
void |
registerFilterForCleanup(java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> filter)
Register a filter to be cleaned up.
|
void |
registerNetworkForCleanup(java.lang.String networkName)
Deprecated.
|
void |
registerNetworkIdForCleanup(java.lang.String id)
Register a network to be cleaned up at JVM shutdown.
|
void |
removeNetworkById(java.lang.String id)
Removes a network by ID.
|
void |
removeNetworks(java.lang.String identifier)
Deprecated.
|
static java.lang.String |
start(java.lang.String hostIpAddress,
com.github.dockerjava.api.DockerClient client) |
static java.lang.String |
start(java.lang.String hostIpAddress,
com.github.dockerjava.api.DockerClient client,
boolean withDummyMount)
Deprecated.
|
void |
stopAndRemoveContainer(java.lang.String containerId)
Stop a potentially running container and remove it, including associated volumes.
|
void |
stopAndRemoveContainer(java.lang.String containerId,
java.lang.String imageName)
Stop a potentially running container and remove it, including associated volumes.
|
void |
unregisterContainer(java.lang.String identifier) |
void |
unregisterNetwork(java.lang.String identifier) |
@Deprecated public static java.lang.String start(java.lang.String hostIpAddress, com.github.dockerjava.api.DockerClient client, boolean withDummyMount)
public static java.lang.String start(java.lang.String hostIpAddress, com.github.dockerjava.api.DockerClient client)
public static ResourceReaper instance()
public void performCleanup()
public void registerFilterForCleanup(java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> filter)
filter
- the filterpublic void registerContainerForCleanup(java.lang.String containerId, java.lang.String imageName)
containerId
- the ID of the containerimageName
- the image name of the container (used for logging)public void stopAndRemoveContainer(java.lang.String containerId)
containerId
- the ID of the containerpublic void stopAndRemoveContainer(java.lang.String containerId, java.lang.String imageName)
containerId
- the ID of the containerimageName
- the image name of the container (used for logging)public void registerNetworkIdForCleanup(java.lang.String id)
id
- the ID of the network@Deprecated public void registerNetworkForCleanup(java.lang.String networkName)
registerNetworkIdForCleanup(String)
networkName
- the name of the networkpublic void removeNetworkById(java.lang.String id)
id
- @Deprecated public void removeNetworks(java.lang.String identifier)
removeNetworkById(String)
identifier
- public void unregisterNetwork(java.lang.String identifier)
public void unregisterContainer(java.lang.String identifier)