ContainerManager (Apache Geode 1.7.0)
Date: 2018-09-27

org.apache.geode.session.tests

## Class ContainerManager

- java.lang.Object
- - org.apache.geode.session.tests.ContainerManager

-     public class ContainerManager
      extends java.lang.Object

  Manages multiple J2EE containers using cargo. Provides methods to start and stop J2EE containers and obtain the http ports those containers are listening on.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ContainerManager()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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
    `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

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ContainerManager

          public ContainerManager()

  - ### Method Detail

    - #### numContainers

          public int numContainers()

      Returns:
        the number of containers managed

    - #### cleanUp

          public void cleanUp()
                       throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### addContainer

          public ServerContainer addContainer(ContainerInstall install)
                                       throws java.io.IOException

      Add a new container to manage using the specified installation The container will not be running until one of the start methods is called.
      Throws:
        `java.io.IOException`

    - #### addContainers

          public void addContainers(int numContainers,
                                    ContainerInstall install)
                             throws java.io.IOException

      Add multiple containers to manage using the specified installation. The containers will not be running until one of the start methods is called.
      Throws:
        `java.io.IOException`

    - #### startContainer

          public void startContainer(int index)

      Start the given container

    - #### startContainers

          public void startContainers(java.util.ArrayList<java.lang.Integer> indexes)

      Start all containers specified by the given indexes

    - #### startAllInactiveContainers

          public void startAllInactiveContainers()

      Start all containers that are not currently running.

    - #### stopContainer

          public void stopContainer(int index)

      Stop the given container

    - #### stopContainers

          public void stopContainers(java.util.ArrayList<java.lang.Integer> indexes)

      Stop all containers specified by the given indexes

    - #### stopAllActiveContainers

          public void stopAllActiveContainers()

      Stop all containers that are currently running.

    - #### dumpLogs

          public void dumpLogs()
                        throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### setTestName

          public void setTestName(java.lang.String testName)

      Set the name of the current test Used for debugging so that log files can be easily identified.

    - #### getContainerIndexesWithState

          public java.util.ArrayList<java.lang.Integer> getContainerIndexesWithState(java.lang.String state)

      Get the positions of the containers with the given container state
      Parameters:
        `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.

    - #### getContainersWithState

          public java.util.ArrayList<ServerContainer> getContainersWithState(java.lang.String state)

      Return the cargo container of all of the containers in the given state

    - #### getContainerPort

          public java.lang.String getContainerPort(int index)

      Get the port of the container at the given index

    - #### getContainer

          public ServerContainer getContainer(int index)

      Get the container at the given index

    - #### getContainerDescription

          public java.lang.String getContainerDescription(int index)

      Get a human readable unique description for the container (calls `ServerContainer.toString()`)

    - #### removeContainer

          public ServerContainer removeContainer(int index)

      Remove the container in the given index from the list