Search in sources :

Example 1 with DefaultConfigurationProperty

use of org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty in project mule by mulesoft.

the class DefaultConfigurationPropertiesProvider method createAttributesFromYamlObject.

protected void createAttributesFromYamlObject(String parentPath, Object parentYamlObject, Object yamlObject) {
    if (yamlObject instanceof List) {
        List list = (List) yamlObject;
        if (list.get(0) instanceof Map) {
            list.forEach(value -> createAttributesFromYamlObject(parentPath, yamlObject, value));
        } else {
            if (!(list.get(0) instanceof String)) {
                throw new ConfigurationPropertiesException(createStaticMessage("List of complex objects are not supported as property values. Offending key is " + parentPath), this);
            }
            String[] values = new String[list.size()];
            list.toArray(values);
            String value = join(",", list);
            configurationAttributes.put(parentPath, new DefaultConfigurationProperty(this, parentPath, value));
        }
    } else if (yamlObject instanceof Map) {
        if (parentYamlObject instanceof List) {
            throw new ConfigurationPropertiesException(createStaticMessage("Configuration properties does not support type a list of complex types. Complex type keys are: " + join(",", ((Map) yamlObject).keySet())), this);
        }
        Map<String, Object> map = (Map) yamlObject;
        map.entrySet().stream().forEach(entry -> createAttributesFromYamlObject(createKey(parentPath, entry.getKey()), yamlObject, entry.getValue()));
    } else {
        if (!(yamlObject instanceof String)) {
            throw new ConfigurationPropertiesException(createStaticMessage(format("YAML configuration properties only supports string values, make sure to wrap the value with \" so you force the value to be an string. Offending property is %s with value %s", parentPath, yamlObject)), this);
        }
        String resultObject = createValue(parentPath, (String) yamlObject);
        configurationAttributes.put(parentPath, new DefaultConfigurationProperty(this, parentPath, resultObject));
    }
}
Also used : ResourceProvider(org.mule.runtime.config.api.dsl.model.ResourceProvider) Properties(java.util.Properties) I18nMessageFactory.createStaticMessage(org.mule.runtime.api.i18n.I18nMessageFactory.createStaticMessage) Optional.of(java.util.Optional.of) InitialisationException(org.mule.runtime.api.lifecycle.InitialisationException) IOException(java.io.IOException) HashMap(java.util.HashMap) NoExtend(org.mule.api.annotation.NoExtend) FileInputStream(java.io.FileInputStream) Initialisable(org.mule.runtime.api.lifecycle.Initialisable) ConfigurationPropertiesException(org.mule.runtime.config.internal.dsl.model.config.ConfigurationPropertiesException) String.format(java.lang.String.format) File(java.io.File) AbstractComponent(org.mule.runtime.api.component.AbstractComponent) Yaml(org.yaml.snakeyaml.Yaml) List(java.util.List) String.join(java.lang.String.join) Map(java.util.Map) ComponentLocation(org.mule.runtime.api.component.location.ComponentLocation) Optional(java.util.Optional) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty) InputStream(java.io.InputStream) ConfigurationPropertiesException(org.mule.runtime.config.internal.dsl.model.config.ConfigurationPropertiesException) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with DefaultConfigurationProperty

use of org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty in project mule by mulesoft.

the class ApplicationModel method createProviderFromGlobalProperties.

private ConfigurationPropertiesProvider createProviderFromGlobalProperties(ArtifactConfig artifactConfig) {
    final Map<String, ConfigurationProperty> globalProperties = new HashMap<>();
    artifactConfig.getConfigFiles().stream().forEach(configFile -> {
        configFile.getConfigLines().get(0).getChildren().stream().forEach(configLine -> {
            if (GLOBAL_PROPERTY.equals(configLine.getIdentifier())) {
                String key = configLine.getConfigAttributes().get("name").getValue();
                String rawValue = configLine.getConfigAttributes().get("value").getValue();
                globalProperties.put(key, new DefaultConfigurationProperty(format("global-property - file: %s - lineNumber %s", configFile.getFilename(), configLine.getLineNumber()), key, rawValue));
            }
        });
    });
    return new GlobalPropertyConfigurationPropertiesProvider(globalProperties);
}
Also used : ConfigurationProperty(org.mule.runtime.config.api.dsl.model.properties.ConfigurationProperty) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty) GlobalPropertyConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.GlobalPropertyConfigurationPropertiesProvider) HashMap(java.util.HashMap) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty)

