Package org.elasticsearch.ingest
Class ConfigurationUtils
java.lang.Object
org.elasticsearch.ingest.ConfigurationUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic TemplateScript.FactorycompileTemplate(String processorType, String processorTag, String propertyName, String propertyValue, ScriptService scriptService)static ElasticsearchExceptionnewConfigurationException(String processorType, String processorTag, String propertyName, Exception cause)static ElasticsearchExceptionnewConfigurationException(String processorType, String processorTag, String propertyName, String reason)static BooleanreadBooleanProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName, boolean defaultValue)static DoublereadDoubleProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName)Returns and removes the specified property from the specified configuration map.static IntegerreadIntProperty(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 StringreadMediaTypeProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName, String defaultValue)static ObjectreadObject(String processorType, String processorTag, Map<String,Object> configuration, String propertyName)Returns and removes the specified property as anObjectfrom 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 StringreadOptionalStringOrIntProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName)Returns and removes the specified property from the specified configuration map.static StringreadOptionalStringOrLongProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName)Returns and removes the specified property from the specified configuration map.static StringreadOptionalStringProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName)Returns and removes the specified optional property from the specified configuration map.static ProcessorreadProcessor(Map<String,Processor.Factory> processorFactories, ScriptService scriptService, String type, Object config)static ProcessorreadProcessor(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 StringreadStringOrIntProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName, String defaultValue)Returns and removes the specified property from the specified configuration map.static StringreadStringProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName)Returns and removes the specified property from the specified configuration map.static StringreadStringProperty(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.FactoryreadTemplateProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName, ScriptService scriptService)
-
Field Details
-
TAG_KEY
- See Also:
- Constant Field Values
-
DESCRIPTION_KEY
- See Also:
- Constant Field Values
-
VALID_MEDIA_TYPES
-
-
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 aElasticsearchParseExceptionis 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 anElasticsearchParseExceptionis thrown. If the property is missing anElasticsearchParseExceptionis 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 aElasticsearchParseExceptionis thrown. If the property is missing and no default value has been specified aElasticsearchParseExceptionis 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 aElasticsearchParseExceptionis thrown. If the property is missing and no default value has been specified aElasticsearchParseExceptionis 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 aElasticsearchParseExceptionis thrown. -
readOptionalStringOrLongProperty
public static String readOptionalStringOrLongProperty(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 long aElasticsearchParseExceptionis 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 aElasticsearchParseExceptionis thrown. If the property is missing anElasticsearchParseExceptionis 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 aElasticsearchParseExceptionis thrown. If the property is missing anElasticsearchParseExceptionis 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 anElasticsearchParseExceptionis 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 anElasticsearchParseExceptionis thrown. If the property is missing anElasticsearchParseExceptionis 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 anElasticsearchParseExceptionis thrown. If the property is missing anElasticsearchParseExceptionis 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 anElasticsearchParseExceptionis thrown. -
readObject
public static Object readObject(String processorType, String processorTag, Map<String,Object> configuration, String propertyName)Returns and removes the specified property as anObjectfrom the specified configuration map. -
readMediaTypeProperty
-
newConfigurationException
public static ElasticsearchException newConfigurationException(String processorType, String processorTag, String propertyName, String reason) -
newConfigurationException
public static ElasticsearchException 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, Object config) throws Exception- Throws:
Exception
-
readProcessor
public static Processor readProcessor(Map<String,Processor.Factory> processorFactories, ScriptService scriptService, String type, Map<String,Object> config) throws Exception- Throws:
Exception
-