/*
 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
 * agreements. See the NOTICE file distributed with this work for additional information regarding
 * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the License. You may obtain a
 * copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package org.apache.geode.internal.cache.xmlcache;

import java.io.IOException;
import java.io.InputStream;
import java.util.ServiceLoader;

import org.xml.sax.Attributes;
import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXParseException;
import org.xml.sax.ext.EntityResolver2;

import org.apache.geode.cache.CacheXmlException;
import org.apache.geode.distributed.ConfigurationProperties;
import org.apache.geode.internal.classloader.ClassPathLoader;

/**
 * The abstract superclass of classes that convert XML into a {@link org.apache.geode.cache.Cache}
 * and vice versa. It provides helper methods and constants.
 *
 * @since GemFire 3.0
 */
public abstract class CacheXml implements EntityResolver2, ErrorHandler {

  /**
   * This always refers to the latest GemFire version, in those cases where we default to the
   * current released version of GemFire.
   *
   * Whenever you upgrade the DTD, you will need to search for occurrences of the previous version
   * strings and upgrade them as well.
   *
   * @since GemFire 5.5
   */
  public static final String VERSION_LATEST = CacheXml.VERSION_1_0;

  /**
   * @deprecated As of 8.1 use {@link #GEODE_NAMESPACE}
   */
  @Deprecated
  public static final String LATEST_SYSTEM_ID = CacheXml.SYSTEM_ID_8_0;

  /**
   * @deprecated As of 8.1 use {@link #GEODE_NAMESPACE}.
   */
  @Deprecated
  public static final String LATEST_PUBLIC_ID = CacheXml.PUBLIC_ID_8_0;

  /**
   * Namespace URI for older, GemFire {@link CacheXml} documents.
   *
   * @since GemFire 8.1
   */
  public static final String GEMFIRE_NAMESPACE = "http://schema.pivotal.io/gemfire/cache";

  /**
   * Namespace URI for {@link CacheXml} documents.
   *
   * @since GemFire 8.1
   */
  public static final String GEODE_NAMESPACE = "http://geode.apache.org/schema/cache";

  /**
   * Namespace prefix for {@link CacheXml} documents.
   *
   * @since GemFire 8.1
   */
  public static final String PREFIX = "cache";

  /**
   * Latest schema location for {@link #GEODE_NAMESPACE}.
   *
   * @since GemFire 8.1
   */
  public static final String LATEST_SCHEMA_LOCATION = CacheXml.SCHEMA_1_0_LOCATION;

  /**
   * Location of the latest DTD file for Gemfire
   *
   * @deprecated As of 8.1 use {@link #LATEST_SCHEMA_LOCATION}
   */
  @Deprecated
  public static final String LATEST_DTD_LOCATION = CacheXml.DTD_8_0_LOCATION;

  /**
   * Version string for GemFire 8.1
   *
   * @since GemFire 8.1
   */
  public static final String VERSION_8_1 = "8.1";

  /**
   * Version string for Geode 1.0
   *
   * @since Geode 1.0
   */
  public static final String VERSION_1_0 = "1.0";

  /**
   * The location of the GemFire 8.1 schema file.
   *
   * @since GemFire 8.1
   */
  public static final String SCHEMA_8_1_LOCATION =
      "http://schema.pivotal.io/gemfire/cache/cache-8.1.xsd";
  /**
   * The location of the Geode 1.0 schema file.
   *
   * @since Geode 1.0
   */
  protected static final String SCHEMA_1_0_LOCATION =
      "http://geode.apache.org/schema/cache/cache-1.0.xsd";

  // ---------------------------------
  /** Version string for GemFire 8.0 */
  public static final String VERSION_8_0 = "8_0";
  /** The location of the GemFire 8.0 DTD file */
  protected static final String DTD_8_0_LOCATION = "/org/apache/geode/cache/doc-files/cache8_0.dtd";
  /** The URL for the 8.0 DTD */
  protected static final String SYSTEM_ID_8_0 = "http://www.gemstone.com/dtd/cache8_0.dtd";
  /** The public ID for the 8.0 DTD */
  protected static final String PUBLIC_ID_8_0 =
      "-//GemStone Systems, Inc.//GemFire Declarative Cache 8.0//EN";

