Class ComponentConfiguration

java.lang.Object
org.apache.bookkeeper.common.conf.ComponentConfiguration
All Implemented Interfaces:
org.apache.commons.configuration2.Configuration, org.apache.commons.configuration2.ImmutableConfiguration, org.apache.commons.configuration2.sync.SynchronizerSupport
Direct Known Subclasses:
BookieConfiguration

public abstract class ComponentConfiguration extends Object implements org.apache.commons.configuration2.Configuration
Component Configuration.
  • Field Details

  • Constructor Details

    • ComponentConfiguration

      protected ComponentConfiguration(org.apache.commons.configuration2.CompositeConfiguration underlyingConf, String componentPrefix)
  • Method Details

    • getKeyName

      protected String getKeyName(String name)
    • getUnderlyingConf

      public org.apache.commons.configuration2.CompositeConfiguration getUnderlyingConf()
    • loadConf

      public void loadConf(URL confURL) throws org.apache.commons.configuration2.ex.ConfigurationException
      Load configuration from a given confURL.
      Parameters:
      confURL - the url points to the configuration.
      Throws:
      org.apache.commons.configuration2.ex.ConfigurationException - when failed to load configuration.
    • loadConf

      protected void loadConf(org.apache.commons.configuration2.Configuration loadedConf)
    • validate

      public void validate() throws org.apache.commons.configuration2.ex.ConfigurationException
      Throws:
      org.apache.commons.configuration2.ex.ConfigurationException
    • subset

      public org.apache.commons.configuration2.Configuration subset(String prefix)
      Specified by:
      subset in interface org.apache.commons.configuration2.Configuration
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.apache.commons.configuration2.ImmutableConfiguration
    • containsKey

      public boolean containsKey(String key)
      Specified by:
      containsKey in interface org.apache.commons.configuration2.ImmutableConfiguration
    • addProperty

      public void addProperty(String key, Object value)
      Specified by:
      addProperty in interface org.apache.commons.configuration2.Configuration
    • setProperty

      public void setProperty(String key, Object value)
      Specified by:
      setProperty in interface org.apache.commons.configuration2.Configuration
    • clearProperty

      public void clearProperty(String key)
      Specified by:
      clearProperty in interface org.apache.commons.configuration2.Configuration
    • clear

      public void clear()
      Specified by:
      clear in interface org.apache.commons.configuration2.Configuration
    • getProperty

      public Object getProperty(String key)
      Specified by:
      getProperty in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getKeys

      public Iterator<String> getKeys(String prefix)
      Specified by:
      getKeys in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getKeys

      public Iterator<String> getKeys()
      Specified by:
      getKeys in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getProperties

      public Properties getProperties(String key)
      Specified by:
      getProperties in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getBoolean

      public boolean getBoolean(String key)
      Specified by:
      getBoolean in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getBoolean

      public boolean getBoolean(String key, boolean defaultValue)
      Specified by:
      getBoolean in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getBoolean

      public Boolean getBoolean(String key, Boolean defaultValue)
      Specified by:
      getBoolean in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getByte

      public byte getByte(String key)
      Specified by:
      getByte in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getByte

      public byte getByte(String key, byte defaultValue)
      Specified by:
      getByte in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getByte

      public Byte getByte(String key, Byte defaultValue)
      Specified by:
      getByte in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getDouble

      public double getDouble(String key)
      Specified by:
      getDouble in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getDouble

      public double getDouble(String key, double defaultValue)
      Specified by:
      getDouble in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getDouble

      public Double getDouble(String key, Double defaultValue)
      Specified by:
      getDouble in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getFloat

      public float getFloat(String key)
      Specified by:
      getFloat in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getFloat

      public float getFloat(String key, float defaultValue)
      Specified by:
      getFloat in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getFloat

      public Float getFloat(String key, Float defaultValue)
      Specified by:
      getFloat in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getInt

      public int getInt(String key)
      Specified by:
      getInt in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getInt

      public int getInt(String key, int defaultValue)
      Specified by:
      getInt in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getInteger

      public Integer getInteger(String key, Integer defaultValue)
      Specified by:
      getInteger in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getLong

      public long getLong(String key)
      Specified by:
      getLong in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getLong

      public long getLong(String key, long defaultValue)
      Specified by:
      getLong in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getLong

      public Long getLong(String key, Long defaultValue)
      Specified by:
      getLong in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getShort

      public short getShort(String key)
      Specified by:
      getShort in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getShort

      public short getShort(String key, short defaultValue)
      Specified by:
      getShort in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getShort

      public Short getShort(String key, Short defaultValue)
      Specified by:
      getShort in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getBigDecimal

      public BigDecimal getBigDecimal(String key)
      Specified by:
      getBigDecimal in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getBigDecimal

      public BigDecimal getBigDecimal(String key, BigDecimal defaultValue)
      Specified by:
      getBigDecimal in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getBigInteger

      public BigInteger getBigInteger(String key)
      Specified by:
      getBigInteger in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getBigInteger

      public BigInteger getBigInteger(String key, BigInteger defaultValue)
      Specified by:
      getBigInteger in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getString

      public String getString(String key)
      Specified by:
      getString in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getString

      public String getString(String key, String defaultValue)
      Specified by:
      getString in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getStringArray

      public String[] getStringArray(String key)
      Specified by:
      getStringArray in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getList

      public List<Object> getList(String key)
      Specified by:
      getList in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getList

      public List<Object> getList(String key, List<?> defaultValue)
      Specified by:
      getList in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getInterpolator

      public org.apache.commons.configuration2.interpol.ConfigurationInterpolator getInterpolator()
      Specified by:
      getInterpolator in interface org.apache.commons.configuration2.Configuration
    • installInterpolator

      public void installInterpolator(Map<String,? extends org.apache.commons.configuration2.interpol.Lookup> prefixLookups, Collection<? extends org.apache.commons.configuration2.interpol.Lookup> defLookups)
      Specified by:
      installInterpolator in interface org.apache.commons.configuration2.Configuration
    • setInterpolator

      public void setInterpolator(org.apache.commons.configuration2.interpol.ConfigurationInterpolator ci)
      Specified by:
      setInterpolator in interface org.apache.commons.configuration2.Configuration
    • get

      public <T> T get(Class<T> cls, String key)
      Specified by:
      get in interface org.apache.commons.configuration2.ImmutableConfiguration
    • get

      public <T> T get(Class<T> cls, String key, T defaultValue)
      Specified by:
      get in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getArray

      public Object getArray(Class<?> cls, String key)
      Specified by:
      getArray in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getArray

      @Deprecated public Object getArray(Class<?> cls, String key, Object defaultValue)
      Deprecated.
      Specified by:
      getArray in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getCollection

      public <T> Collection<T> getCollection(Class<T> cls, String key, Collection<T> target)
      Specified by:
      getCollection in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getCollection

      public <T> Collection<T> getCollection(Class<T> cls, String key, Collection<T> target, Collection<T> defaultValue)
      Specified by:
      getCollection in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getDuration

      public Duration getDuration(String key)
      Specified by:
      getDuration in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getDuration

      public Duration getDuration(String key, Duration defaultValue)
      Specified by:
      getDuration in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getEncodedString

      public String getEncodedString(String key)
      Specified by:
      getEncodedString in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getEncodedString

      public String getEncodedString(String key, org.apache.commons.configuration2.ConfigurationDecoder decoder)
      Specified by:
      getEncodedString in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getEnum

      public <T extends Enum<T>> T getEnum(String key, Class<T> enumType)
      Specified by:
      getEnum in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getEnum

      public <T extends Enum<T>> T getEnum(String key, Class<T> enumType, T defaultValue)
      Specified by:
      getEnum in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getKeys

      public Iterator<String> getKeys(String prefix, String delimiter)
      Specified by:
      getKeys in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getList

      public <T> List<T> getList(Class<T> cls, String key)
      Specified by:
      getList in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getList

      public <T> List<T> getList(Class<T> cls, String key, List<T> defaultValue)
      Specified by:
      getList in interface org.apache.commons.configuration2.ImmutableConfiguration
    • immutableSubset

      public org.apache.commons.configuration2.ImmutableConfiguration immutableSubset(String prefix)
      Specified by:
      immutableSubset in interface org.apache.commons.configuration2.ImmutableConfiguration
    • size

      public int size()
      Specified by:
      size in interface org.apache.commons.configuration2.ImmutableConfiguration
    • getSynchronizer

      public org.apache.commons.configuration2.sync.Synchronizer getSynchronizer()
      Specified by:
      getSynchronizer in interface org.apache.commons.configuration2.sync.SynchronizerSupport
    • lock

      public void lock(org.apache.commons.configuration2.sync.LockMode mode)
      Specified by:
      lock in interface org.apache.commons.configuration2.sync.SynchronizerSupport
    • setSynchronizer

      public void setSynchronizer(org.apache.commons.configuration2.sync.Synchronizer sync)
      Specified by:
      setSynchronizer in interface org.apache.commons.configuration2.sync.SynchronizerSupport
    • unlock

      public void unlock(org.apache.commons.configuration2.sync.LockMode mode)
      Specified by:
      unlock in interface org.apache.commons.configuration2.sync.SynchronizerSupport
    • asJson

      public String asJson()
      returns the string representation of json format of this config.
      Returns:
      Throws:
      JsonUtil.ParseJsonException