Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.Configuration.containsKey()


        Iterator it = config.getKeys();
        while (it.hasNext())
        {
            String key = (String) it.next();
            assertTrue("The saved configuration doesn't contain the key '" + key + "'", checkConfig.containsKey(key));

            Object value = checkConfig.getProperty(key);
            if (value instanceof byte[])
            {
                byte[] array = (byte[]) value;
View Full Code Here


        configureDelays(delays);

        String messageStoreClass = config.getString("realStore");

        if (delays.containsKey(DEFAULT_DELAY))
        {
            _defaultDelay = delays.getLong(DEFAULT_DELAY);
        }

        if (messageStoreClass != null)
View Full Code Here

        Iterator it = config.getKeys();
        while (it.hasNext())
        {
            String key = (String) it.next();
            assertTrue("The saved configuration doesn't contain the key '" + key + "'", checkConfig.containsKey(key));

            Object value = checkConfig.getProperty(key);
            if (value instanceof byte[])
            {
                byte[] array = (byte[]) value;
View Full Code Here

        if (subset == null)
        {
            throw new IllegalArgumentException("Mapped property '" + name + "' does not exist.");
        }

        return subset.containsKey(key);
    }

    public Object get(String name, int index)
    {
        try
View Full Code Here

    addStatement(event, call("prepare_all_disks", "'" + devMappings + "'"));
  }

  private String getMetricsTemplate(ClusterActionEvent event, ClusterSpec clusterSpec, Cluster cluster) {
    Configuration conf = clusterSpec.getConfiguration();
    if (conf.containsKey("hadoop-metrics.template")) {
      return conf.getString("hadoop-metrics.template");
    }
   
    Set<Instance> gmetadInstances = cluster.getInstancesMatching(RolePredicates.role("ganglia-metad"));
    if (!gmetadInstances.isEmpty()) {
View Full Code Here

      // jclouds configuration for providers are not prefixed with jclouds.
      for (String key : COMPUTE_KEYS) {
        for (String property : PROVIDER_PROPERTIES) {
          String prefixedProperty = "jclouds." + key + "." + property;

          if (jcloudsConfig.containsKey(prefixedProperty)) {
            jcloudsConfig.setProperty(key + "." + property,
                jcloudsConfig.getProperty(prefixedProperty));
          }
        }
      }
View Full Code Here

   */
  public static long getUntilNextUpdate(int certProfileId) {
    long value = 0;
    Configuration config = ConfigurationHolder.instance();
    String key = "ocsp."+certProfileId+".untilNextUpdate";
    if ( (certProfileId == SecConst.CERTPROFILE_NO_PROFILE) || (!config.containsKey(key)) ) {
      key = "ocsp.untilNextUpdate";
    }
    try {
      value = (config.getLong(key, value) * 1000);
    } catch( ConversionException e ) {
View Full Code Here

   */
  public static long getMaxAge(int certProfileId) {
    long value = 30;
    Configuration config = ConfigurationHolder.instance();
    String key = "ocsp."+certProfileId+".maxAge";
    if ( (certProfileId == SecConst.CERTPROFILE_NO_PROFILE) || (!config.containsKey(key)) ) {
      key = "ocsp.maxAge";
    }
    try {
      value = (config.getLong(key, value) * 1000);
    } catch( ConversionException e ) {
View Full Code Here

        // Get the configuration for this service.
        Configuration conf = getConfiguration();

        catchErrors = conf.getBoolean(CATCH_ERRORS_KEY, CATCH_ERRORS_DEFAULT);
       
        if (conf.containsKey(Velocity.INPUT_ENCODING))
        {
            defaultEncoding = conf.getString(Velocity.INPUT_ENCODING);
        }

        conf.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS,
View Full Code Here

    addStatement(event, call("prepare_all_disks", "'" + devMappings + "'"));
  }

  private String getMetricsTemplate(ClusterActionEvent event, ClusterSpec clusterSpec, Cluster cluster) {
    Configuration conf = clusterSpec.getConfiguration();
    if (conf.containsKey("hadoop-metrics.template")) {
      return conf.getString("hadoop-metrics.template");
    }
   
    Set<Instance> gmetadInstances = cluster.getInstancesMatching(RolePredicates.role("ganglia-metad"));
    if (!gmetadInstances.isEmpty()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.