Class 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

      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 an Object 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, 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 a ElasticsearchParseException 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 an ElasticsearchParseException is thrown. If the property is missing an ElasticsearchParseException 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 a ElasticsearchParseException is thrown. If the property is missing and no default value has been specified a ElasticsearchParseException 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 a ElasticsearchParseException is thrown. If the property is missing and no default value has been specified a ElasticsearchParseException 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 a ElasticsearchParseException 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 a ElasticsearchParseException is thrown. If the property is missing an ElasticsearchParseException 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 an ElasticsearchParseException 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 an ElasticsearchParseException is thrown. If the property is missing an ElasticsearchParseException 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 an ElasticsearchParseException is thrown. If the property is missing an ElasticsearchParseException 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 an ElasticsearchParseException 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 an Object 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.lang.Object>> processorConfigs,
                                                                     ScriptService scriptService,
                                                                     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,
                                              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