  // ---------------------------------
  /** Version string for GemFire 7.0 */
  public static final String VERSION_7_0 = "7_0";
  /** The location of the GemFire 7.0 DTD file */
  protected static final String DTD_7_0_LOCATION = "/org/apache/geode/cache/doc-files/cache7_0.dtd";
  /** The URL for the 7.0 DTD */
  protected static final String SYSTEM_ID_7_0 = "http://www.gemstone.com/dtd/cache7_0.dtd";
  /** The public ID for the 7.0 DTD */
  protected static final String PUBLIC_ID_7_0 =
      "-//GemStone Systems, Inc.//GemFire Declarative Cache 7.0//EN";

  // ---------------------------------
  /** Version string for GemFire 6.6 */
  public static final String VERSION_6_6 = "6_6";
  /** The location of the GemFire 6.6 DTD file */
  protected static final String DTD_6_6_LOCATION = "/org/apache/geode/cache/doc-files/cache6_6.dtd";
  /** The URL for the 6.6 DTD */
  protected static final String SYSTEM_ID_6_6 = "http://www.gemstone.com/dtd/cache6_6.dtd";
  /** The public ID for the 6.6 DTD */
  protected static final String PUBLIC_ID_6_6 =
      "-//GemStone Systems, Inc.//GemFire Declarative Cache 6.6//EN";

  // ---------------------------------
  /** Version string for GemFire 6.5 */
  public static final String VERSION_6_5 = "6_5";
  /** The location of the GemFire 6.5 DTD file */
  protected static final String DTD_6_5_LOCATION = "/org/apache/geode/cache/doc-files/cache6_5.dtd";
  /** The URL for the 6.5 DTD */
  protected static final String SYSTEM_ID_6_5 = "http://www.gemstone.com/dtd/cache6_5.dtd";
  /** The public ID for the 6.5 DTD */
  protected static final String PUBLIC_ID_6_5 =
      "-//GemStone Systems, Inc.//GemFire Declarative Cache 6.5//EN";

  // ---------------------------------
  /** Version string for GemFire 6.1 */
  public static final String VERSION_6_1 = "6_1";
  /** The location of the GemFire 6.1 DTD file */
  protected static final String DTD_6_1_LOCATION = "/org/apache/geode/cache/doc-files/cache6_1.dtd";
  /** The URL for the 6.1 DTD */
  protected static final String SYSTEM_ID_6_1 = "http://www.gemstone.com/dtd/cache6_1.dtd";
  /** The public ID for the 6.1 DTD */
  protected static final String PUBLIC_ID_6_1 =
      "-//GemStone Systems, Inc.//GemFire Declarative Cache 6.1//EN";

  // ---------------------------------
  /** Version string for GemFire 6.0 */
  public static final String VERSION_6_0 = "6_0";
  /** The location of the GemFire 6.0 DTD file */
  protected static final String DTD_6_0_LOCATION = "/org/apache/geode/cache/doc-files/cache6_0.dtd";
  /** The URL for the 6.0 DTD */
  protected static final String SYSTEM_ID_6_0 = "http://www.gemstone.com/dtd/cache6_0.dtd";
  /** The public ID for the 6.0 DTD */
  protected static final String PUBLIC_ID_6_0 =
      "-//GemStone Systems, Inc.//GemFire Declarative Cache 6.0//EN";

  // ---------------------------------
  /** Version string for GemFire 5.8 */
  public static final String VERSION_5_8 = "5_8";
  /** The location of the GemFire 5.8 DTD file */
  protected static final String DTD_5_8_LOCATION = "/org/apache/geode/cache/doc-files/cache5_8.dtd";
  /** The URL for the 5.8 DTD */
  protected static final String SYSTEM_ID_5_8 = "http://www.gemstone.com/dtd/cache5_8.dtd";
  /** The public ID for the 5.8 DTD */
  protected static final String PUBLIC_ID_5_8 =
      "-//GemStone Systems, Inc.//GemFire Declarative Cache 5.8//EN";

