TomcatContainer (Apache Geode 1.8.0)
Date: 2018-11-29

org.apache.geode.session.tests

## Class TomcatContainer

- java.lang.Object
- - org.apache.geode.session.tests.ServerContainer
  - - org.apache.geode.session.tests.TomcatContainer

-     public class TomcatContainer
      extends ServerContainer

  Container for a tomcat installation Extends `ServerContainer` to form a basic container which sets up and configures a Tomcat container.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEFAULT_TOMCAT_CONFIG_XML_DIR`
    `static java.lang.String` | `DEFAULT_TOMCAT_CONTEXT_XML_REPLACEMENT_NAME`
    `static java.lang.String` | `DEFAULT_TOMCAT_XML_REPLACEMENT_DIR`

    - ### Fields inherited from class org.apache.geode.session.tests.ServerContainer

      `cacheProperties, cacheXMLFile, DEFAULT_CONF_DIR, DEFAULT_CONFIG_DIR, DEFAULT_LOG_DIR, DEFAULT_LOGGING_LEVEL, description, gemfireLogFile, logDir, logger, loggingLevel, systemProperties`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TomcatContainer(TomcatInstall install, java.io.File containerConfigHome, java.lang.String containerDescriptors)` Setup the Tomcat container Sets up a configuration for the container using the specified installation and configuration home.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getAJPPort()` Get the AJP port of this container using `ServerContainer.getPort()` with the argument `TomcatPropertySet.AJP_PORT`
    `void` | `writeSettings()` Implements the `ServerContainer.writeSettings()` function in order to write the proper settings to the container Method uses the `ContainerInstall.editXMLFile(String, String, String, String, HashMap)` to edit the `contextXMLFile` with the `ServerContainer.cacheProperties`.

    - ### Methods inherited from class org.apache.geode.session.tests.ServerContainer

      `cleanUp, deployWar, dumpLogs, generateUniqueContainerDescription, getCacheProperty, getConfiguration, getContainer, getInstall, getLoggingLevel, getPort, getPort, getRMIPort, getState, getSystemProperty, getWarFile, setCacheProperty, setCacheXMLFile, setLocator, setLoggingLevel, setSystemProperty, setWarFile, start, stop, toString`

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

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

- - ### Field Detail

    - #### DEFAULT_TOMCAT_CONFIG_XML_DIR

          public static final java.lang.String DEFAULT_TOMCAT_CONFIG_XML_DIR

      See Also:
        Constant Field Values

    - #### DEFAULT_TOMCAT_XML_REPLACEMENT_DIR

          public static final java.lang.String DEFAULT_TOMCAT_XML_REPLACEMENT_DIR

      See Also:
        Constant Field Values

    - #### DEFAULT_TOMCAT_CONTEXT_XML_REPLACEMENT_NAME

          public static final java.lang.String DEFAULT_TOMCAT_CONTEXT_XML_REPLACEMENT_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TomcatContainer

          public TomcatContainer(TomcatInstall install,
                                 java.io.File containerConfigHome,
                                 java.lang.String containerDescriptors)
                          throws java.io.IOException

      Setup the Tomcat container Sets up a configuration for the container using the specified installation and configuration home. Finds and sets up the server.xml and context.xml files needed to specify container properties, deploys the session testing WAR file to the Cargo container, and sets various container properties (i.e. locator, local cache, etc.)
      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### getAJPPort

          public java.lang.String getAJPPort()

      Get the AJP port of this container using `ServerContainer.getPort()` with the argument `TomcatPropertySet.AJP_PORT`

    - #### writeSettings

          public void writeSettings()
                             throws java.io.IOException

      Implements the `ServerContainer.writeSettings()` function in order to write the proper settings to the container Method uses the `ContainerInstall.editXMLFile(String, String, String, String, HashMap)` to edit the `contextXMLFile` with the `ServerContainer.cacheProperties`. Method uses `writePropertiesToConfig(StandaloneLocalConfiguration, String, String, HashMap)` to write the `ServerContainer.systemProperties` to the `serverXMLFile` using the container's configuration (obtained from `ServerContainer.getConfiguration()`).
      Specified by:
        `writeSettings` in class `ServerContainer`
      Throws:
        `java.io.IOException`