Package org.elasticsearch.ingest
Class ConfigurationUtils
- java.lang.Object
-
- org.elasticsearch.ingest.ConfigurationUtils
-
public final class ConfigurationUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
TAG_KEY
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TemplateScript.Factory
compileTemplate(java.lang.String processorType, java.lang.String processorTag, java.lang.String propertyName, java.lang.String propertyValue, ScriptService scriptService)
static ElasticsearchException
newConfigurationException(java.lang.String processorType, java.lang.String processorTag, java.lang.String propertyName, java.lang.Exception cause)
static ElasticsearchException
newConfigurationException(java.lang.String processorType, java.lang.String processorTag, java.lang.String propertyName, java.lang.String reason)
static java.lang.Boolean
readBooleanProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName, boolean defaultValue)
static java.lang.Integer
readIntProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName, java.lang.Integer defaultValue)
Returns and removes the specified property from the specified configuration map.static <T> java.util.List<T>
readList(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName)
Returns and removes the specified property of type list from the specified configuration map.static <T> java.util.Map<java.lang.String,T>
readMap(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName)
Returns and removes the specified property of type map from the specified configuration map.static java.lang.Object
readObject(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName)
Returns and removes the specified property as anObject
from the specified configuration map.static <T> java.util.List<T>
readOptionalList(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName)
Returns and removes the specified property of type list from the specified configuration map.static <T> java.util.Map<java.lang.String,T>
readOptionalMap(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName)
Returns and removes the specified property of type map from the specified configuration map.static java.lang.String
readOptionalStringOrIntProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName)
Returns and removes the specified property from the specified configuration map.static java.lang.String
readOptionalStringProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName)
Returns and removes the specified optional property from the specified configuration map.static Processor
readProcessor(java.util.Map<java.lang.String,Processor.Factory> processorFactories, java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> config)
static java.util.List<Processor>
readProcessorConfigs(java.util.List<java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> processorConfigs, java.util.Map<java.lang.String,Processor.Factory> processorFactories)
static java.lang.String
readStringOrIntProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName, java.lang.String defaultValue)
Returns and removes the specified property from the specified configuration map.static java.lang.String
readStringProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName)
Returns and removes the specified property from the specified configuration map.static java.lang.String
readStringProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName, java.lang.String defaultValue)
Returns and removes the specified property from the specified configuration map.
-
-
-
Field Detail
-
TAG_KEY
public static final java.lang.String TAG_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
readOptionalStringProperty
public static java.lang.String readOptionalStringProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.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 java.lang.String readStringProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.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 java.lang.String readStringProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName, java.lang.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 java.lang.String readStringOrIntProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName, java.lang.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 java.lang.String readOptionalStringOrIntProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.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.
-
readBooleanProperty
public static java.lang.Boolean readBooleanProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName, boolean defaultValue)
-
readIntProperty
public static java.lang.Integer readIntProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName, java.lang.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
-
readOptionalList
public static <T> java.util.List<T> readOptionalList(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.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> java.util.List<T> readList(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.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> java.util.Map<java.lang.String,T> readMap(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.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> java.util.Map<java.lang.String,T> readOptionalMap(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.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 java.lang.Object readObject(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName)
Returns and removes the specified property as anObject
from the specified configuration map.
-
newConfigurationException
public static ElasticsearchException newConfigurationException(java.lang.String processorType, java.lang.String processorTag, java.lang.String propertyName, java.lang.String reason)
-
newConfigurationException
public static ElasticsearchException newConfigurationException(java.lang.String processorType, java.lang.String processorTag, java.lang.String propertyName, java.lang.Exception cause)
-
readProcessorConfigs
public static java.util.List<Processor> readProcessorConfigs(java.util.List<java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> processorConfigs, java.util.Map<java.lang.String,Processor.Factory> processorFactories) throws java.lang.Exception
- Throws:
java.lang.Exception
-
compileTemplate
public static TemplateScript.Factory compileTemplate(java.lang.String processorType, java.lang.String processorTag, java.lang.String propertyName, java.lang.String propertyValue, ScriptService scriptService)
-
readProcessor
public static Processor readProcessor(java.util.Map<java.lang.String,Processor.Factory> processorFactories, java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> config) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-