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

org.apache.geode.session.tests

## Class TomcatInstall

- java.lang.Object
- - org.apache.geode.session.tests.ContainerInstall
  - - org.apache.geode.session.tests.TomcatInstall

-     public class TomcatInstall
      extends ContainerInstall

  Tomcat specific container installation class Provides logic for installation of tomcat. This makes the modifications to the tomcat install as described in the geode docs.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TomcatInstall.TomcatVersion` Version of tomcat that this class will install Includes the download URL for the each version, the version number associated with each version, and other properties or XML attributes needed to setup tomcat containers within Cargo

    - ### Nested classes/interfaces inherited from class org.apache.geode.session.tests.ContainerInstall

      `ContainerInstall.ConnectionType`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `GEODE_BUILD_HOME_LIB`

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

      `DEFAULT_INSTALL_DIR, DEFAULT_MODULE_EXTRACTION_DIR, DEFAULT_MODULE_LOCATION, GEODE_BUILD_HOME, logger, TMP_DIR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TomcatInstall(TomcatInstall.TomcatVersion version, ContainerInstall.ConnectionType connType, java.lang.String installDir)`
    `TomcatInstall(TomcatInstall.TomcatVersion version, ContainerInstall.ConnectionType connType, java.lang.String installDir, java.lang.String modulesJarLocation, java.lang.String extraJarsPath)` Download and setup an installation tomcat using the `ContainerInstall` constructor and some extra functions this class provides Specifically, this function uses `copyTomcatGeodeReqFiles(String, String)` to install geode session into Tomcat, `setupDefaultSettings()` to modify the context and server XML files within the installation's 'conf' folder, and `updateProperties()` to set the jar skipping properties needed to speedup container startup.
    `TomcatInstall(TomcatInstall.TomcatVersion version, java.lang.String installDir)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TomcatContainer` | `generateContainer(java.io.File containerConfigHome, java.lang.String containerDescriptors)` Implementation of `ContainerInstall.generateContainer(File, String)`, which generates a Tomcat specific container Creates a `TomcatContainer` instance off of this installation.
    `java.lang.String` | `getContextSessionManagerClass()` Implements `ContainerInstall.getContextSessionManagerClass()` Gets the TomcatDeltaSessionManager class associated with this `version`.
    `java.io.File` | `getDefaultContextXMLFile()` Location of the context XML file in the installation's 'conf' directory
    `java.io.File` | `getDefaultServerXMLFile()` Location of the server XML file in the installation's 'conf' directory
    `java.lang.String` | `getInstallDescription()` A human readable description of the installation
    `java.lang.String` | `getInstallId()` The cargo specific installation id needed to setup a cargo container Based on the installation's `version`.
    `java.lang.String` | `getServerLifeCycleListenerClass()` Get the server life cycle class that should be used Generates the class based on whether the installation's connection type `ContainerInstall.connType` is client server or peer to peer.
    `void` | `setupDefaultSettings()` Modifies the context and server XML files in the installation's 'conf' directory so that they contain the session manager class (`getContextSessionManagerClass()`) and life cycle listener class (`getServerLifeCycleListenerClass()`) respectively

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

      `clearPreviousInstall, editPropertyFile, editXMLFile, editXMLFile, editXMLFile, editXMLFile, editXMLFile, findAndExtractModule, findSessionTestingWar, generateContainer, generateContainer, getCacheXMLFile, getConnectionType, getDefaultLocatorAddress, getDefaultLocatorPort, getHome, getModulePath, getWarFilePath, isClientServer, setDefaultLocator`

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

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

- - ### Field Detail

    - #### GEODE_BUILD_HOME_LIB

          public static final java.lang.String GEODE_BUILD_HOME_LIB

  - ### Constructor Detail

    - #### TomcatInstall

          public TomcatInstall(TomcatInstall.TomcatVersion version,
                               java.lang.String installDir)
                        throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### TomcatInstall

          public TomcatInstall(TomcatInstall.TomcatVersion version,
                               ContainerInstall.ConnectionType connType,
                               java.lang.String installDir)
                        throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### TomcatInstall

          public TomcatInstall(TomcatInstall.TomcatVersion version,
                               ContainerInstall.ConnectionType connType,
                               java.lang.String installDir,
                               java.lang.String modulesJarLocation,
                               java.lang.String extraJarsPath)
                        throws java.lang.Exception

      Download and setup an installation tomcat using the `ContainerInstall` constructor and some extra functions this class provides Specifically, this function uses `copyTomcatGeodeReqFiles(String, String)` to install geode session into Tomcat, `setupDefaultSettings()` to modify the context and server XML files within the installation's 'conf' folder, and `updateProperties()` to set the jar skipping properties needed to speedup container startup.
      Throws:
        `java.lang.Exception`

  - ### Method Detail

    - #### setupDefaultSettings

          public void setupDefaultSettings()

      Modifies the context and server XML files in the installation's 'conf' directory so that they contain the session manager class (`getContextSessionManagerClass()`) and life cycle listener class (`getServerLifeCycleListenerClass()`) respectively

    - #### getServerLifeCycleListenerClass

          public java.lang.String getServerLifeCycleListenerClass()

      Get the server life cycle class that should be used Generates the class based on whether the installation's connection type `ContainerInstall.connType` is client server or peer to peer.

    - #### getDefaultContextXMLFile

          public java.io.File getDefaultContextXMLFile()

      Location of the context XML file in the installation's 'conf' directory

    - #### getDefaultServerXMLFile

          public java.io.File getDefaultServerXMLFile()

      Location of the server XML file in the installation's 'conf' directory

    - #### getContextSessionManagerClass

          public java.lang.String getContextSessionManagerClass()

      Implements `ContainerInstall.getContextSessionManagerClass()` Gets the TomcatDeltaSessionManager class associated with this `version`. Use's the `version`'s toInteger function to do so.
      Specified by:
        `getContextSessionManagerClass` in class `ContainerInstall`

    - #### generateContainer

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

      Implementation of `ContainerInstall.generateContainer(File, String)`, which generates a Tomcat specific container Creates a `TomcatContainer` instance off of this installation.
      Specified by:
        `generateContainer` in class `ContainerInstall`
      Parameters:
        `containerDescriptors` - Additional descriptors used to identify a container
      Throws:
        `java.io.IOException`

    - #### getInstallId

          public java.lang.String getInstallId()

      The cargo specific installation id needed to setup a cargo container Based on the installation's `version`.
      Specified by:
        `getInstallId` in class `ContainerInstall`

    - #### getInstallDescription

          public java.lang.String getInstallDescription()

      Description copied from class: `ContainerInstall`
      A human readable description of the installation
      Specified by:
        `getInstallDescription` in class `ContainerInstall`
      See Also:
        `ContainerInstall.getInstallDescription()`