org.apache.catalina.storeconfig

## Class StoreConfig

- java.lang.Object
- - org.apache.catalina.storeconfig.StoreConfig

- All Implemented Interfaces:
    IStoreConfig

      public class StoreConfig
      extends Object
      implements IStoreConfig

  Store Server/Service/Host/Context at file or PrintWriter. Default server.xml is at $catalina.base/conf/server.xml

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static StringManager` | `sm`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StoreConfig()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `StoreRegistry` | `getRegistry()` Get the StoreRegistry with all factory to generate the server.xml/context.xml files.
    `Server` | `getServer()` Get associated server
    `String` | `getServerFilename()` Get server.xml location
    `void` | `setRegistry(StoreRegistry aRegistry)` set StoreRegistry
    `void` | `setServer(Server aServer)` Set associated server
    `void` | `setServerFilename(String string)` Set new server.xml location.
    `boolean` | `store(Context aContext)` Store the specified Context properties.
    `void` | `store(PrintWriter aWriter, int indent, Context aContext)` Store the specified Context properties.
    `void` | `store(PrintWriter aWriter, int indent, Host aHost)` Store the specified Host properties.
    `void` | `store(PrintWriter writer, int indent, Server aServer)` Store the specified Server properties.
    `void` | `store(PrintWriter aWriter, int indent, Service aService)` Store the specified Service properties.
    `boolean` | `store(Server aServer)` Write the configuration information for this entire `Server` out to the server.xml configuration file.
    `void` | `storeConfig()` Store current Server.
    `void` | `storeContext(String aContextName, boolean backup, boolean externalAllowed)` Store a Context from ObjectName.
    `void` | `storeServer(String aServerName, boolean backup, boolean externalAllowed)` Store Server from Object Name (Catalina:type=Server).

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

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

- - ### Field Detail

    - #### sm

          protected static final StringManager sm

  - ### Constructor Detail

    - #### StoreConfig

          public StoreConfig()

  - ### Method Detail

    - #### getServerFilename

          public String getServerFilename()

      Get server.xml location
      Returns:
        The server file name

    - #### setServerFilename

          public void setServerFilename(String string)

      Set new server.xml location.
      Parameters:
        `string` - The server.xml location

    - #### getRegistry

          public StoreRegistry getRegistry()

      Get the StoreRegistry with all factory to generate the server.xml/context.xml files.
      Specified by:
        `getRegistry` in interface `IStoreConfig`
      Returns:
        aRegistry that handle the store operations
      See Also:
        `IStoreConfig.getRegistry()`

    - #### setServer

          public void setServer(Server aServer)

      Description copied from interface: `IStoreConfig`
      Set associated server
      Specified by:
        `setServer` in interface `IStoreConfig`
      Parameters:
        `aServer` - the associated server

    - #### getServer

          public Server getServer()

      Description copied from interface: `IStoreConfig`
      Get associated server
      Specified by:
        `getServer` in interface `IStoreConfig`
      Returns:
        aServer the associated server

    - #### setRegistry

          public void setRegistry(StoreRegistry aRegistry)

      set StoreRegistry
      Specified by:
        `setRegistry` in interface `IStoreConfig`
      Parameters:
        `aRegistry` - aregistry that handle the store operations
      See Also:
        `IStoreConfig.setRegistry(org.apache.catalina.storeconfig.StoreRegistry)`

    - #### storeConfig

          public void storeConfig()

      Store current Server.
      Specified by:
        `storeConfig` in interface `IStoreConfig`

    - #### storeServer

          public void storeServer(String aServerName,
                         boolean backup,
                         boolean externalAllowed)
                           throws MalformedObjectNameException

      Store Server from Object Name (Catalina:type=Server).
      Parameters:
        `aServerName` - Server ObjectName
        `backup` - `true` to backup existing configuration files before rewriting them
        `externalAllowed` - `true` to allow saving webapp configuration for webapps that are not inside the host's app directory
      Throws:
        `MalformedObjectNameException` - Bad MBean name

    - #### storeContext

          public void storeContext(String aContextName,
                          boolean backup,
                          boolean externalAllowed)
                            throws MalformedObjectNameException

      Store a Context from ObjectName.
      Parameters:
        `aContextName` - MBean ObjectName
        `backup` - `true` to backup existing configuration files before rewriting them
        `externalAllowed` - `true` to allow saving webapp configuration for webapps that are not inside the host's app directory
      Throws:
        `MalformedObjectNameException` - Bad MBean name

    - #### store

          public boolean store(Server aServer)

      Write the configuration information for this entire `Server` out to the server.xml configuration file.
      Specified by:
        `store` in interface `IStoreConfig`
      Parameters:
        `aServer` - Server instance
      Returns:
        `true` if the store operation was successful

    - #### store

          public boolean store(Context aContext)

      Description copied from interface: `IStoreConfig`
      Store the specified Context properties.
      Specified by:
        `store` in interface `IStoreConfig`
      Parameters:
        `aContext` - Object to be stored
      Returns:
        `true` if the store operation was successful
      See Also:
        `IStoreConfig.store(org.apache.catalina.Context)`

    - #### store

          public void store(PrintWriter aWriter,
                   int indent,
                   Context aContext)
                     throws Exception

      Description copied from interface: `IStoreConfig`
      Store the specified Context properties.
      Specified by:
        `store` in interface `IStoreConfig`
      Parameters:
        `aWriter` - PrintWriter to which we are storing
        `indent` - Number of spaces to indent this element
        `aContext` - Object to be stored
      Throws:
        `Exception` - Store error occurred
      See Also:
        `IStoreConfig.store(java.io.PrintWriter, int, org.apache.catalina.Context)`

    - #### store

          public void store(PrintWriter aWriter,
                   int indent,
                   Host aHost)
                     throws Exception

      Description copied from interface: `IStoreConfig`
      Store the specified Host properties.
      Specified by:
        `store` in interface `IStoreConfig`
      Parameters:
        `aWriter` - PrintWriter to which we are storing
        `indent` - Number of spaces to indent this element
        `aHost` - Object to be stored
      Throws:
        `Exception` - Store error occurred
      See Also:
        `IStoreConfig.store(java.io.PrintWriter, int, org.apache.catalina.Host)`

    - #### store

          public void store(PrintWriter aWriter,
                   int indent,
                   Service aService)
                     throws Exception

      Description copied from interface: `IStoreConfig`
      Store the specified Service properties.
      Specified by:
        `store` in interface `IStoreConfig`
      Parameters:
        `aWriter` - PrintWriter to which we are storing
        `indent` - Number of spaces to indent this element
        `aService` - Object to be stored
      Throws:
        `Exception` - Store error occurred
      See Also:
        `IStoreConfig.store(java.io.PrintWriter, int, org.apache.catalina.Service)`

    - #### store

          public void store(PrintWriter writer,
                   int indent,
                   Server aServer)
                     throws Exception

      Description copied from interface: `IStoreConfig`
      Store the specified Server properties.
      Specified by:
        `store` in interface `IStoreConfig`
      Parameters:
        `writer` - PrintWriter to which we are storing
        `indent` - Number of spaces to indent this element
        `aServer` - Object to be stored
      Throws:
        `Exception` - Store error occurred
      See Also:
        `IStoreConfig.store(java.io.PrintWriter, int, org.apache.catalina.Server)`

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.