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
DESCRIPTION_KEY
static java.lang.String
TAG_KEY
static java.lang.String[]
VALID_MEDIA_TYPES
-
Method Summary
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.Double
readDoubleProperty(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.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.String
readMediaTypeProperty(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)
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
readOptionalStringOrLongProperty(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, ScriptService scriptService, java.lang.String type, java.lang.Object config)
static Processor
readProcessor(java.util.Map<java.lang.String,Processor.Factory> processorFactories, ScriptService scriptService, 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.lang.Object>> processorConfigs, ScriptService scriptService, 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.static TemplateScript.Factory
readTemplateProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName, ScriptService scriptService)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
TAG_KEY
public static final java.lang.String TAG_KEY- See Also:
- Constant Field Values
-
DESCRIPTION_KEY
public static final java.lang.String DESCRIPTION_KEY- See Also:
- Constant Field Values
-
VALID_MEDIA_TYPES
public static final java.lang.String[] VALID_MEDIA_TYPES
-
-
Method Details
-
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. -
readOptionalStringOrLongProperty
public static java.lang.String readOptionalStringOrLongProperty(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 long 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 -
readDoubleProperty
public static java.lang.Double readDoubleProperty(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 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. -
readMediaTypeProperty
public static java.lang.String readMediaTypeProperty(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) -
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.lang.Object>> processorConfigs, ScriptService scriptService, java.util.Map<java.lang.String,Processor.Factory> processorFactories) throws java.lang.Exception- Throws:
java.lang.Exception
-
readTemplateProperty
public static TemplateScript.Factory readTemplateProperty(java.lang.String processorType, java.lang.String processorTag, java.util.Map<java.lang.String,java.lang.Object> configuration, java.lang.String propertyName, ScriptService scriptService) -
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, ScriptService scriptService, java.lang.String type, java.lang.Object config) throws java.lang.Exception- Throws:
java.lang.Exception
-
readProcessor
public static Processor readProcessor(java.util.Map<java.lang.String,Processor.Factory> processorFactories, ScriptService scriptService, java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> config) throws java.lang.Exception- Throws:
java.lang.Exception
-