Class ConfigurationUtils
- Opensearch.internal:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic TemplateScript.Factory
compileTemplate
(String processorType, String processorTag, String propertyName, String propertyValue, ScriptService scriptService) static org.opensearch.OpenSearchException
newConfigurationException
(String processorType, String processorTag, String propertyName, Exception cause) static org.opensearch.OpenSearchException
newConfigurationException
(String processorType, String processorTag, String propertyName, String reason) static boolean
readBooleanProperty
(String processorType, String processorTag, Map<String, Object> configuration, String propertyName, boolean defaultValue) static Double
readDoubleProperty
(String processorType, String processorTag, Map<String, Object> configuration, String propertyName) Returns and removes the specified property from the specified configuration map.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.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.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.static Object
readObject
(String processorType, String processorTag, Map<String, Object> configuration, String propertyName) Returns and removes the specified property as anObject
from the specified configuration map.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.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.static Object
readOptionalObject
(Map<String, Object> configuration, String propertyName) Returns and removes the specified property as anObject
from the specified configuration map.static String
readOptionalStringOrIntProperty
(String processorType, String processorTag, Map<String, Object> configuration, String propertyName) Returns and removes the specified property from the specified configuration map.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.static Processor
readProcessor
(Map<String, Processor.Factory> processorFactories, ScriptService scriptService, String type, Object config) static Processor
readProcessor
(Map<String, Processor.Factory> processorFactories, ScriptService scriptService, String type, Map<String, Object> config) readProcessorConfigs
(List<Map<String, Object>> processorConfigs, ScriptService scriptService, Map<String, Processor.Factory> processorFactories) 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.static String
readStringProperty
(String processorType, String processorTag, Map<String, Object> configuration, String propertyName) Returns and removes the specified property from the specified configuration map.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.static TemplateScript.Factory
readTemplateProperty
(String processorType, String processorTag, Map<String, Object> configuration, String propertyName, ScriptService scriptService)
-
Field Details
-
TAG_KEY
- See Also:
-
DESCRIPTION_KEY
- See Also:
-
IGNORE_FAILURE_KEY
- See Also:
-
-
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 anOpenSearchParseException
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 aOpenSearchParseException
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 aOpenSearchParseException
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
-
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 anOpenSearchParseException
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 anOpenSearchParseException
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 anOpenSearchParseException
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 anOpenSearchParseException
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 anObject
from the specified configuration map. If the property is missing anOpenSearchParseException
is thrown -
readOptionalObject
Returns and removes the specified property as anObject
from the specified configuration map. -
newConfigurationException
-
newConfigurationException
-
readProcessorConfigs
public static List<Processor> readProcessorConfigs(List<Map<String, Object>> processorConfigs, ScriptService scriptService, Map<String, throws ExceptionProcessor.Factory> processorFactories) - 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, throws ExceptionObject> config) - Throws:
Exception
-