public class ContainerManager
extends java.lang.Object
Constructor and Description |
---|
ContainerManager() |
Modifier and Type | Method and Description |
---|---|
ServerContainer |
addContainer(ContainerInstall install)
Add a new container to manage using the specified installation
The container will not be running until one of the start methods is called.
|
void |
addContainers(int numContainers,
ContainerInstall install)
Add multiple containers to manage using the specified installation.
|
void |
cleanUp() |
void |
dumpLogs() |
ServerContainer |
getContainer(int index)
Get the container at the given index
|
java.lang.String |
getContainerDescription(int index)
Get a human readable unique description for the container (calls
ServerContainer.toString() ) |
java.util.ArrayList<java.lang.Integer> |
getContainerIndexesWithState(java.lang.String state)
Get the positions of the containers with the given container state
|
java.lang.String |
getContainerPort(int index)
Get the port of the container at the given index
|
java.util.ArrayList<ServerContainer> |
getContainersWithState(java.lang.String state)
Return the cargo container of all of the containers in the given state
|
int |
numContainers() |
ServerContainer |
removeContainer(int index)
Remove the container in the given index from the list
|
boolean |
removeContainer(ServerContainer container)
Remove the given container
|
void |
setTestName(java.lang.String testName)
Set the name of the current test
Used for debugging so that log files can be easily identified.
|
void |
startAllInactiveContainers()
Start all containers that are not currently running.
|
void |
startContainer(int index)
Start the given container
|
void |
startContainers(java.util.ArrayList<java.lang.Integer> indexes)
Start all containers specified by the given indexes
|
void |
stopAllActiveContainers()
Stop all containers that are currently running.
|
void |
stopContainer(int index)
Stop the given container
|
void |
stopContainers(java.util.ArrayList<java.lang.Integer> indexes)
Stop all containers specified by the given indexes
|
public int numContainers()
public void cleanUp() throws java.io.IOException
java.io.IOException
public ServerContainer addContainer(ContainerInstall install) throws java.io.IOException
java.io.IOException
public void addContainers(int numContainers, ContainerInstall install) throws java.io.IOException
java.io.IOException
public void startContainer(int index)
public void startContainers(java.util.ArrayList<java.lang.Integer> indexes)
public void startAllInactiveContainers()
public void stopContainer(int index)
public void stopContainers(java.util.ArrayList<java.lang.Integer> indexes)
public void stopAllActiveContainers()
public void dumpLogs() throws java.io.IOException
java.io.IOException
public void setTestName(java.lang.String testName)
public java.util.ArrayList<java.lang.Integer> getContainerIndexesWithState(java.lang.String state)
state
- A string representing the Cargo state a container is in. The possible states can
be found in as static variables in the State
class.public java.util.ArrayList<ServerContainer> getContainersWithState(java.lang.String state)
public java.lang.String getContainerPort(int index)
public ServerContainer getContainer(int index)
public java.lang.String getContainerDescription(int index)
ServerContainer.toString()
)public ServerContainer removeContainer(int index)
public boolean removeContainer(ServerContainer container)