Example 3 with DefaultConfigurationProperty

use of org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty in project mule by mulesoft.

the class ApplicationModel method createConfigurationAttributeResolver.

private void createConfigurationAttributeResolver(ArtifactConfig artifactConfig, Optional<ConfigurationProperties> parentConfigurationProperties, Map<String, String> deploymentProperties) {
    EnvironmentPropertiesConfigurationProvider environmentPropertiesConfigurationProvider = new EnvironmentPropertiesConfigurationProvider();
    ConfigurationPropertiesProvider globalPropertiesConfigurationAttributeProvider = createProviderFromGlobalProperties(artifactConfig);
    DefaultConfigurationPropertiesResolver localResolver = new DefaultConfigurationPropertiesResolver(of(new DefaultConfigurationPropertiesResolver(of(new DefaultConfigurationPropertiesResolver(empty(), environmentPropertiesConfigurationProvider)), globalPropertiesConfigurationAttributeProvider)), environmentPropertiesConfigurationProvider);
    List<ConfigurationPropertiesProvider> configConfigurationPropertiesProviders = getConfigurationPropertiesProvidersFromComponents(artifactConfig, localResolver);
    FileConfigurationPropertiesProvider externalPropertiesConfigurationProvider = new FileConfigurationPropertiesProvider(externalResourceProvider, "External files");
    Optional<ConfigurationPropertiesResolver> parentConfigurationPropertiesResolver = of(localResolver);
    if (parentConfigurationProperties.isPresent()) {
        parentConfigurationPropertiesResolver = of(new DefaultConfigurationPropertiesResolver(empty(), new ConfigurationPropertiesProvider() {

            @Override
            public Optional<ConfigurationProperty> getConfigurationProperty(String configurationAttributeKey) {
                return parentConfigurationProperties.get().resolveProperty(configurationAttributeKey).map(value -> new DefaultConfigurationProperty(parentConfigurationProperties, configurationAttributeKey, value));
            }

            @Override
            public String getDescription() {
                return "Domain properties";
            }
        }));
    }
    if (!configConfigurationPropertiesProviders.isEmpty()) {
        CompositeConfigurationPropertiesProvider configurationAttributesProvider = new CompositeConfigurationPropertiesProvider(configConfigurationPropertiesProviders);
        parentConfigurationPropertiesResolver = of(new DefaultConfigurationPropertiesResolver(parentConfigurationPropertiesResolver, configurationAttributesProvider));
    }
    DefaultConfigurationPropertiesResolver globalPropertiesConfigurationPropertiesResolver = new DefaultConfigurationPropertiesResolver(parentConfigurationPropertiesResolver, globalPropertiesConfigurationAttributeProvider);
    DefaultConfigurationPropertiesResolver systemPropertiesResolver = new DefaultConfigurationPropertiesResolver(of(globalPropertiesConfigurationPropertiesResolver), environmentPropertiesConfigurationProvider);
    DefaultConfigurationPropertiesResolver externalPropertiesResolver = new DefaultConfigurationPropertiesResolver(of(systemPropertiesResolver), externalPropertiesConfigurationProvider);
    if (deploymentProperties.isEmpty()) {
        this.configurationProperties = new PropertiesResolverConfigurationProperties(externalPropertiesResolver);
    } else {
        this.configurationProperties = new PropertiesResolverConfigurationProperties(new DefaultConfigurationPropertiesResolver(of(externalPropertiesResolver), new MapConfigurationPropertiesProvider(deploymentProperties, "Deployment properties")));
    }
}
Also used : ResourceProvider(org.mule.runtime.config.api.dsl.model.ResourceProvider) MacroExpansionModulesModel(org.mule.runtime.config.internal.dsl.model.extension.xml.MacroExpansionModulesModel) CORE_PREFIX(org.mule.runtime.internal.dsl.DslConstants.CORE_PREFIX) MULE_ROOT_ELEMENT(org.mule.runtime.config.api.dsl.CoreDslConstants.MULE_ROOT_ELEMENT) Optional.of(java.util.Optional.of) InitialisationException(org.mule.runtime.api.lifecycle.InitialisationException) ConfigurationProperty(org.mule.runtime.config.api.dsl.model.properties.ConfigurationProperty) Collections.singletonList(java.util.Collections.singletonList) ClassUtils(org.apache.commons.lang3.ClassUtils) DefaultConfigurationParameters(org.mule.runtime.config.internal.dsl.model.DefaultConfigurationParameters) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) MULE_EE_DOMAIN_IDENTIFIER(org.mule.runtime.config.api.dsl.CoreDslConstants.MULE_EE_DOMAIN_IDENTIFIER) DslResolvingContext(org.mule.runtime.api.dsl.DslResolvingContext) DslElementModelFactory(org.mule.runtime.config.api.dsl.model.DslElementModelFactory) ERROR_HANDLER_IDENTIFIER(org.mule.runtime.config.api.dsl.CoreDslConstants.ERROR_HANDLER_IDENTIFIER) ComponentModelReader(org.mule.runtime.config.internal.dsl.model.ComponentModelReader) CompositeConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.CompositeConfigurationPropertiesProvider) PropertiesResolverConfigurationProperties(org.mule.runtime.config.internal.dsl.model.config.PropertiesResolverConfigurationProperties) EnvironmentPropertiesConfigurationProvider(org.mule.runtime.config.internal.dsl.model.config.EnvironmentPropertiesConfigurationProvider) MULE_DOMAIN_IDENTIFIER(org.mule.runtime.config.api.dsl.CoreDslConstants.MULE_DOMAIN_IDENTIFIER) DEFAULT_EXPRESSION_PREFIX(org.mule.runtime.core.api.el.ExpressionManager.DEFAULT_EXPRESSION_PREFIX) ImmutableSet(com.google.common.collect.ImmutableSet) ComponentModelHelper.resolveComponentType(org.mule.runtime.config.internal.dsl.spring.ComponentModelHelper.resolveComponentType) MapConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.MapConfigurationPropertiesProvider) TypedComponentIdentifier(org.mule.runtime.api.component.TypedComponentIdentifier) ImmutableMap(com.google.common.collect.ImmutableMap) Set(java.util.Set) UNKNOWN(org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType.UNKNOWN) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) ServiceLoader(java.util.ServiceLoader) SOURCE_TYPE(org.mule.runtime.config.internal.dsl.spring.BeanDefinitionFactory.SOURCE_TYPE) NameValidationUtil.verifyStringDoesNotContainsReservedCharacters(org.mule.runtime.internal.util.NameValidationUtil.verifyStringDoesNotContainsReservedCharacters) String.format(java.lang.String.format) FileConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.FileConfigurationPropertiesProvider) ERROR_HANDLER(org.mule.runtime.config.api.dsl.CoreDslConstants.ERROR_HANDLER) I18nMessageFactory(org.mule.runtime.api.i18n.I18nMessageFactory) XmlCustomAttributeHandler(org.mule.runtime.config.internal.dsl.processor.xml.XmlCustomAttributeHandler) ComponentBuildingDefinition(org.mule.runtime.dsl.api.component.ComponentBuildingDefinition) List(java.util.List) ElementDeclaration(org.mule.runtime.app.declaration.api.ElementDeclaration) GlobalPropertyConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.GlobalPropertyConfigurationPropertiesProvider) Optional(java.util.Optional) QName(javax.xml.namespace.QName) MuleExtensionModelProvider(org.mule.runtime.core.api.extension.MuleExtensionModelProvider) ComponentIdentifier.builder(org.mule.runtime.api.component.ComponentIdentifier.builder) Optional.empty(java.util.Optional.empty) ComponentBuildingDefinitionRegistry(org.mule.runtime.config.api.dsl.model.ComponentBuildingDefinitionRegistry) DefaultComponentLocation(org.mule.runtime.dsl.api.component.config.DefaultComponentLocation) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) LifecycleUtils.initialiseIfNeeded(org.mule.runtime.core.api.lifecycle.LifecycleUtils.initialiseIfNeeded) ConfigurationProperties(org.mule.runtime.api.component.ConfigurationProperties) ComponentConfiguration(org.mule.runtime.dsl.api.component.config.ComponentConfiguration) ComponentLocationVisitor(org.mule.runtime.config.internal.dsl.model.ComponentLocationVisitor) NameUtils.pluralize(org.mule.runtime.extension.api.util.NameUtils.pluralize) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) MULE_IDENTIFIER(org.mule.runtime.config.api.dsl.CoreDslConstants.MULE_IDENTIFIER) ConfigurationPropertiesProvider(org.mule.runtime.config.api.dsl.model.properties.ConfigurationPropertiesProvider) ArtifactDeclaration(org.mule.runtime.app.declaration.api.ArtifactDeclaration) Component(org.mule.runtime.api.component.Component) Node(org.w3c.dom.Node) BiConsumer(java.util.function.BiConsumer) FLOW_IDENTIFIER(org.mule.runtime.config.api.dsl.CoreDslConstants.FLOW_IDENTIFIER) RuntimeConfigurationException(org.mule.runtime.config.internal.dsl.model.config.RuntimeConfigurationException) ConfigLine(org.mule.runtime.config.api.dsl.processor.ConfigLine) ConfigFile(org.mule.runtime.config.api.dsl.processor.ConfigFile) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty) LinkedList(java.util.LinkedList) Collections.emptyMap(java.util.Collections.emptyMap) Collections.emptySet(java.util.Collections.emptySet) ConfigurationException(org.mule.runtime.core.api.config.ConfigurationException) Optional.ofNullable(java.util.Optional.ofNullable) I18nMessageFactory.createStaticMessage(org.mule.runtime.api.i18n.I18nMessageFactory.createStaticMessage) NameUtils.hyphenize(org.mule.runtime.extension.api.util.NameUtils.hyphenize) ConfigurationParameters(org.mule.runtime.config.api.dsl.model.ConfigurationParameters) ExtensionModelHelper(org.mule.runtime.config.internal.dsl.model.ExtensionModelHelper) ArtifactConfig(org.mule.runtime.config.api.dsl.processor.ArtifactConfig) DefaultConfigurationPropertiesResolver(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationPropertiesResolver) Joiner.on(com.google.common.base.Joiner.on) ObjectTypeVisitor(org.mule.runtime.config.internal.dsl.processor.ObjectTypeVisitor) AbstractComponent(org.mule.runtime.api.component.AbstractComponent) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) ConfigurationPropertiesResolver(org.mule.runtime.config.internal.dsl.model.config.ConfigurationPropertiesResolver) FLOW_REF_IDENTIFIER(org.mule.runtime.config.api.dsl.CoreDslConstants.FLOW_REF_IDENTIFIER) Consumer(java.util.function.Consumer) Collectors.toList(java.util.stream.Collectors.toList) ConfigurationPropertiesProviderFactory(org.mule.runtime.config.api.dsl.model.properties.ConfigurationPropertiesProviderFactory) StringUtils.isBlank(org.apache.commons.lang3.StringUtils.isBlank) CollectionUtils.disjunction(org.apache.commons.collections.CollectionUtils.disjunction) ComponentIdentifier(org.mule.runtime.api.component.ComponentIdentifier) ANY_IDENTIFIER(org.mule.runtime.core.api.exception.Errors.Identifiers.ANY_IDENTIFIER) MapConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.MapConfigurationPropertiesProvider) Optional(java.util.Optional) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty) CompositeConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.CompositeConfigurationPropertiesProvider) MapConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.MapConfigurationPropertiesProvider) FileConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.FileConfigurationPropertiesProvider) GlobalPropertyConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.GlobalPropertyConfigurationPropertiesProvider) ConfigurationPropertiesProvider(org.mule.runtime.config.api.dsl.model.properties.ConfigurationPropertiesProvider) EnvironmentPropertiesConfigurationProvider(org.mule.runtime.config.internal.dsl.model.config.EnvironmentPropertiesConfigurationProvider) FileConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.FileConfigurationPropertiesProvider) DefaultConfigurationPropertiesResolver(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationPropertiesResolver) ConfigurationPropertiesResolver(org.mule.runtime.config.internal.dsl.model.config.ConfigurationPropertiesResolver) DefaultConfigurationPropertiesResolver(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationPropertiesResolver) CompositeConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.CompositeConfigurationPropertiesProvider) PropertiesResolverConfigurationProperties(org.mule.runtime.config.internal.dsl.model.config.PropertiesResolverConfigurationProperties)

