Package org.elasticsearch.ingest
Class ConfigurationUtils
java.lang.Object
org.elasticsearch.ingest.ConfigurationUtils
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TemplateScript.Factory
compileTemplate(String processorType, String processorTag, String propertyName, String propertyValue, ScriptService scriptService)
static ElasticsearchException
newConfigurationException(String processorType, String processorTag, String propertyName, Exception cause)
static ElasticsearchException
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 String
readMediaTypeProperty(String processorType, String processorTag, Map<String,Object> configuration, String propertyName, String defaultValue)
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 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
readOptionalStringOrLongProperty(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:
- 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 aElasticsearchParseException
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 anElasticsearchParseException
is thrown. If the property is missing anElasticsearchParseException
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 aElasticsearchParseException
is thrown. If the property is missing and no default value has been specified aElasticsearchParseException
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 aElasticsearchParseException
is thrown. If the property is missing and no default value has been specified aElasticsearchParseException
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 aElasticsearchParseException
is 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 aElasticsearchParseException
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 aElasticsearchParseException
is thrown. If the property is missing anElasticsearchParseException
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 aElasticsearchParseException
is thrown. If the property is missing anElasticsearchParseException
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 anElasticsearchParseException
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 anElasticsearchParseException
is thrown. If the property is missing anElasticsearchParseException
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 anElasticsearchParseException
is thrown. If the property is missing anElasticsearchParseException
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 anElasticsearchParseException
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. -
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
-