  // ---------------------------------
  /** Version string for GemFire 5.7 */
  public static final String VERSION_5_7 = "5_7";
  /** The location of the GemFire 5.7 DTD file */
  protected static final String DTD_5_7_LOCATION = "/org/apache/geode/cache/doc-files/cache5_7.dtd";
  /** The URL for the 5.7 DTD */
  protected static final String SYSTEM_ID_5_7 = "http://www.gemstone.com/dtd/cache5_7.dtd";
  /** The public ID for the 5.7 DTD */
  protected static final String PUBLIC_ID_5_7 =
      "-//GemStone Systems, Inc.//GemFire Declarative Cache 5.7//EN";

  // ---------------------------------
  /** Version string for GemFire 5.5 */
  public static final String VERSION_5_5 = "5_5";
  /** The location of the GemFire 5.5 DTD file */
  protected static final String DTD_5_5_LOCATION = "/org/apache/geode/cache/doc-files/cache5_5.dtd";
  /** The URL for the 5.5 DTD */
  protected static final String SYSTEM_ID_5_5 = "http://www.gemstone.com/dtd/cache5_5.dtd";
  /** The public ID for the 5.5 DTD */
  protected static final String PUBLIC_ID_5_5 =
      "-//GemStone Systems, Inc.//GemFire Declarative Cache 5.5//EN";

  // ---------------------------------
  /** Version string for GemFire 5.1 */
  public static final String VERSION_5_1 = "5_1";
  /** The location of the GemFire 5.1 DTD file */
  protected static final String DTD_5_1_LOCATION = "/org/apache/geode/cache/doc-files/cache5_1.dtd";
  /** The URL for the 5.1 DTD */
  protected static final String SYSTEM_ID_5_1 = "http://www.gemstone.com/dtd/cache5_1.dtd";
  /** The public ID for the 5.1 DTD */
  protected static final String PUBLIC_ID_5_1 =
      "-//GemStone Systems, Inc.//GemFire Declarative Cache 5.1//EN";

  // ---------------------------------
  /** Version string for GemFire 5.0 */
  public static final String VERSION_5_0 = "5_0";
  /** The location of the GemFire 5.0 DTD file */
  protected static final String DTD_5_0_LOCATION = "/org/apache/geode/cache/doc-files/cache5_0.dtd";
  /** The URL for the 5.0 DTD */
  protected static final String SYSTEM_ID_5_0 = "http://www.gemstone.com/dtd/cache5_0.dtd";
  /** The public ID for the 5.0 DTD */
  protected static final String PUBLIC_ID_5_0 =
      "-//GemStone Systems, Inc.//GemFire Declarative Caching 5.0//EN";

  // ---------------------------------
  /** Version string for GemFire 4.1 */
  public static final String VERSION_4_1 = "4_1";
  /** The location of the GemFire 4.1 DTD file */
  protected static final String DTD_4_1_LOCATION = "/org/apache/geode/cache/doc-files/cache4_1.dtd";
  /** The URL for the 4.1 DTD */
  protected static final String SYSTEM_ID_4_1 = "http://www.gemstone.com/dtd/cache4_1.dtd";
  /** The public ID for the 4.1 DTD */
  protected static final String PUBLIC_ID_4_1 =
      "-//GemStone Systems, Inc.//GemFire Declarative Caching 4.1//EN";

  /** Version string for GemFire 4.0 */
  public static final String VERSION_4_0 = "4_0";
  /** The location of the GemFire 4.0 DTD file */
  protected static final String DTD_4_0_LOCATION = "/org/apache/geode/cache/doc-files/cache4_0.dtd";
  /** The URL for the 4.0 DTD */
  protected static final String SYSTEM_ID_4_0 = "http://www.gemstone.com/dtd/cache4_0.dtd";
  /** The public ID for the 4.0 DTD */
  protected static final String PUBLIC_ID_4_0 =
      "-//GemStone Systems, Inc.//GemFire Declarative Caching 4.0//EN";