Example 4 with DefaultConfigurationProperty

use of org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty in project mule by mulesoft.

the class PropertiesResolverConfigurationPropertiesResolverTestCase method createResolver.

@Before
public void createResolver() {
    DefaultConfigurationPropertiesResolver parentResolver = new DefaultConfigurationPropertiesResolver(Optional.empty(), new ConfigurationPropertiesProvider() {

        private List<ConfigurationProperty> attributes = ImmutableList.<ConfigurationProperty>builder().add(new DefaultConfigurationProperty(this, "parent-key1", "parent-value1")).add(new DefaultConfigurationProperty(this, "parent-key2", "parent-value2")).add(new DefaultConfigurationProperty(this, "parent-complex-key1", "parent-complex-${parent-key1}")).add(new DefaultConfigurationProperty(this, "parent-complex-key2", "${parent-key1}-${parent-complex-key3}")).add(new DefaultConfigurationProperty(this, "parent-complex-key3", "${parent-key2}")).add(new DefaultConfigurationProperty(this, "parent-key-referencing-child", "${child-key1}")).build();

        @Override
        public Optional<ConfigurationProperty> getConfigurationProperty(String configurationAttributeKey) {
            return attributes.stream().filter(cf -> cf.getKey().equals(configurationAttributeKey)).findFirst();
        }

        @Override
        public String getDescription() {
            return PARENT_RESOLVER_DESCRIPTION;
        }
    });
    resolver = new DefaultConfigurationPropertiesResolver(Optional.of(parentResolver), new ConfigurationPropertiesProvider() {

        private List<ConfigurationProperty> attributes = ImmutableList.<ConfigurationProperty>builder().add(new DefaultConfigurationProperty(this, "child-key1", "child-value1")).add(new DefaultConfigurationProperty(this, "child-key2", "child-value2")).add(new DefaultConfigurationProperty(this, "child-complex-key1", "${child-key1}-${parent-complex-key1}")).add(new DefaultConfigurationProperty(this, "child-complex-key2", "${child-key1}-${parent-complex-key2}-${child-key2}")).add(new DefaultConfigurationProperty(this, "unresolved-nested-key", "${child-key1}-${child-key3}")).add(new DefaultConfigurationProperty(this, "invalid-key1", "${nonExistentKey}")).build();

        @Override
        public Optional<ConfigurationProperty> getConfigurationProperty(String configurationAttributeKey) {
            return attributes.stream().filter(cf -> cf.getKey().equals(configurationAttributeKey)).findFirst();
        }

        @Override
        public String getDescription() {
            return CHILD_RESOLVER_DESCRIPTION;
        }
    });
}
Also used : ConfigurationProperty(org.mule.runtime.config.api.dsl.model.properties.ConfigurationProperty) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty) CONFIGURATION_PROPERTIES(org.mule.test.allure.AllureConstants.ConfigurationProperties.CONFIGURATION_PROPERTIES) CONFIGURATION_PROPERTIES_RESOLVER_STORY(org.mule.test.allure.AllureConstants.ConfigurationProperties.ComponentConfigurationAttributesStory.CONFIGURATION_PROPERTIES_RESOLVER_STORY) ConfigurationProperty(org.mule.runtime.config.api.dsl.model.properties.ConfigurationProperty) Test(org.junit.Test) DefaultConfigurationPropertiesResolver(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationPropertiesResolver) Assert.assertThat(org.junit.Assert.assertThat) List(java.util.List) AbstractMuleTestCase(org.mule.tck.junit4.AbstractMuleTestCase) Story(io.qameta.allure.Story) Rule(org.junit.Rule) IsNull.nullValue(org.hamcrest.core.IsNull.nullValue) ConfigurationPropertiesProvider(org.mule.runtime.config.api.dsl.model.properties.ConfigurationPropertiesProvider) ImmutableList(com.google.common.collect.ImmutableList) Feature(io.qameta.allure.Feature) Is.is(org.hamcrest.core.Is.is) ExpectedException.none(org.junit.rules.ExpectedException.none) Optional(java.util.Optional) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty) ExpectedException(org.junit.rules.ExpectedException) Before(org.junit.Before) Optional(java.util.Optional) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) DefaultConfigurationPropertiesResolver(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationPropertiesResolver) ConfigurationPropertiesProvider(org.mule.runtime.config.api.dsl.model.properties.ConfigurationPropertiesProvider) Before(org.junit.Before)

