Class ConfigurationUtils

java.lang.Object
org.opensearch.ingest.ConfigurationUtils

public final class ConfigurationUtils
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String DESCRIPTION_KEY  
    static java.lang.String TAG_KEY  
  • Method Summary

    Modifier and Type Method Description
    static TemplateScript.Factory compileTemplate​(java.lang.String processorType, java.lang.String processorTag, java.lang.String propertyName, java.lang.String propertyValue, ScriptService scriptService)  
    static OpenSearchException newConfigurationException​(java.lang.String processorType, java.lang.String processorTag, java.lang.String propertyName, java.lang.Exception cause)  
    static OpenSearchException newConfigurationException​(java.lang.String processorType, java.lang.String processorTag, java.lang.String propertyName, java.lang.String reason)  
    static java.lang.Boolean readBooleanProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName, boolean defaultValue)  
    static java.lang.Double readDoubleProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
    Returns and removes the specified property from the specified configuration map.
    static java.lang.Integer readIntProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName, java.lang.Integer defaultValue)
    Returns and removes the specified property from the specified configuration map.
    static <T> java.util.List<T> readList​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
    Returns and removes the specified property of type list from the specified configuration map.
    static <T> java.util.Map<java.lang.String,​T> readMap​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
    Returns and removes the specified property of type map from the specified configuration map.
    static java.lang.Object readObject​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
    Returns and removes the specified property as an Object from the specified configuration map.
    static <T> java.util.List<T> readOptionalList​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
    Returns and removes the specified property of type list from the specified configuration map.
    static <T> java.util.Map<java.lang.String,​T> readOptionalMap​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
    Returns and removes the specified property of type map from the specified configuration map.
    static java.lang.String readOptionalStringOrIntProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
    Returns and removes the specified property from the specified configuration map.
    static java.lang.String readOptionalStringProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
    Returns and removes the specified optional property from the specified configuration map.
    static Processor readProcessor​(java.util.Map<java.lang.String,​Processor.Factory> processorFactories, ScriptService scriptService, java.lang.String type, java.lang.Object config)  
    static Processor readProcessor​(java.util.Map<java.lang.String,​Processor.Factory> processorFactories, ScriptService scriptService, java.lang.String type, java.util.Map<java.lang.String,​java.lang.Object> config)  
    static java.util.List<Processor> readProcessorConfigs​(java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> processorConfigs, ScriptService scriptService, java.util.Map<java.lang.String,​Processor.Factory> processorFactories)  
    static java.lang.String readStringOrIntProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName, java.lang.String defaultValue)
    Returns and removes the specified property from the specified configuration map.
    static java.lang.String readStringProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
    Returns and removes the specified property from the specified configuration map.
    static java.lang.String readStringProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName, java.lang.String defaultValue)
    Returns and removes the specified property from the specified configuration map.
    static TemplateScript.Factory readTemplateProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName, ScriptService scriptService)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • readOptionalStringProperty

      public static java.lang.String readOptionalStringProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
      Returns and removes the specified optional property from the specified configuration map. If the property value isn't of type string a OpenSearchParseException is thrown.
    • readStringProperty

      public static java.lang.String readStringProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
      Returns and removes the specified property from the specified configuration map. If the property value isn't of type string an OpenSearchParseException is thrown. If the property is missing an OpenSearchParseException is thrown
    • readStringProperty

      public static java.lang.String readStringProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName, java.lang.String defaultValue)
      Returns and removes the specified property from the specified configuration map. If the property value isn't of type string a OpenSearchParseException is thrown. If the property is missing and no default value has been specified a OpenSearchParseException is thrown
    • readStringOrIntProperty

      public static java.lang.String readStringOrIntProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName, java.lang.String defaultValue)
      Returns and removes the specified property from the specified configuration map. If the property value isn't of type string or int a OpenSearchParseException is thrown. If the property is missing and no default value has been specified a OpenSearchParseException is thrown
    • readOptionalStringOrIntProperty

      public static java.lang.String readOptionalStringOrIntProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
      Returns and removes the specified property from the specified configuration map. If the property value isn't of type string or int a OpenSearchParseException is thrown.
    • readBooleanProperty

      public static java.lang.Boolean readBooleanProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName, boolean defaultValue)
    • readIntProperty

      public static java.lang.Integer readIntProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName, java.lang.Integer defaultValue)
      Returns and removes the specified property from the specified configuration map. If the property value isn't of type int a OpenSearchParseException is thrown. If the property is missing an OpenSearchParseException is thrown
    • readDoubleProperty

      public static java.lang.Double readDoubleProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
      Returns and removes the specified property from the specified configuration map. If the property value isn't of type int a OpenSearchParseException is thrown. If the property is missing an OpenSearchParseException is thrown
    • readOptionalList

      public static <T> java.util.List<T> readOptionalList​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
      Returns and removes the specified property of type list from the specified configuration map. If the property value isn't of type list an OpenSearchParseException is thrown.
    • readList

      public static <T> java.util.List<T> readList​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
      Returns and removes the specified property of type list from the specified configuration map. If the property value isn't of type list an OpenSearchParseException is thrown. If the property is missing an OpenSearchParseException is thrown
    • readMap

      public static <T> java.util.Map<java.lang.String,​T> readMap​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
      Returns and removes the specified property of type map from the specified configuration map. If the property value isn't of type map an OpenSearchParseException is thrown. If the property is missing an OpenSearchParseException is thrown
    • readOptionalMap

      public static <T> java.util.Map<java.lang.String,​T> readOptionalMap​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
      Returns and removes the specified property of type map from the specified configuration map. If the property value isn't of type map an OpenSearchParseException is thrown.
    • readObject

      public static java.lang.Object readObject​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName)
      Returns and removes the specified property as an Object from the specified configuration map.
    • newConfigurationException

      public static OpenSearchException newConfigurationException​(java.lang.String processorType, java.lang.String processorTag, java.lang.String propertyName, java.lang.String reason)
    • newConfigurationException

      public static OpenSearchException newConfigurationException​(java.lang.String processorType, java.lang.String processorTag, java.lang.String propertyName, java.lang.Exception cause)
    • readProcessorConfigs

      public static java.util.List<Processor> readProcessorConfigs​(java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> processorConfigs, ScriptService scriptService, java.util.Map<java.lang.String,​Processor.Factory> processorFactories) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • readTemplateProperty

      public static TemplateScript.Factory readTemplateProperty​(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,​java.lang.Object> configuration, java.lang.String propertyName, ScriptService scriptService)
    • compileTemplate

      public static TemplateScript.Factory compileTemplate​(java.lang.String processorType, java.lang.String processorTag, java.lang.String propertyName, java.lang.String propertyValue, ScriptService scriptService)
    • readProcessor

      public static Processor readProcessor​(java.util.Map<java.lang.String,​Processor.Factory> processorFactories, ScriptService scriptService, java.lang.String type, java.lang.Object config) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • readProcessor

      public static Processor readProcessor​(java.util.Map<java.lang.String,​Processor.Factory> processorFactories, ScriptService scriptService, java.lang.String type, java.util.Map<java.lang.String,​java.lang.Object> config) throws java.lang.Exception
      Throws:
      java.lang.Exception