  // ---------------------------------
  /** Version string for GemFire 3.0 */
  public static final String VERSION_3_0 = "3_0";
  /** The location of the GemFire 3.0 DTD file */
  protected static final String DTD_3_0_LOCATION = "/org/apache/geode/cache/doc-files/cache3_0.dtd";
  /** The URL for the 3.0 DTD */
  protected static final String SYSTEM_ID_3_0 = "http://www.gemstone.com/dtd/cache3_0.dtd";
  /** The public ID for the 3.0 DTD */
  protected static final String PUBLIC_ID_3_0 =
      "-//GemStone Systems, Inc.//GemFire Declarative Caching 3.0//EN";

  // ---------------------------------
  protected static final String DTD_TYPE_CDATA = "CDATA";

  /** The name of the <code>cache</code> element */
  public static final String CACHE = "cache";
  /** The name of the <code>client-cache</code> element */
  protected static final String CLIENT_CACHE = "client-cache";
  /** The name of the <code>region</code> element */
  public static final String REGION = "region";
  /** The name of the <code>vm-root-region</code> element */
  protected static final String VM_ROOT_REGION = "vm-root-region";
  /** The name of the <code>region-attributes</code> element */
  protected static final String REGION_ATTRIBUTES = "region-attributes";
  /** The name of the <code>key-constraint</code> element */
  protected static final String KEY_CONSTRAINT = "key-constraint";
  /** The name of the <code>value-constraint</code> element */
  protected static final String VALUE_CONSTRAINT = "value-constraint";
  /** The name of the <code>region-time-to-live</code> element */
  protected static final String REGION_TIME_TO_LIVE = "region-time-to-live";
  /** The name of the <code>region-idle-time</code> element */
  protected static final String REGION_IDLE_TIME = "region-idle-time";
  /** The name of the <code>entry-time-to-live</code> element */
  protected static final String ENTRY_TIME_TO_LIVE = "entry-time-to-live";
  /** The name of the <code>entry-idle-time</code> element */
  protected static final String ENTRY_IDLE_TIME = "entry-idle-time";
  /** The name of the <code>expiration-attributes</code> element */
  protected static final String EXPIRATION_ATTRIBUTES = "expiration-attributes";
  /** The name of the <code>custom-expiry</code> element */
  protected static final String CUSTOM_EXPIRY = "custom-expiry";
  /** The name of the <code>entry</code> element */
  protected static final String ENTRY = "entry";
  /** The name of the <code>class-name</code> element */
  protected static final String CLASS_NAME = "class-name";
  /** The name of the <code>parameter</code> element */
  protected static final String PARAMETER = "parameter";
  /** The name of the <code>cache-loader</code> element */
  protected static final String CACHE_LOADER = "cache-loader";
  /** The name of the <code>cache-writer</code> element */
  protected static final String CACHE_WRITER = "cache-writer";
  /** The name of the <code>eviction-attributes</code> element */
  protected static final String EVICTION_ATTRIBUTES = "eviction-attributes";
  /** The name of the <code>cache-listener</code> element */
  protected static final String CACHE_LISTENER = "cache-listener";
  public static final String PDX = "pdx";
  public static final String PERSISTENT = "persistent";
  public static final String READ_SERIALIZED = "read-serialized";
  public static final String IGNORE_UNREAD_FIELDS = "ignore-unread-fields";
  public static final String PDX_SERIALIZER = "pdx-serializer";

