congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ConfigKey
Code IndexAdd Tabnine to your IDE (free)

How to use
ConfigKey
in
org.jolokia.config

Best Java code snippets using org.jolokia.config.ConfigKey (Showing top 20 results out of 315)

origin: rhuss/jolokia

/**
 * Update this global configuration from a string-string. Only the known keys are taken
 * from this map
 *
 * @param pConfig config map from where to take the configuration
 */
public void updateGlobalConfiguration(Map<String, String> pConfig) {
  for (ConfigKey c : ConfigKey.values()) {
    if (c.isGlobalConfig()) {
      String value = pConfig.get(c.getKeyValue());
      if (value != null) {
        globalConfig.put(c,value);
      }
    }
  }
}
origin: rhuss/jolokia

/**
 * Get a processing parameter
 *
 * @param pKey key to lookup
 * @return the value or the default value from the key if no config value is set
 */
public String get(ConfigKey pKey) {
  String value = params.get(pKey);
  if (value != null) {
    return value;
  } else {
    return pKey.getDefaultValue();
  }
}
origin: rhuss/jolokia

/**
 * Update the configuration hold by this object
 *
 * @param pExtractor an extractor for retrieving the configuration from some external object
 */
public void updateGlobalConfiguration(ConfigExtractor pExtractor) {
  Enumeration e = pExtractor.getNames();
  while (e.hasMoreElements()) {
    String keyS = (String) e.nextElement();
    ConfigKey key = ConfigKey.getGlobalConfigKey(keyS);
    if (key != null) {
      globalConfig.put(key,pExtractor.getParameter(keyS));
    }
  }
}
origin: rhuss/jolokia

private String getConfiguration(ConfigKey pKey) {
  // TODO: Use fragments if available.
  String value = getConfigurationFromConfigAdmin(pKey);
  if (value == null) {
    value = bundleContext.getProperty(CONFIG_PREFIX + "." + pKey.getKeyValue());
  }
  if (value == null) {
    value = pKey.getDefaultValue();
  }
  return value;
}
origin: rhuss/jolokia

private Dictionary<String,String> getConfiguration() {
  Dictionary<String,String> config = new Hashtable<String,String>();
  for (ConfigKey key : ConfigKey.values()) {
    String value = getConfiguration(key);
    if (value != null) {
      config.put(key.getKeyValue(),value);
    }
  }
  String jolokiaId = NetworkUtil.replaceExpression(config.get(ConfigKey.AGENT_ID.getKeyValue()));
  if (jolokiaId == null) {
    config.put(ConfigKey.AGENT_ID.getKeyValue(),
          NetworkUtil.getAgentId(hashCode(),"osgi"));
  }
  config.put(ConfigKey.AGENT_TYPE.getKeyValue(),"osgi");
  return config;
}
origin: rhuss/jolokia

private boolean isStreamingEnabled(HttpServletRequest pReq) {
  String streamingFromReq = pReq.getParameter(ConfigKey.STREAMING.getKeyValue());
  if (streamingFromReq != null) {
    return Boolean.parseBoolean(streamingFromReq);
  }
  return streamingEnabled;
}
origin: rhuss/jolokia

  static Map<ConfigKey, String> convertToConfigMap(Map<String, String> pParams) {
    Map<ConfigKey,String> config = new HashMap<ConfigKey, String>();
    if (pParams != null) {
      for (Map.Entry<String,?> entry : pParams.entrySet()) {
        ConfigKey cKey = ConfigKey.getRequestConfigKey(entry.getKey());
        if (cKey != null) {
          Object value = entry.getValue();
          config.put(cKey, value != null ? value.toString() : null);
        }
      }
    }
    return config;
  }
}
origin: rhuss/jolokia

/**
 * Get processing parameters from a string-string map
 *
 * @param pParams params to extra. A parameter "p" is used as extra path info
 * @return the processing parameters
 */
public ProcessingParameters getProcessingParameters(Map<String,String> pParams) {
  Map<ConfigKey,String> procParams = ProcessingParameters.convertToConfigMap(pParams);
  for (Map.Entry<ConfigKey,String> entry : globalConfig.entrySet()) {
    ConfigKey key = entry.getKey();
    if (key.isRequestConfig() && !procParams.containsKey(key)) {
      procParams.put(key,entry.getValue());
    }
  }
  return new ProcessingParameters(procParams,pParams.get(PATH_QUERY_PARAM));
}
origin: rhuss/jolokia

private void addJolokiaId(Map<String, String> pFinalCfg) {
  if (!pFinalCfg.containsKey(ConfigKey.AGENT_ID.getKeyValue())) {
    pFinalCfg.put(ConfigKey.AGENT_ID.getKeyValue(), NetworkUtil.getAgentId(hashCode(),"jvm"));
  }
  pFinalCfg.put(ConfigKey.AGENT_TYPE.getKeyValue(), "jvm");
}
origin: io.hawt/hawtio-system

public static boolean containsEnum(String test) {
  for (ConfigKey c : ConfigKey.values()) {
    if (c.getKeyValue().equals(test)) {
      return true;
    }
  }
  return false;
}
origin: org.jolokia/jolokia-osgi

private String getConfiguration(ConfigKey pKey) {
  // TODO: Use fragments if available.
  String value = getConfigurationFromConfigAdmin(pKey);
  if (value == null) {
    value = bundleContext.getProperty(CONFIG_PREFIX + "." + pKey.getKeyValue());
  }
  if (value == null) {
    value = pKey.getDefaultValue();
  }
  return value;
}
origin: org.jolokia/jolokia-core

  static Map<ConfigKey, String> convertToConfigMap(Map<String, String> pParams) {
    Map<ConfigKey,String> config = new HashMap<ConfigKey, String>();
    if (pParams != null) {
      for (Map.Entry<String,?> entry : pParams.entrySet()) {
        ConfigKey cKey = ConfigKey.getRequestConfigKey(entry.getKey());
        if (cKey != null) {
          Object value = entry.getValue();
          config.put(cKey, value != null ? value.toString() : null);
        }
      }
    }
    return config;
  }
}
origin: org.jolokia/jolokia-osgi

