org.apache.catalina.storeconfig

## Class ConnectorStoreAppender

- java.lang.Object
- - org.apache.catalina.storeconfig.StoreAppender
  - - org.apache.catalina.storeconfig.ConnectorStoreAppender

-     public class ConnectorStoreAppender
      extends StoreAppender

  Store the Connector attributes. Connector has really special design. A Connector is only a startup Wrapper for a ProtocolHandler. This meant that ProtocolHandler get all there attributes from the Connector attribute map. Strange is that some attributes change there name and the attribute sslProtocol need a special handling

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static HashMap<String,String>` | `replacements`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConnectorStoreAppender()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected File` | `getCatalinaBase()`
    `protected File` | `getJkHomeBase(String jkHome, File appBase)`
    `protected List<String>` | `getPropertyKeys(Connector bean)` Get all properties from Connector and current ProtocolHandler.
    `boolean` | `isPrintValue(Object bean, Object bean2, String attrName, StoreDescription desc)` Print Connector Values.
    `void` | `printAttributes(PrintWriter writer, int indent, boolean include, Object bean, StoreDescription desc)` Store the relevant attributes of the specified JavaBean.
    `void` | `printOpenTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc)` Print the open tag for connector attributes (override).
    `void` | `printTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc)` Print a tag for connector attributes (override).
    `void` | `printValue(PrintWriter writer, int indent, String name, Object value)` Print a value but replace certain attribute names.
    `protected void` | `storeConnectorAttributes(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc)` Print Attributes for the connector

    - ### Methods inherited from class org.apache.catalina.storeconfig.StoreAppender

      `checkAttribute, convertStr, defaultInstance, isPersistable, printAttribute, printAttributes, printCloseTag, printIndent, printTagArray, printTagContent, printTagValueArray`

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

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

- - ### Field Detail

    - #### replacements

          protected static final HashMap<String,String> replacements

  - ### Constructor Detail

    - #### ConnectorStoreAppender

          public ConnectorStoreAppender()

  - ### Method Detail

    - #### printAttributes

          public void printAttributes(PrintWriter writer,
                             int indent,
                             boolean include,
                             Object bean,
                             StoreDescription desc)
                               throws Exception

      Description copied from class: `StoreAppender`
      Store the relevant attributes of the specified JavaBean.
      Overrides:
        `printAttributes` in class `StoreAppender`
      Parameters:
        `writer` - PrintWriter to which we are storing
        `indent` - Indentation level
        `include` - Should we include a `className` attribute?
        `bean` - Bean whose properties are to be rendered as attributes,
        `desc` - RegistryDescriptor from this bean
      Throws:
        `Exception` - if an exception occurs while storing

    - #### getPropertyKeys

          protected List<String> getPropertyKeys(Connector bean)
                                          throws IntrospectionException

      Get all properties from Connector and current ProtocolHandler.
      Parameters:
        `bean` - The connector
      Returns:
        List of Connector property names
      Throws:
        `IntrospectionException` - Error intropecting connector

    - #### storeConnectorAttributes

          protected void storeConnectorAttributes(PrintWriter aWriter,
                                      int indent,
                                      Object bean,
                                      StoreDescription aDesc)
                                           throws Exception

      Print Attributes for the connector
      Parameters:
        `aWriter` - Current writer
        `indent` - Indentation level
        `bean` - The connector bean
        `aDesc` - The connector description
      Throws:
        `Exception` - Store error occurred

    - #### printOpenTag

          public void printOpenTag(PrintWriter aWriter,
                          int indent,
                          Object bean,
                          StoreDescription aDesc)
                            throws Exception

      Print the open tag for connector attributes (override).
      Overrides:
        `printOpenTag` in class `StoreAppender`
      Parameters:
        `aWriter` - The output writer
        `indent` - Indentation level
        `bean` - The current bean that is stored
        `aDesc` - Store description of the current element
      Throws:
        `Exception` - A store error occurred
      See Also:
        `StoreAppender.printOpenTag(java.io.PrintWriter, int, java.lang.Object, org.apache.catalina.storeconfig.StoreDescription)`

    - #### printTag

          public void printTag(PrintWriter aWriter,
                      int indent,
                      Object bean,
                      StoreDescription aDesc)
                        throws Exception

      Print a tag for connector attributes (override).
      Overrides:
        `printTag` in class `StoreAppender`
      Parameters:
        `aWriter` - The output writer
        `indent` - Indentation level
        `bean` - The current bean that is stored
        `aDesc` - Store description of the current element
      Throws:
        `Exception` - A store error occurred
      See Also:
        `StoreAppender.printTag(java.io.PrintWriter, int, java.lang.Object, org.apache.catalina.storeconfig.StoreDescription)`

    - #### printValue

          public void printValue(PrintWriter writer,
                        int indent,
                        String name,
                        Object value)

      Print a value but replace certain attribute names.
      Overrides:
        `printValue` in class `StoreAppender`
      Parameters:
        `writer` - PrintWriter to which we are storing
        `indent` - Indentation level
        `name` - Attribute name
        `value` - Attribute value
      See Also:
        `StoreAppender.printValue(java.io.PrintWriter, int, java.lang.String, java.lang.Object)`

    - #### isPrintValue

          public boolean isPrintValue(Object bean,
                             Object bean2,
                             String attrName,
                             StoreDescription desc)

      Print Connector Values.
      - Special handling to default jkHome.
      - Don't save catalina.base path at server.xml
      Overrides:
        `isPrintValue` in class `StoreAppender`
      Parameters:
        `bean` - original bean
        `bean2` - default bean
        `attrName` - attribute name
        `desc` - StoreDescription from bean
      Returns:
        `true` if the value should be stored
      See Also:
        `StoreAppender.isPrintValue(java.lang.Object, java.lang.Object, java.lang.String, org.apache.catalina.storeconfig.StoreDescription)`

    - #### getCatalinaBase

          protected File getCatalinaBase()

    - #### getJkHomeBase

          protected File getJkHomeBase(String jkHome,
                           File appBase)

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