  /** The name of the <code>key</code> element */
  protected static final String KEY = "key";
  /** The name of the <code>value</code> element */
  protected static final String VALUE = "value";
  /** The name of the <code>string</code> element */
  protected static final String STRING = "string";
  /** The name of the <code>declarable</code> element */
  protected static final String DECLARABLE = "declarable";
  /** The name of the <code>lock-timeout</code> attribute */
  public static final String LOCK_TIMEOUT = "lock-timeout";
  /** The name of the <code>lock-lease</code> attribute */
  public static final String LOCK_LEASE = "lock-lease";
  /** The name of the <code>search-timeout</code> attribute */
  public static final String SEARCH_TIMEOUT = "search-timeout";
  /** The name of the <code>message-synch-interval</code> attribute */
  public static final String MESSAGE_SYNC_INTERVAL = "message-sync-interval";
  /** The name of the <code>dynamic-region-factory</code> element */
  protected static final String DYNAMIC_REGION_FACTORY = "dynamic-region-factory";
  /** The name of the <code>disable-persist-backup</code> attribute */
  protected static final String DISABLE_PERSIST_BACKUP = "disable-persist-backup";
  /** The name of the <code>disable-register-interest</code> attribute */
  protected static final String DISABLE_REGISTER_INTEREST = "disable-register-interest";
  /** The name of the <code>is-server</code> attribute */
  protected static final String IS_SERVER = "is-server";
  /** The name of the <code>partition-attributes</code> attribute */
  protected static final String PARTITION_ATTRIBUTES = "partition-attributes";
  /** The name of the <code>partition-attributes</code> <code>localMaxMemory</code> attribute */
  protected static final String LOCAL_MAX_MEMORY = "local-max-memory";
  /** The name of the <code>local properties</code> associated with a partitioned region */
  protected static final String LOCAL_PROPERTIES = "local-properties";
  /** The name of the <code>total-max-memory</code> attribute */
  protected static final String TOTAL_MAX_MEMORY = "total-max-memory";
  /** The name of the <code>total-num-buckets</code> property */
  protected static final String TOTAL_NUM_BUCKETS = "total-num-buckets";
  /** The name of the <code>global properties</code> associated with a partitioned region */
  protected static final String GLOBAL_PROPERTIES = "global-properties";
  /** The name of the partitioning <code>redundancy</code> attribute */
  protected static final String PARTITION_REDUNDANT_COPIES = "redundant-copies";
  /** The name of the partitioned region's <code>colocated-with</code> attribute */
  protected static final String PARTITION_COLOCATED_WITH = "colocated-with";
  /** The name of the partitioned region's <code>recovery-delay</code> attribute */
  protected static final String RECOVERY_DELAY = "recovery-delay";
  /** The name of the partitioned region's <code>startup-recovery-delay</code> attribute */
  protected static final String STARTUP_RECOVERY_DELAY = "startup-recovery-delay";
  /** The name of the <code>fixed-partition-attributes</code> attribute */
  protected static final String FIXED_PARTITION_ATTRIBUTES = "fixed-partition-attributes";
  /** The name of the fixed partition's<code>partition-name</code> attribute */
  protected static final String PARTITION_NAME = "partition-name";
  /** The name of the fixed partition's <code>is-primary</code> attribute */
  protected static final String IS_PRIMARY = "is-primary";
  /** The name of the fixed partition's <code>num-buckets</code> attribute */
  protected static final String NUM_BUCKETS = "num-buckets";

  /** The name of the load probe element */
  protected static final String LOAD_PROBE = "custom-load-probe";
  /** The name of the load poll interval element */
  protected static final String LOAD_POLL_INTERVAL = "load-poll-interval";
  /** The name of the <code>bridge-server</code> element */
  protected static final String BRIDGE_SERVER = "bridge-server";
  /** The name of the <code>cache-server</code> element */
  protected static final String CACHE_SERVER = "cache-server";
  protected static final String HOSTNAME_FOR_CLIENTS = "hostname-for-clients";
  /** The name of the <code>group</code> element */
  protected static final String GROUP = "group";
  /** The name of the <code>gateway-hub</code> element */
  protected static final String GATEWAY_HUB = "gateway-hub";

  public static final String GATEWAY_SENDER = "gateway-sender";
  public static final String GATEWAY_RECEIVER = "gateway-receiver";