/**
 * Get processing parameters from a string-string map
 *
 * @param pParams params to extra. A parameter "p" is used as extra path info
 * @return the processing parameters
 */
public ProcessingParameters getProcessingParameters(Map<String,String> pParams) {
  Map<ConfigKey,String> procParams = ProcessingParameters.convertToConfigMap(pParams);
  for (Map.Entry<ConfigKey,String> entry : globalConfig.entrySet()) {
    ConfigKey key = entry.getKey();
    if (key.isRequestConfig() && !procParams.containsKey(key)) {
      procParams.put(key,entry.getValue());
    }
  }
  return new ProcessingParameters(procParams,pParams.get(PATH_QUERY_PARAM));
}
origin: rhuss/jolokia

private JSONObject configToJSONObject() {
  JSONObject info = new JSONObject();
  if (config != null) {
    for (ConfigKey key : ConfigKey.values()) {
      if (key.isGlobalConfig()) {
        String value = config.get(key);
        if (value != null) {
          info.put(key.getKeyValue(), value);
        }
      }
    }
  }
  return info;
}
origin: rhuss/jolokia

protected void prepareDetectorOptions(Map<String, String> pConfig) {
  StringBuffer detectorOpts = new StringBuffer("{");
  if (pConfig.containsKey("bootAmx") && Boolean.parseBoolean(pConfig.get("bootAmx"))) {
    detectorOpts.append("\"glassfish\" : { \"bootAmx\" : true }");
  }
  if (detectorOpts.length() > 1) {
    detectorOpts.append("}");
    pConfig.put(ConfigKey.DETECTOR_OPTIONS.getKeyValue(),detectorOpts.toString());
  }
}
origin: org.jolokia/jolokia-osgi

private Dictionary<String,String> getConfiguration() {
  Dictionary<String,String> config = new Hashtable<String,String>();
  for (ConfigKey key : ConfigKey.values()) {
    String value = getConfiguration(key);
    if (value != null) {
      config.put(key.getKeyValue(),value);
    }
  }
  String jolokiaId = NetworkUtil.replaceExpression(config.get(ConfigKey.AGENT_ID.getKeyValue()));
  if (jolokiaId == null) {
    config.put(ConfigKey.AGENT_ID.getKeyValue(),
          NetworkUtil.getAgentId(hashCode(),"osgi"));
  }
  config.put(ConfigKey.AGENT_TYPE.getKeyValue(),"osgi");
  return config;
}
origin: rhuss/jolokia

/**
 * Get a configuration value if set as configuration or the default
 * value if not
 *
 * @param pKey the configuration key to lookup
 * @return the configuration value or the default value if no configuration
 *         was given.
 */
public String get(ConfigKey pKey) {
  String value = globalConfig.get(pKey);
  if (value == null) {
    value = pKey.getDefaultValue();
  }
  return value;
}
origin: org.jolokia/jolokia-osgi

  static Map<ConfigKey, String> convertToConfigMap(Map<String, String> pParams) {
    Map<ConfigKey,String> config = new HashMap<ConfigKey, String>();
    if (pParams != null) {
      for (Map.Entry<String,?> entry : pParams.entrySet()) {
        ConfigKey cKey = ConfigKey.getRequestConfigKey(entry.getKey());
        if (cKey != null) {
          Object value = entry.getValue();
          config.put(cKey, value != null ? value.toString() : null);
        }
      }
    }
    return config;
  }
}
origin: org.jolokia/jolokia-core

/**
 * Get processing parameters from a string-string map
 *
 * @param pParams params to extra. A parameter "p" is used as extra path info
 * @return the processing parameters
 */
public ProcessingParameters getProcessingParameters(Map<String,String> pParams) {
  Map<ConfigKey,String> procParams = ProcessingParameters.convertToConfigMap(pParams);
  for (Map.Entry<ConfigKey,String> entry : globalConfig.entrySet()) {
    ConfigKey key = entry.getKey();
    if (key.isRequestConfig() && !procParams.containsKey(key)) {
      procParams.put(key,entry.getValue());
    }
  }
  return new ProcessingParameters(procParams,pParams.get(PATH_QUERY_PARAM));
}
origin: org.jolokia/jolokia-osgi

/**
 * Update the configuration hold by this object
 *
 * @param pExtractor an extractor for retrieving the configuration from some external object
 */
public void updateGlobalConfiguration(ConfigExtractor pExtractor) {
  Enumeration e = pExtractor.getNames();
  while (e.hasMoreElements()) {
    String keyS = (String) e.nextElement();
    ConfigKey key = ConfigKey.getGlobalConfigKey(keyS);
    if (key != null) {
      globalConfig.put(key,pExtractor.getParameter(keyS));
    }
  }
}
org.jolokia.configConfigKey

Javadoc

Enumeration defining the various configuration constant names which can be used to configure the agent globally (e.g. in web.xml) or as processing parameters (e.g. as query params).

Most used methods

  • getKeyValue
    Get the string value of a key
  • getDefaultValue
    Get the default value
  • values
  • getGlobalConfigKey
    Get the configuration key for a global configuration
  • getRequestConfigKey
    Get the configuration key for a request configuration
  • isGlobalConfig
    Whether this key is a global configuration key
  • isRequestConfig
    Whether this key is a request configuration key

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • String (java.lang)
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JFrame (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now