Class ConfigurationUtils

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

public final class ConfigurationUtils extends Object
Utility class for ingest processor configurations
Opensearch.internal:
  • Field Details

  • Method Details

    • readOptionalStringProperty

      public static String readOptionalStringProperty(String processorType, String processorTag, Map<String,Object> configuration, 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 String readStringProperty(String processorType, String processorTag, Map<String,Object> configuration, 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 String readStringProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName, 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 String readStringOrIntProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName, 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 String readOptionalStringOrIntProperty(String processorType, String processorTag, Map<String,Object> configuration, 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 boolean readBooleanProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName, boolean defaultValue)
    • readIntProperty

      public static Integer readIntProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName, 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 Double readDoubleProperty(String processorType, String processorTag, Map<String,Object> configuration, 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> List<T> readOptionalList(String processorType, String processorTag, Map<String,Object> configuration, 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> List<T> readList(String processorType, String processorTag, Map<String,Object> configuration, 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> Map<String,T> readMap(String processorType, String processorTag, Map<String,Object> configuration, 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> Map<String,T> readOptionalMap(String processorType, String processorTag, Map<String,Object> configuration, 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 Object readObject(String processorType, String processorTag, Map<String,Object> configuration, String propertyName)
      Returns and removes the specified property as an Object from the specified configuration map. If the property is missing an OpenSearchParseException is thrown
    • readOptionalObject

      public static Object readOptionalObject(Map<String,Object> configuration, String propertyName)
      Returns and removes the specified property as an Object from the specified configuration map.
    • newConfigurationException

      public static org.opensearch.OpenSearchException newConfigurationException(String processorType, String processorTag, String propertyName, String reason)
    • newConfigurationException

      public static org.opensearch.OpenSearchException newConfigurationException(String processorType, String processorTag, String propertyName, Exception cause)
    • readProcessorConfigs

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

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

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

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

      public static Processor readProcessor(Map<String,Processor.Factory> processorFactories, ScriptService scriptService, String type, @Nullable Map<String,Object> config) throws Exception
      Throws:
      Exception