  protected static final String GATEWAY_EVENT_FILTER = "gateway-event-filter";
  protected static final String GATEWAY_TRANSPORT_FILTER = "gateway-transport-filter";
  protected static final String GATEWAY_EVENT_LISTENER = "gateway-event-listener";
  protected static final String GATEWAY_SENDER_IDS = "gateway-sender-ids";
  protected static final String GATEWAY_EVENT_SUBSTITUTION_FILTER =
      "gateway-event-substitution-filter";
  protected static final String HOSTNAME_FOR_SENDERS = "hostname-for-senders";
  /** The name of the <code>gateway</code> attribute */
  protected static final String GATEWAY = "gateway";
  /** The name of the <code>gateway-endpoint</code> attribute */
  protected static final String GATEWAY_ENDPOINT = "gateway-endpoint";
  /** The name of the <code>gateway-listener</code> attribute */
  protected static final String GATEWAY_LISTENER = "gateway-listener";
  /** The name of the <code>gateway-queue</code> attribute */
  protected static final String GATEWAY_QUEUE = "gateway-queue";
  /** The name of the <code>gateway-conflict-resolver</code> */ // added in 7.0
  protected static final String GATEWAY_CONFLICT_RESOLVER = "gateway-conflict-resolver";
  /** The name of the <code>host</code> attribute */
  protected static final String HOST = "host";
  /** The name of the <code>port</code> attribute */
  protected static final String PORT = "port";
  /** The name of the <code>start-port</code> attribute */
  protected static final String START_PORT = "start-port";
  /** The name of the <code>end-port</code> attribute */
  protected static final String END_PORT = "end-port";
  /** The name of the <code>startup-policy</code> attribute */
  protected static final String STARTUP_POLICY = "startup-policy";
  /** The name of the <code>parallel</code> attribute */
  protected static final String PARALLEL = "parallel";
  /** The name of the <code>manual-start</code> attribute */
  protected static final String MANUAL_START = "manual-start";
  /** The name of the <code>order-policy</code> attribute */
  protected static final String ORDER_POLICY = "order-policy";
  /** The name of the <code>remote-distributed-system</code> attribute */
  protected static final String REMOTE_DISTRIBUTED_SYSTEM_ID = "remote-distributed-system-id";
  /** The name of the <code>group-transaction-events</code> attribute */
  protected static final String GROUP_TRANSACTION_EVENTS = "group-transaction-events";
  /** The name of the <code>enforce-threads-connect-same-receiver</code> attribute */
  protected static final String ENFORCE_THREADS_CONNECT_SAME_RECEIVER =
      "enforce-threads-connect-same-receiver";

  /** The name of the <code>bind-address</code> attribute */
  protected static final String BIND_ADDRESS = "bind-address";
  /** The name of the <code>max-connections</code> attribute */
  protected static final String MAX_CONNECTIONS = "max-connections";
  /** The name of the <code>max-threads</code> attribute */
  protected static final String MAX_THREADS = "max-threads";
  /** The name of the <code>notify-by-subscription</code> attribute */
  protected static final String NOTIFY_BY_SUBSCRIPTION = "notify-by-subscription";
  /** The name of the <code>copy-on-read</code> attribute */
  public static final String COPY_ON_READ = "copy-on-read";
  /** The name of the <code>name</code> attribute */
  protected static final String NAME = "name";
  /** The name of the <code>scope</code> attribute */
  protected static final String SCOPE = "scope";
  /** The name of the <code>mirror-type</code> attribute */
  protected static final String MIRROR_TYPE = "mirror-type";
  /** The name of the <code>eviction-policy</code> attribute */
  protected static final String CLIENT_SUBSCRIPTION_EVICTION_POLICY = "eviction-policy";
  /** The name of the <code>capacity</code> attribute */
  protected static final String CLIENT_SUBSCRIPTION_CAPACITY = "capacity";
  /** The name of the <code>client-subscription/code> attribute */
  protected static final String CLIENT_SUBSCRIPTION = "client-subscription";
  /** The name of the <code>version/code> attribute */
  public static final String VERSION = "version";

  /** The name of the <code>data-policy</code> attribute */
  protected static final String DATA_POLICY = "data-policy";
  protected static final String EMPTY_DP = "empty";
  protected static final String NORMAL_DP = "normal";
  protected static final String PRELOADED_DP = "preloaded";
  protected static final String REPLICATE_DP = "replicate";
  protected static final String PERSISTENT_REPLICATE_DP = "persistent-replicate";
  protected static final String PARTITION_DP = "partition";
  protected static final String PERSISTENT_PARTITION_DP = "persistent-partition";

