Package org.elasticsearch.ingest
Class ConfigurationUtils
- java.lang.Object
-
- org.elasticsearch.ingest.ConfigurationUtils
-
public final class ConfigurationUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.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.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.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.static StringreadOptionalStringOrIntProperty(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)static List<Processor>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.
-
-
-
Field Detail
-
TAG_KEY
public static final String TAG_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
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.
-
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 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.
-
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
-
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
-
-