Example 5 with DefaultConfigurationProperty

use of org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty in project mule by mulesoft.

the class DefaultConfigurationPropertiesProvider method readAttributesFromFile.

protected void readAttributesFromFile(InputStream is) throws IOException {
    if (fileLocation.endsWith(PROPERTIES_EXTENSION)) {
        Properties properties = new Properties();
        properties.load(is);
        properties.keySet().stream().map(key -> {
            Object rawValue = properties.get(key);
            rawValue = createValue((String) key, (String) rawValue);
            return new DefaultConfigurationProperty(of(this), (String) key, rawValue);
        }).forEach(configurationAttribute -> {
            configurationAttributes.put(configurationAttribute.getKey(), configurationAttribute);
        });
    } else {
        Yaml yaml = new Yaml();
        Iterable<Object> yamlObjects = yaml.loadAll(is);
        yamlObjects.forEach(yamlObject -> {
            createAttributesFromYamlObject(null, null, yamlObject);
        });
    }
}
Also used : ResourceProvider(org.mule.runtime.config.api.dsl.model.ResourceProvider) Properties(java.util.Properties) I18nMessageFactory.createStaticMessage(org.mule.runtime.api.i18n.I18nMessageFactory.createStaticMessage) Optional.of(java.util.Optional.of) InitialisationException(org.mule.runtime.api.lifecycle.InitialisationException) IOException(java.io.IOException) HashMap(java.util.HashMap) NoExtend(org.mule.api.annotation.NoExtend) FileInputStream(java.io.FileInputStream) Initialisable(org.mule.runtime.api.lifecycle.Initialisable) ConfigurationPropertiesException(org.mule.runtime.config.internal.dsl.model.config.ConfigurationPropertiesException) String.format(java.lang.String.format) File(java.io.File) AbstractComponent(org.mule.runtime.api.component.AbstractComponent) Yaml(org.yaml.snakeyaml.Yaml) List(java.util.List) String.join(java.lang.String.join) Map(java.util.Map) ComponentLocation(org.mule.runtime.api.component.location.ComponentLocation) Optional(java.util.Optional) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty) InputStream(java.io.InputStream) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty) Properties(java.util.Properties) Yaml(org.yaml.snakeyaml.Yaml)

Aggregations

DefaultConfigurationProperty (org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty)5 HashMap (java.util.HashMap)4 List (java.util.List)4 Optional (java.util.Optional)4 String.format (java.lang.String.format)3 Map (java.util.Map)3 Optional.of (java.util.Optional.of)3 AbstractComponent (org.mule.runtime.api.component.AbstractComponent)3 I18nMessageFactory.createStaticMessage (org.mule.runtime.api.i18n.I18nMessageFactory.createStaticMessage)3 InitialisationException (org.mule.runtime.api.lifecycle.InitialisationException)3 ResourceProvider (org.mule.runtime.config.api.dsl.model.ResourceProvider)3 ConfigurationProperty (org.mule.runtime.config.api.dsl.model.properties.ConfigurationProperty)3 File (java.io.File)2 FileInputStream (java.io.FileInputStream)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 String.join (java.lang.String.join)2 Properties (java.util.Properties)2 ConfigurationPropertiesProvider (org.mule.runtime.config.api.dsl.model.properties.ConfigurationPropertiesProvider)2 DefaultConfigurationPropertiesResolver (org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationPropertiesResolver)2