  /** The name of the <code>keep-alive-timeout</code> attribute */
  protected static final String KEEP_ALIVE_TIMEOUT = "keep-alive-timeout";
  /** The name of the <code>initial-capacity</code> attribute */
  protected static final String INITIAL_CAPACITY = "initial-capacity";
  protected static final String CONCURRENCY_LEVEL = "concurrency-level";
  /** The name of the <code>concurrency-checks-enabled</code> attribute */
  protected static final String CONCURRENCY_CHECKS_ENABLED = "concurrency-checks-enabled";
  /** The name of the <code>serialize-values</code> attribute */
  protected static final String SERIALIZE_VALUES = "serialize-values";
  /** The name of the <code>load-factor</code> attribute */
  protected static final String LOAD_FACTOR = "load-factor";
  /** The name of the <code>statistics-enabled</code> attribute */
  protected static final String STATISTICS_ENABLED = "statistics-enabled";
  /** The name of the <code>ignore-jta</code> attribute */
  protected static final String IGNORE_JTA = "ignore-jta";
  /** The name of the <code>is-lock-grantor</code> attribute */
  protected static final String IS_LOCK_GRANTOR = "is-lock-grantor";
  /** The name of the <code>timeout</code> attribute */
  protected static final String TIMEOUT = "timeout";
  /** The name of the <code>action</code> attribute */
  protected static final String ACTION = "action";
  /** The name of the <code>local</code> value */
  protected static final String LOCAL = "local";
  /** The name of the <code>distributed-no-ack</code> value */
  protected static final String DISTRIBUTED_NO_ACK = "distributed-no-ack";
  /** The name of the <code>distributed-ack</code> value */
  protected static final String DISTRIBUTED_ACK = "distributed-ack";
  /** The name of the <code>global</code> value */
  protected static final String GLOBAL = "global";
  /** The name of the <code>none</code> value */
  protected static final String NONE = "none";
  /** The name of the <code>keys</code> value */
  protected static final String KEYS = "keys";
  /** The name of the <code>key-values</code> value */
  protected static final String KEYS_VALUES = "keys-values";
  /** The name of the <code>host-own</code> value */
  protected static final String PARTITION_HOST_OWN = "host-own";

  /** The name of the <code>host-other</code> value */
  protected static final String PARTITION_HOST_OTHER = "host-other";

  /** The name of the <code>true</code> value */
  protected static final String TRUE = "true";
  /** The name of the <code>false</code> value */
  protected static final String FALSE = "false";
  /** The name of the <code>invalidate</code> value */
  protected static final String INVALIDATE = "invalidate";
  /** The name of the <code>destroy</code> value */
  protected static final String DESTROY = "destroy";
  /** The name of the <code>local-invalidate</code> value */
  protected static final String LOCAL_INVALIDATE = "local-invalidate";
  /** The name of the <code>local-destroy</code> value */
  protected static final String LOCAL_DESTROY = "local-destroy";
  /** The name of the <code>persist-backup</code> value */
  protected static final String PERSIST_BACKUP = "persist-backup";
  /** The name of the <code>early-ack</code> value */
  protected static final String EARLY_ACK = "early-ack";
  /** The name of the <code>disk-dir</code> value */
  protected static final String DISK_DIR = "disk-dir";
  /** The name of the <code>disk-dirs</code> value */
  protected static final String DISK_DIRS = "disk-dirs";
  /** The name of the <code>disk-write-attributes</code> value */
  protected static final String DISK_WRITE_ATTRIBUTES = "disk-write-attributes";
  /** The name of the <code>synchronous-writes</code> value */
  protected static final String SYNCHRONOUS_WRITES = "synchronous-writes";
  /** The name of the <code>asynchronous-writes</code> value */
  protected static final String ASYNCHRONOUS_WRITES = "asynchronous-writes";
  /** The name of the <code>time-interval</code> value */
  public static final String TIME_INTERVAL = "time-interval";
  /** The name of the <code>bytes-threshold</code> value */
  public static final String BYTES_THRESHOLD = "bytes-threshold";
  /** The name of the <code>index</code> element */
  public static final String INDEX = "index";
  /** The name of the <code>key-index</code> index attribute */
  protected static final String KEY_INDEX = "key-index";
  /** The name of the index type attribute */
  protected static final String INDEX_TYPE = "type";
  /* The name of the <code>hash-index</code> index type attribute */
  /*
   * @deprecated Due to the overhead caused by rehashing while expanding the backing array, Hash
   * Index has been deprecated since Apache Geode 1.4.0. Use {@link CacheXml#FUNCTIONAL}
   */
  @Deprecated
  protected static final String HASH_INDEX_TYPE = "hash";
  /** The name of the <code>range-index</code> index type attribute */
  protected static final String RANGE_INDEX_TYPE = "range";
  /** The name of the <code>functional-sorted</code> element */
  protected static final String FUNCTIONAL = "functional";
  /** The name of the <code>primary-key</code> element */
  protected static final String PRIMARY_KEY = "primary-key";
  /** The name of the <code>index-update-type</code> element */
  protected static final String INDEX_UPDATE_TYPE = "index-update-type";
  /** The name of the <code>update-type</code> value */
  protected static final String INDEX_UPDATE_TYPE_ASYNCH = "asynchronous";
  /** The name of the <code>update-type</code> value */
  protected static final String INDEX_UPDATE_TYPE_SYNCH = "synchronous";
  /** The name of the <code>from-clause</code> attribute */
  protected static final String FROM_CLAUSE = "from-clause";
  /** The name of the <code>expression</code> attribute */
  protected static final String EXPRESSION = "expression";
  /** The name of the <code>import</code> attribute */
  protected static final String IMPORTS = "imports";
  /** The name of the <code>field</code> attribute */
  protected static final String FIELD = "field";
  /** The name of the <code>cache-transaction-manager</code> element */
  protected static final String TRANSACTION_MANAGER = "cache-transaction-manager";
  /** The name of the <code>transaction-listener</code> element */
  protected static final String TRANSACTION_LISTENER = "transaction-listener";
  /** The name of the <code>transaction-writer</code> element */
  protected static final String TRANSACTION_WRITER = "transaction-writer";

  /** The name of the multicast-enabled element */
  protected static final String MULTICAST_ENABLED = "multicast-enabled";
  protected static final String JNDI_BINDINGS = "jndi-bindings";
  protected static final String JNDI_BINDING = "jndi-binding";
  /** The name of the <code>config-property</code> value */
  protected static final String CONFIG_PROPERTY_BINDING = "config-property";
  /** The name of the <code>config-property-name</code> value */
  protected static final String CONFIG_PROPERTY_NAME = "config-property-name";
  /** The name of the <code>config-property-value</code> value */
  protected static final String CONFIG_PROPERTY_VALUE = "config-property-value";
  /** The name of the <code>config-property-type</code> value */
  protected static final String CONFIG_PROPERTY_TYPE = "config-property-type";
  /** Name of disk region property specifying whether to roll oplog or no **/
  public static final String ROLL_OPLOG = "roll-oplogs";
  /** Name of disk region property specifying whether to automatically compact disk files **/
  public static final String AUTO_COMPACT = "auto-compact";
  public static final String ALLOW_FORCE_COMPACTION = "allow-force-compaction";
  public static final String COMPACTION_THRESHOLD = "compaction-threshold";
  /** Name of disk region property specifying the max oplog size in megabytes **/
  public static final String MAX_OPLOG_SIZE = "max-oplog-size";

  /** name of the disk store property for disk usage warning percentage */
  public static final String DISK_USAGE_WARNING_PERCENTAGE = "disk-usage-warning-percentage";

  /** name of the disk store property for disk usage critical percentage */
  public static final String DISK_USAGE_CRITICAL_PERCENTAGE = "disk-usage-critical-percentage";

  /** Name of region property specifying the cloning **/
  public static final String CLONING_ENABLED = "cloning-enabled";

  // begin constants for connection pool
  public static final String CONNECTION_POOL = "pool";
  public static final String POOL_NAME = "pool-name";
  public static final String SERVER = "server";
  public static final String LOCATOR = "locator";
  public static final String SUBSCRIPTION_TIMEOUT_MULTIPLIER = "subscription-timeout-multiplier";
