You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2015/08/21 02:41:44 UTC
[2/6] incubator-tamaya git commit: Implemented,
moved experimental modules and added them to non experimental parts:
- functions (operators and queries) - model (validation and documentation) -
management (jmx bean support)
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java
----------------------------------------------------------------------
diff --git a/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java b/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java
deleted file mode 100644
index 94ec3ea..0000000
--- a/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.management;
-
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Managed bean interface for accessing environment data.
- */
-public interface ManagedConfigMBean {
-
- /**
- * Get a general description of the configuration (context) in place, in JSON format:
- * <pre>
- * ConfigurationContext[gqContextClassName] {
- * version = 2345-34334-2333-3434,
- * config {
- * key = "value",
- * key2 = "value2"
- * ...
- * },
- * filters = [...],
- * converters{...},
- * property-sources{...}
- * }
- * </pre>
- *
- * @return a JSON formatted meta-information.
- */
- String getConfigurationInfo();
-
-
- /**
- * Accesses a configuration current a given type as Map.
- *
- * @return the current configuration map.
- * @throws org.apache.tamaya.ConfigException If the configuration is not available.
- */
- Map<String, String> getConfiguration();
-
- /**
- * Accesses a configuration values for current a given config area as Map.
- * @param area the target area key, not null.
- * @param recursive if set to false only direct child keys of the given area are returned.
- * @return the key/values found, including the recursive child values.
- * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded.
- */
- Map<String, String> getConfigurationArea(String area, boolean recursive);
-
- /**
- * Access the defined areas for a given configuration.
- * @return the areas defined (only returning the areas that contain properties).
- * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded
- */
- Set<String> getAreas();
-
- /**
- * Access the transitive areas for the current configuration.
- * @return the transitive areas defined.
- * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded
- */
- Set<String> getTransitiveAreas();
-
- /**
- * Allows to determine if an area is existing.
- * @param area the target area key, not null.
- * @return true, if such an area exists (the area may be empty).
- */
- boolean isAreaExisting(String area);
-
- /**
- * Allows to determine if an area is empty.
- * @param area the target area key, not null.
- * @return true, if such an area exists and is not empty.
- */
- default boolean isAreaEmpty(String area){
- return getConfigurationArea(area, true).isEmpty();
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java
----------------------------------------------------------------------
diff --git a/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java b/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java
deleted file mode 100644
index e85b1c1..0000000
--- a/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.se;
-
-import org.apache.tamaya.Environment;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-
-/**
- * MBean implementation for accessing environment data.
- * Created by Anatole on 24.11.2014.
- */
-public class ManagedEnvironment implements ManagedEnvironmentMBean{
-
- @Override
- public List<String> getEnvironmentHierarchy() {
- return Environment.getEnvironmentHierarchy();
- }
-
- @Override
- public String getEnvironmentInfo(String environmentContext) {
- try {
- // TODO
- return "EnvironmentInfo {}";
- }
- catch(Exception e){
- // TODO logging
- return "EnvironmentInfo{}";
- }
- }
-
- @Override
- public Map<String, String> getEnvironment(String environmentType, String context) {
- try {
- Optional<Environment> env = Environment.getInstance(environmentType, context);
- if (env.isPresent()) {
- return env.get().toMap();
- }
- } catch (Exception e) {
- // TODO logging
- }
- return Collections.emptyMap();
- }
-
- @Override
- public String getEnvironmentInfo() {
- // TODO
- return "EnvironmentInfo {}";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java
----------------------------------------------------------------------
diff --git a/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java b/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java
deleted file mode 100644
index b7cdfc3..0000000
--- a/sandbox/management/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.se;
-
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * Managed bean interface for accessing environment data.
- */
-public interface ManagedEnvironmentMBean {
-
- /**
- * Returns the current environment hierarchy defined.
- * @see org.apache.tamaya.Environment#getEnvironmentType()
- * @see org.apache.tamaya.Environment#getEnvironmentHierarchy()
- * @return the current environment type hierarchy defined, never null.
- */
- public List<String> getEnvironmentHierarchy();
-
- /**
- * Get the common environment information in JSON format, which has the following form:
- * <pre>
- * Environment {
- * id: "system:VM,domain:testdata",
- * metaInfo {
- * a: "aValue",
- * b: "bValue"
- * }
- * entries{
- * val1: "value1",
- * val2: "value2",
- * }
- * }
- * </pre>
- * @see org.apache.tamaya.Environment
- * @param environmentContext the identifier to access the environment instance
- * @return the environment JSON info, or null, if no such environment is accessible.
- */
- public String getEnvironmentInfo(String environmentContext);
-
- /**
- * Access the given environment as Map. the {@code environmentContext} is added to the
- * map using the key {@code __environmentId}.
- * @param environmentContext the identifier to access the environment instance
- * @param context the context, not null.
- * @return a map with the currently defined environment keys and values.
- */
- public Map<String,String> getEnvironment(String environmentContext, String context);
-
- /**
- * Get a general JSON info on the currently available environments current the form:
- * <pre>
- * EnvironmentInfo{
- * host: "hostName",
- * ipAddress: "111.112.123.123",
- * typeHierarchy: {"system", "domain", "ear", "war", "saas-scope", "tenant"}
- * environments {
- * Environment {
- * id: "system:VM,domain:testdata",
- * ...
- * },
- * ...
- * }
- * }
- * </pre>
- * @return
- */
- public String getEnvironmentInfo();
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/management/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/sandbox/management/src/main/resources/META-INF/beans.xml b/sandbox/management/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index adee378..0000000
--- a/sandbox/management/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy current the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
-
-</beans>
-
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/management/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/sandbox/management/src/test/resources/META-INF/beans.xml b/sandbox/management/src/test/resources/META-INF/beans.xml
deleted file mode 100644
index adee378..0000000
--- a/sandbox/management/src/test/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy current the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
-
-</beans>
-
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/model/pom.xml b/sandbox/model/pom.xml
deleted file mode 100644
index 92acf9b..0000000
--- a/sandbox/model/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy current the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.tamaya.ext</groupId>
- <artifactId>tamaya-sandbox</artifactId>
- <version>0.1-incubating-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
-
- <groupId>org.apache.tamaya.ext.model</groupId>
- <artifactId>tamaya-model</artifactId>
- <name>Apache Tamaya Extension Modules: Configuration Model Infrastructure</name>
- <description>This extension module provides functionality to describe, document and
- validate configuration during runtime.
- </description>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tamaya</groupId>
- <artifactId>tamaya-java7-api</artifactId>
- <version>0.1-incubating-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tamaya</groupId>
- <artifactId>tamaya-java7-core</artifactId>
- <version>0.1-incubating-SNAPSHOT</version>
- <scope>Test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tamaya.ext</groupId>
- <artifactId>tamaya-formats</artifactId>
- <version>0.1-incubating-SNAPSHOT</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.tamaya.ext</groupId>
- <artifactId>tamaya-json</artifactId>
- <version>0.1-incubating-SNAPSHOT</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/ConfigValidator.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/ConfigValidator.java b/sandbox/model/src/main/java/org/apache/tamaya/model/ConfigValidator.java
deleted file mode 100644
index c2f029d..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/ConfigValidator.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.model;
-
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.ConfigurationProvider;
-import org.apache.tamaya.model.spi.ValidationProviderSpi;
-import org.apache.tamaya.spi.ServiceContextManager;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Validator accessor to validate the current configuration.
- */
-public final class ConfigValidator {
-
- /**
- * Singleton constructor.
- */
- private ConfigValidator() {
- }
-
- /**
- * Get the sections defined.
- *
- * @return the sections defined, never null.
- */
- public static Collection<Validation> getValidations() {
- List<Validation> result = new ArrayList<>();
- for (ValidationProviderSpi model : ServiceContextManager.getServiceContext().getServices(ValidationProviderSpi.class)) {
- result.addAll(model.getValidations());
- }
- return result;
- }
-
- /**
- * Validates the current configuration.
- *
- * @return the validation results, never null.
- */
- public static Collection<ValidationResult> validate() {
- return validate(false);
- }
-
- /**
- * Validates the current configuration.
- * @param showUndefined show any unknown parameters.
- * @return the validation results, never null.
- */
- public static Collection<ValidationResult> validate(boolean showUndefined) {
- return validate(ConfigurationProvider.getConfiguration(), showUndefined);
- }
-
- /**
- * Validates the given configuration.
- *
- * @param config the configuration to be validated against, not null.
- * @return the validation results, never null.
- */
- public static Collection<ValidationResult> validate(Configuration config) {
- return validate(config, false);
- }
-
- /**
- * Validates the given configuration.
- *
- * @param config the configuration to be validated against, not null.
- * @return the validation results, never null.
- */
- public static Collection<ValidationResult> validate(Configuration config, boolean showUndefined) {
- List<ValidationResult> result = new ArrayList<>();
- for (Validation defConf : getValidations()) {
- result.addAll(defConf.validate(config));
- }
- if(showUndefined){
- Map<String,String> map = new HashMap<>(config.getProperties());
- for (Validation defConf : getValidations()) {
- if("Parameter".equals(defConf.getType())){
- map.remove(defConf.getName());
- }
- }
- for(Map.Entry<String,String> entry:map.entrySet()){
- result.add(ValidationResult.ofUndefined(entry.getKey()));
- }
- }
- return result;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/Validation.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/Validation.java b/sandbox/model/src/main/java/org/apache/tamaya/model/Validation.java
deleted file mode 100644
index a262070..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/Validation.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.model;
-
-import org.apache.tamaya.Configuration;
-
-import java.util.Collection;
-
-/**
- * Basis structure describing a validated item, by default a parameter or a section.
- */
-public interface Validation {
-
-
- /**
- * Get the type of item that is validated by a validation.
- * @return the validted type, never null.
- */
- String getType();
-
- /**
- * Get the item's name, it should minimally describe the validation. Examples are:
- * <pre>
- * Area: a.b.c
- * Params: a.b.c:paramName
- * Filter: a.b.c.FilterImplClass
- * Dependency: mydep
- * CombinationPolicy: a.b.c.MyCombinationPolicyClass
- * </pre>
- */
- String getName();
-
- /**
- * Get an description of the item, using the default locale. The description is basically optional
- * though it is higly recommended to provide a description, so the validation issues is well
- * resolvable.
- *
- * @return the description required, or null.
- */
- String getDescription();
-
- /**
- * Validates the item and all its children against the given configuration.
- *
- * @param config the configuration to be validated against, not null.
- * @return the validation results, never null.
- */
- Collection<ValidationResult> validate(Configuration config);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/ValidationResult.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/ValidationResult.java b/sandbox/model/src/main/java/org/apache/tamaya/model/ValidationResult.java
deleted file mode 100644
index 1970512..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/ValidationResult.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.model;
-
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.model.spi.AbstractValidation;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Objects;
-
-/**
- * Models a partial configuration validation result.
- */
-public final class ValidationResult {
- /**
- * the config section.
- */
- private Validation validation;
- /**
- * The validation result.
- */
- private ValidationState result;
- /**
- * The validation message.
- */
- private String message;
-
- /**
- * Creates a new ValidationResult.
- *
- * @param validation the validation item, not null.
- */
- public static ValidationResult ofValid(Validation validation) {
- return new ValidationResult(validation, ValidationState.VALID, null);
- }
-
- /**
- * Creates a new ValidationResult.
- *
- * @param validation the validation item, not null.
- */
- public static ValidationResult ofMissing(Validation validation) {
- return new ValidationResult(validation, ValidationState.MISSING, null);
- }
-
-
- /**
- * Creates a new ValidationResult.
- *
- * @param validation the validation item, not null.
- * @param message Additional message to be shown (optional).
- */
- public static ValidationResult ofMissing(Validation validation, String message) {
- return new ValidationResult(validation, ValidationState.MISSING, message);
- }
-
- /**
- * Creates a new ValidationResult.
- *
- * @param validation the validation item, not null.
- */
- public static ValidationResult ofError(Validation validation, String error) {
- return new ValidationResult(validation, ValidationState.ERROR, error);
- }
-
- /**
- * Creates a new ValidationResult.
- *
- * @param validation the validation item, not null.
- */
- public static ValidationResult ofWarning(Validation validation, String warning) {
- return new ValidationResult(validation, ValidationState.WARNING, warning);
- }
-
- /**
- * Creates a new ValidationResult.
- *
- * @param validation the validation item, not null.
- */
- public static ValidationResult ofDeprecated(Validation validation, String alternateUsage) {
- return new ValidationResult(validation, ValidationState.DEPRECATED, alternateUsage != null ? "Use instead: " + alternateUsage : null);
- }
-
- /**
- * Creates a new ValidationResult.
- *
- * @param validation the validation item, not null.
- */
- public static ValidationResult ofDeprecated(Validation validation) {
- return new ValidationResult(validation, ValidationState.DEPRECATED, null);
- }
-
- /**
- * Creates a new ValidationResult.
- *
- * @param key the name/key
- * @return a corresponding validation item
- */
- public static ValidationResult ofUndefined(final String key) {
- return new ValidationResult(new AbstractValidation(key, "Undefined key: " + key) {
-
- @Override
- public String getType() {
- return "<undefined>";
- }
-
- @Override
- public Collection<ValidationResult> validate(Configuration config) {
- return Collections.emptySet();
- }
- }, ValidationState.UNDEFINED, null);
- }
-
-
- /**
- * Constructor.
- *
- * @param validation the validation item, not null.
- * @param result the validation result, not null.
- * @param message the detail message.
- */
- public static ValidationResult of(Validation validation, ValidationState result, String message) {
- return new ValidationResult(validation, result, message);
- }
-
-
- /**
- * Constructor.
- *
- * @param validation the validation item, not null.
- * @param result the validation result, not null.
- * @param message the detail message.
- */
- private ValidationResult(Validation validation, ValidationState result, String message) {
- this.message = message;
- this.validation = Objects.requireNonNull(validation);
- this.result = Objects.requireNonNull(result);
- }
-
- /**
- * Get the validation section.
- *
- * @return the section, never null.
- */
- public Validation getValidation() {
- return validation;
- }
-
- /**
- * Get the validation result.
- *
- * @return the result, never null.
- */
- public ValidationState getResult() {
- return result;
- }
-
- /**
- * Get the detail message.
- *
- * @return the detail message, or null.
- */
- public String getMessage() {
- return message;
- }
-
- @Override
- public String toString() {
- if (message != null) {
- return result + ": " + validation.getName() + " (" + validation.getType() + ") -> " + message + '\n';
- }
- return result + ": " + validation.getName() + " (" + validation.getType() + ")";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/ValidationState.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/ValidationState.java b/sandbox/model/src/main/java/org/apache/tamaya/model/ValidationState.java
deleted file mode 100644
index 0170085..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/ValidationState.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.model;
-
-/**
- * Enum type describing the different validation results supported.
- */
-public enum ValidationState {
- /**
- * The validated item is valid
- */
- VALID,
- /**
- * The validated item is deprecated.
- */
- DEPRECATED,
- /**
- * The validated item is correct, but the value is worth a warning.
- */
- WARNING,
- /**
- * The given section or parameter is not a defined/validated item. It may be still valid, but typically,
- * when validation is fully implemented, such a parametr or section should be removed.
- */
- UNDEFINED,
- /**
- * A required parameter or section is missing.
- */
- MISSING,
- /**
- * The validated item has an invalid value.
- */
- ERROR;
-
- /**
- * Method to quickly evaluate if the current state is an error state.
- *
- * @return true, if the state is not ERROR or MISSING.
- */
- boolean isError() {
- return this.ordinal() == MISSING.ordinal() || this.ordinal() == ERROR.ordinal();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
deleted file mode 100644
index 88f254f..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredInlineModelProviderSpi.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.model.internal;
-
-import org.apache.tamaya.ConfigurationProvider;
-import org.apache.tamaya.model.Validation;
-import org.apache.tamaya.model.spi.ConfigValidationsReader;
-import org.apache.tamaya.model.spi.ValidationProviderSpi;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-/**
- * Validation provider that reads model metadata from the current {@link org.apache.tamaya.Configuration}.
- */
-public class ConfiguredInlineModelProviderSpi implements ValidationProviderSpi {
-
- /** The logger. */
- private static final Logger LOG = Logger.getLogger(ConfiguredInlineModelProviderSpi.class.getName());
- /** parameter to disable this provider. By default the provider is active. */
- private static final String MODEL_EANABLED_PARAM = "org.apache.tamaya.model.integrated.enabled";
-
- /** The validations read. */
- private List<Validation> validations = new ArrayList<>();
-
-
- /**
- * Constructor, typically called by the {@link java.util.ServiceLoader}.
- */
- public ConfiguredInlineModelProviderSpi() {
- String enabledVal = ConfigurationProvider.getConfiguration().get(MODEL_EANABLED_PARAM);
- boolean enabled = enabledVal==null? true: "true".equalsIgnoreCase(enabledVal);
- if (enabled) {
- LOG.info("Reading model configuration from config...");
- Map<String,String> config = ConfigurationProvider.getConfiguration().getProperties();
- validations.addAll(ConfigValidationsReader.loadValidations(config,
- "<Inline Configuration Model>"));
- }
- validations = Collections.unmodifiableList(validations);
- }
-
-
- @Override
- public Collection<Validation> getValidations() {
- return validations;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java
deleted file mode 100644
index 6eb64aa..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredPropertiesValidationProviderSpi.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package org.apache.tamaya.model.internal;
-
-import org.apache.tamaya.ConfigurationProvider;
-import org.apache.tamaya.model.Validation;
-import org.apache.tamaya.model.spi.AreaValidation;
-import org.apache.tamaya.model.spi.ConfigValidationsReader;
-import org.apache.tamaya.model.spi.ParameterValidation;
-import org.apache.tamaya.model.spi.ValidationProviderSpi;
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Validation provider that reads model metadata from property files from
- * {@code classpath*:META-INF/configmodel.properties} in the following format:
- * <pre>
- * ###################################################################################
- * # Example of a configuration metamodel expressed via properties.
- * ####################################################################################
- *
- * # Metamodel information
- * [model].provider=ConfigModel Extension
- *
- * ####################################################################################
- * # Description of Configuration Sections (minimal, can be extended by other modules).
- * # By default its interpreted as a section !
- * ####################################################################################
- *
- * # a (section)
- * {model}a.class=Section
- * {model}a.params2.class=Parameter
- * {model}a.params2.type=String
- * {model}a.params2.required=true
- * {model}a.params2.description=a required parameter
- *
- * {model}a.paramInt.class=Parameter
- * {model}a.paramInt.ref=MyNumber
- * {model}a.paramInt.description=an optional parameter (default)
- *
- * {model}a._number.class=Parameter
- * {model}a._number.type=Integer
- * {model}a._number.deprecated=true
- * {model}a._number.mappedTo=a.paramInt
- *
- * # a.b.c (section)
- * {model}a.b.c.class=Section
- * {model}a.b.c.description=Just a test section
- *
- * # a.b.c.aRequiredSection (section)
- * {model}a.b.c.aRequiredSection.class=Section
- * {model}a.b.c.aRequiredSection.required=true
- * {model}a.b.c.aRequiredSection.description=A section containing required parameters is called a required section.\
- * Sections can also explicitly be defined to be required, but without\
- * specifying the paramteres to be contained.,
- *
- * # a.b.c.aRequiredSection.subsection (section)
- * {model}a.b.c.aRequiredSection.subsection.class=Section
- *
- * {model}a.b.c.aRequiredSection.subsection.param0.class=Parameter
- * {model}a.b.c.aRequiredSection.subsection.param0.type=String
- * {model}a.b.c.aRequiredSection.subsection.param0.description=a minmally documented String parameter
- * # A minmal String parameter
- * {model}a.b.c.aRequiredSection.subsection.param00.class=Parameter
- * {model}a.b.c.aRequiredSection.subsection.param00.type=String
- *
- * # a.b.c.aRequiredSection.subsection (section)
- * {model}a.b.c.aRequiredSection.subsection.param1.class=Parameter
- * {model}a.b.c.aRequiredSection.subsection.param1.type = String
- * {model}a.b.c.aRequiredSection.subsection.param1.required = true
- * {model}a.b.c.aRequiredSection.subsection.intParam.class=Parameter
- * {model}a.b.c.aRequiredSection.subsection.intParam.type = Integer
- * {model}a.b.c.aRequiredSection.subsection.intParam.description=an optional parameter (default)
- *
- * # a.b.c.aRequiredSection.nonempty-subsection (section)
- * {model}a.b.c.aRequiredSection.nonempty-subsection.class=Section
- * {model}a.b.c.aRequiredSection.nonempty-subsection.required=true
- *
- * # a.b.c.aRequiredSection.optional-subsection (section)
- * {model}a.b.c.aRequiredSection.optional-subsection.class=Section
- *
- * # a.b.c.aValidatedSection (section)
- * {model}a.b.c.aValidatedSection.class=Section
- * {model}a.b.c.aValidatedSection.description=A validated section.
- * {model}a.b.c.aValidatedSection.validations=org.apache.tamaya.model.TestValidator
- * </pre>
- */
-public class ConfiguredPropertiesValidationProviderSpi implements ValidationProviderSpi {
-
- /** The logger. */
- private static final Logger LOG = Logger.getLogger(ConfiguredPropertiesValidationProviderSpi.class.getName());
- /** parameter to disable this provider. By default the provider is active. */
- private static final String MODEL_EANABLED_PARAM = "org.apache.tamaya.model.default.enabled";
- /** The validations read. */
- private List<Validation> validations = new ArrayList<>();
-
- public ConfiguredPropertiesValidationProviderSpi() {
- String enabledVal = ConfigurationProvider.getConfiguration().get(MODEL_EANABLED_PARAM);
- boolean enabled = enabledVal==null? true: "true".equalsIgnoreCase(enabledVal);
- if(!enabled){
- LOG.info("Reading model data from META-INF/configmodel.properties has been disabled.");
- return;
- }
- try {
- LOG.info("Reading model data from META-INF/configmodel.properties...");
- Enumeration<URL> configs = getClass().getClassLoader().getResources("META-INF/configmodel.properties");
- while (configs.hasMoreElements()) {
- URL config = configs.nextElement();
- try (InputStream is = config.openStream()) {
- Properties props = new Properties();
- props.load(is);
- validations.addAll(ConfigValidationsReader.loadValidations(props, config.toString()));
- } catch (Exception e) {
- Logger.getLogger(getClass().getName()).log(Level.SEVERE,
- "Error loading config metadata from " + config, e);
- }
- }
- } catch (Exception e) {
- LOG.log(Level.SEVERE,
- "Error loading config metadata from META-INF/configmodel.properties", e);
- }
- validations = Collections.unmodifiableList(validations);
- }
-
-
- @Override
- public Collection<Validation> getValidations() {
- return validations;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredResourcesModelProviderSpi.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredResourcesModelProviderSpi.java b/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredResourcesModelProviderSpi.java
deleted file mode 100644
index 1eb7cc5..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/internal/ConfiguredResourcesModelProviderSpi.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.apache.tamaya.model.internal;
-
-import org.apache.tamaya.ConfigurationProvider;
-import org.apache.tamaya.format.ConfigurationData;
-import org.apache.tamaya.format.ConfigurationFormats;
-import org.apache.tamaya.model.Validation;
-import org.apache.tamaya.model.spi.AreaValidation;
-import org.apache.tamaya.model.spi.ConfigValidationsReader;
-import org.apache.tamaya.model.spi.ParameterValidation;
-import org.apache.tamaya.model.spi.ValidationProviderSpi;
-import org.apache.tamaya.resource.ConfigResources;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Validation provider that reads model metadata from property files from
- * {@code classpath*:META-INF/configmodel.json} in the following format:
- * <pre>
- * </pre>
- */
-public class ConfiguredResourcesModelProviderSpi implements ValidationProviderSpi {
-
- /** The logger. */
- private static final Logger LOG = Logger.getLogger(ConfiguredResourcesModelProviderSpi.class.getName());
- /** The parameter that can be used to configure the location of the configuration model resources. */
- private static final String MODEL_RESOURCE_PARAM = "org.apache.tamaya.model.resources";
- /** The resource class to checked for testing the availability of the resources extension module. */
- private static final String CONFIG_RESOURCE_CLASS = "org.apache.tamaya.resource.ConfigResource";
- /** The resource class to checked for testing the availability of the formats extension module. */
- private static final String CONFIGURATION_FORMATS_CLASS = "org.apache.tamaya.format.ConfigurationFormats";
- /** Initializes the flag showing if the formats module is present (required). */
- private static boolean available = checkAvailabilityFormats();
- /** Initializes the flag showing if the resources module is present (optional). */
- private static boolean resourcesExtensionAvailable = checkAvailabilityResources();
-
- /** The validations read. */
- private List<Validation> validations = new ArrayList<>();
-
- /** Initializes the flag showing if the formats module is present (required). */
- private static boolean checkAvailabilityFormats() {
- try {
- Class.forName(CONFIGURATION_FORMATS_CLASS);
- return true;
- } catch (Exception e) {
- return false;
- }
- }
-
- /** Initializes the flag showing if the resources module is present (optional). */
- private static boolean checkAvailabilityResources() {
- try {
- Class.forName(CONFIG_RESOURCE_CLASS);
- return true;
- } catch (Exception e) {
- return false;
- }
- }
-
- /**
- * Constructor, mostly called from {@link java.util.ServiceLoader}
- */
- public ConfiguredResourcesModelProviderSpi() {
- if (!available) {
- LOG.info("tamaya-format extension is required to read model configuration, No extended model support available.");
- } else {
- String resources = ConfigurationProvider.getConfiguration().get(MODEL_RESOURCE_PARAM);
- if(resources==null || resources.trim().isEmpty()){
- LOG.info("Mo model resources location configured in " + MODEL_RESOURCE_PARAM + ".");
- return;
- }
- Collection<URL> urls = new ArrayList<>();
- if(resourcesExtensionAvailable){
- LOG.info("Using tamaya-resources extension to read model configuration from " + resources);
- urls = ConfigResources.getResourceResolver().getResources(resources.split(","));
- }
- else{
- LOG.info("Using default classloader resource location to read model configuration from " + resources);
- urls = new ArrayList<>();
- for(String resource:resources.split(",")){
- if(!resource.trim().isEmpty()){
- Enumeration<URL> configs = null;
- try {
- configs = getClass().getClassLoader().getResources(resource);
- while (configs.hasMoreElements()) {
- urls.add(configs.nextElement());
- }
- } catch (IOException e) {
- Logger.getLogger(getClass().getName()).log(Level.SEVERE,
- "Error evaluating config model locations from "+resource, e);
- }
- }
- }
- }
- // Reading configs
- for(URL config:urls){
- try (InputStream is = config.openStream()) {
- ConfigurationData data = ConfigurationFormats.readConfigurationData(config);
- validations.addAll(ConfigValidationsReader.loadValidations(data.getCombinedProperties(), config.toString()));
- } catch (Exception e) {
- Logger.getLogger(getClass().getName()).log(Level.SEVERE,
- "Error loading config model data from " + config, e);
- }
- }
- }
- validations = Collections.unmodifiableList(validations);
- }
-
-
- @Override
- public Collection<Validation> getValidations() {
- return validations;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/spi/AbstractValidation.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/AbstractValidation.java b/sandbox/model/src/main/java/org/apache/tamaya/model/spi/AbstractValidation.java
deleted file mode 100644
index 4bc159a..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/AbstractValidation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.model.spi;
-
-import org.apache.tamaya.model.Validation;
-
-import java.util.Objects;
-
-/**
- * Default configuration Model for a configuration area.
- */
-public abstract class AbstractValidation implements Validation {
-
- private String name;
- private String description;
-
- protected AbstractValidation(String name, String description) {
- this.name = Objects.requireNonNull(name);
- this.description = description;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getDescription() {
- return description;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/spi/AreaValidation.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/AreaValidation.java b/sandbox/model/src/main/java/org/apache/tamaya/model/spi/AreaValidation.java
deleted file mode 100644
index 239178c..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/AreaValidation.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.model.spi;
-
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.model.ValidationResult;
-import org.apache.tamaya.model.Validation;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Default configuration Model for a configuration area.
- */
-public class AreaValidation extends ValidationGroup {
-
- private boolean required = false;
-
- public static Builder builder(String name){
- return new Builder(name);
- }
-
- public static Validation of(String name, boolean required){
- return new Builder(name).setRequired(required).build();
- }
-
- public static Validation of(String name, boolean required, Validation... validations){
- return new Builder(name).setRequired(required).addValidations(validations).build();
- }
-
- protected AreaValidation(Builder builder) {
- super(builder.name, builder.childValidations);
- this.required = builder.required;
- }
-
- @Override
- public String getType(){
- return "Area";
- }
-
- @Override
- public Collection<ValidationResult> validate(Configuration config) {
- Map<String,String> map = config.getProperties();
- String lookupKey = getName() + '.';
- boolean present = false;
- for(String key:map.keySet()){
- if(key.startsWith(lookupKey)){
- present = true;
- break;
- }
- }
- List<ValidationResult> result = new ArrayList<>(1);
- if(required && !present) {
- result.add(ValidationResult.ofMissing(this));
- }
- result.addAll(super.validate(config));
- return result;
- }
-
- @Override
- public String toString() {
- StringBuilder b = new StringBuilder();
- b.append(getType()).append(": " + getName());
- if(required) {
- b.append(", required: " + required);
- }
- for(Validation val:getValidations()){
- b.append(", ").append(val.toString());
- }
- return b.toString();
- }
-
-
- public static class Builder{
- private String name;
- private String description;
- private boolean required;
- private List<Validation> childValidations = new ArrayList<>();
-
- public Builder(String areaName){
- this.name = Objects.requireNonNull(areaName);
- }
-
- public Builder addValidations(Validation... validations){
- this.childValidations.addAll(Arrays.asList(validations));
- return this;
- }
-
- public Builder addValidations(Collection<Validation> validations){
- this.childValidations.addAll(validations);
- return this;
- }
-
- public Builder addParameter(ParameterValidation parameterConfig){
- this.childValidations.add(parameterConfig);
- return this;
- }
-
- public Builder setRequired(boolean required){
- this.required = required;
- return this;
- }
-
- public Builder setDescription(String description){
- this.description = description;
- return this;
- }
-
- public Builder setName(String name){
- this.name = Objects.requireNonNull(name);
- return this;
- }
-
- public Validation build(){
- return new AreaValidation(this);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ConfigValidationsReader.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ConfigValidationsReader.java b/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ConfigValidationsReader.java
deleted file mode 100644
index eaf9aec..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ConfigValidationsReader.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.model.spi;
-
-import org.apache.tamaya.model.Validation;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Utility class to read metamodel information from properties. Hereby these properties can be part of a
- * configuration (containing other entriees as well) or be dedicated model definition properties read
- * from any kind of source.
- */
-public final class ConfigValidationsReader {
-
- /** The logger used. */
- private static final Logger LOGGER = Logger.getLogger(ConfigValidationsReader.class.getName());
-
- /** The default model entries selector. */
- private static final String DEFAULT_META_INFO_SELECTOR = "{model}";
- /** parameter to change the selector to be used for filtering out the target values to be used. */
- private static final String META_INFO_SELECTOR_PARAM = "org.apache.tamaya.model.integrated.selector";
-
- /**
- * Loads validations as configured in the given properties.
- * @param props the properties to be read
- * @param defaultProviderName the default provider name used if no explicit provider name is configured.
- * @return a collection of config validations.
- */
- public static Collection<Validation> loadValidations(Properties props,
- String defaultProviderName) {
- Map<String,String> map = new HashMap<>();
- for(Map.Entry<Object,Object> en: props.entrySet()){
- map.put(en.getKey().toString(), props.getProperty(en.getKey().toString()));
- }
- return loadValidations(map, defaultProviderName);
- }
-
- /**
- * Loads validations as configured in the given properties.
- * @param props the properties to be read
- * @param defaultProviderName the default provider name used if no explicit provider name is configured.
- * @return a collection of config validations.
- */
- public static Collection<Validation> loadValidations(Map<String,String> props,
- String defaultProviderName) {
- String selector = props.get(META_INFO_SELECTOR_PARAM);
- if(selector==null){
- selector = DEFAULT_META_INFO_SELECTOR;
- }
- return loadValidations(props, selector, defaultProviderName);
- }
-
- /**
- * Loads validations as configured in the given properties.
- * @param props the properties to be read
- * @param selector the selector (default is {model}), that identifies the model entries.
- * @param defaultProviderName the default provider name used if no explicit provider name is configured.
- * @return a collection of config validations.
- */
- public static Collection<Validation> loadValidations(Map<String,String> props, String selector,
- String defaultProviderName) {
- List<Validation> result = new ArrayList<>();
- String provider = props.get(selector + ".__provider");
- if (provider == null) {
- provider = defaultProviderName;
- }
- Set<String> itemKeys = new HashSet<>();
- for (Object key : props.keySet()) {
- if (key.toString().endsWith(".class")) {
- itemKeys.add(key.toString().substring(0, key.toString().length() - ".class".length()));
- }
- }
- for (String baseKey : itemKeys) {
- String clazz = props.get(baseKey + ".class");
- String type = props.get(baseKey + ".type");
- if (type == null) {
- type = String.class.getName();
- }
- String description = props.get(baseKey + ".description");
- String regEx = props.get(baseKey + ".expression");
- String validations = props.get(baseKey + ".validations");
- String requiredVal = props.get(baseKey + ".required");
- if ("Parameter".equalsIgnoreCase(clazz)) {
- result.add(createParameterValidation(baseKey.substring(selector.length() + 1), description, type,
- requiredVal, regEx, validations));
- } else if ("Section".equalsIgnoreCase(clazz)) {
- result.add(createSectionValidation(baseKey.substring(selector.length() + 1), description, requiredVal,
- validations));
- }
- }
- return result;
- }
-
- /**
- * Creates a parameter validation.
- * @param paramName the param name, not null.
- * @param description the optional description
- * @param type the param type, default is String.
- * @param reqVal the required value, default is 'false'.
- * @param regEx an optional regular expression to be checked for this param
- * @param validations the optional custom validations to be performed.
- * @return the new validation for this parameter.
- */
- private static Validation createParameterValidation(String paramName, String description, String type, String reqVal,
- String regEx, String validations) {
- boolean required = "true".equalsIgnoreCase(reqVal);
- ParameterValidation.Builder builder = ParameterValidation.builder(paramName).setRequired(required)
- .setDescription(description).setExpression(regEx).setType(type);
- if (validations != null) {
- try {
- // TODO defined validator API
-// builder.addValidations(validations);
- } catch (Exception e) {
- LOGGER.log(Level.WARNING, "Failed to load validations for " + paramName, e);
- }
- }
- return builder.build();
- }
-
- /**
- * Creates a section validation.
- * @param sectionName the section's name, not null.
- * @param description the optional description
- * @param reqVal the required value, default is 'false'.
- * @param validations the optional custom validations to be performed.
- * @return the new validation for this section.
- */
- private static Validation createSectionValidation(String sectionName, String description, String reqVal,
- String validations) {
- boolean required = "true".equalsIgnoreCase(reqVal);
- AreaValidation.Builder builder = AreaValidation.builder(sectionName).setRequired(required)
- .setDescription(description);
- if (validations != null) {
- try {
- // TODO defined validator API
-// builder.addValidations(validations);
- } catch (Exception e) {
- LOGGER.log(Level.WARNING, "Failed to load validations for " + sectionName, e);
- }
- }
- return builder.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ParameterValidation.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ParameterValidation.java b/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ParameterValidation.java
deleted file mode 100644
index 72175b8..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ParameterValidation.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.model.spi;
-
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.model.Validation;
-import org.apache.tamaya.model.ValidationResult;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Objects;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Default configuration Model for a configuration parameter.
- */
-public class ParameterValidation extends AbstractValidation {
-
- private boolean required = false;
- private String regEx;
- private Class type;
-
-
- protected ParameterValidation(Builder builder) {
- super(builder.name, builder.description);
- this.required = builder.required;
- this.regEx = builder.regEx;
- this.type = builder.type;
- }
-
- @Override
- public String getType() {
- return "Parameter";
- }
-
- public Class getParameterType() {
- return type;
- }
-
- @Override
- public Collection<ValidationResult> validate(Configuration config) {
- List<ValidationResult> result = new ArrayList<>(1);
- String configValue = config.get(getName());
- if (configValue == null && required) {
- result.add(ValidationResult.ofMissing(this));
- }
- if (configValue != null && regEx != null) {
- if (!configValue.matches(regEx)) {
- result.add(ValidationResult.ofError(this, "Config value not matching expression: " + regEx + ", was " +
- configValue));
- }
- }
- return result;
- }
-
- @Override
- public String toString() {
- StringBuilder b = new StringBuilder();
- b.append(getType()).append(": ").append(getName());
- if (required) {
- b.append(", required: " + required);
- }
- if (regEx != null) {
- b.append(", expression: " + regEx);
- }
- return b.toString();
- }
-
- public static Builder builder(String name) {
- return new Builder(name);
- }
-
- public static Validation of(String name, boolean required, String expression) {
- return new Builder(name).setRequired(required).setExpression(expression).build();
- }
-
-
- public static Validation of(String name, boolean required) {
- return new Builder(name).setRequired(required).build();
- }
-
- public static Validation of(String name) {
- return new Builder(name).setRequired(false).build();
- }
-
-
- public static class Builder {
- private Class type;
- private String name;
- private String regEx;
- private String description;
- private boolean required;
-
- public Builder(String name) {
- this.name = Objects.requireNonNull(name);
- }
-
- public Builder setType(String type) {
- try {
- this.type = Class.forName(type);
- } catch (ClassNotFoundException e) {
- try {
- this.type = Class.forName("java.lang."+type);
- } catch (ClassNotFoundException e2) {
- Logger.getLogger(getClass().getName()).log(Level.WARNING, "Failed to load parameter type: " + type, e2);
- }
- }
- return this;
- }
-
- public Builder setRequired(boolean required) {
- this.required = required;
- return this;
- }
-
- public Builder setDescription(String description) {
- this.description = description;
- return this;
- }
-
- public Builder setExpression(String regEx) {
- this.regEx = regEx;
- return this;
- }
-
- public Builder setName(String name) {
- this.name = Objects.requireNonNull(name);
- return this;
- }
-
- public Validation build() {
- return new ParameterValidation(this);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ValidationGroup.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ValidationGroup.java b/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ValidationGroup.java
deleted file mode 100644
index 5c6ddca..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ValidationGroup.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.model.spi;
-
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.model.Validation;
-import org.apache.tamaya.model.ValidationResult;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * Default configuration Model for a configuration area.
- */
-public class ValidationGroup implements Validation {
-
- private String name;
- private List<Validation> childValidations = new ArrayList<>();
-
- public ValidationGroup(String name, Validation... validations){
- this(name, Arrays.asList(validations));
- }
-
- public ValidationGroup(Collection<Validation> validations){
- this("", validations);
- }
-
- public ValidationGroup(Validation... validations){
- this("", Arrays.asList(validations));
- }
-
- protected ValidationGroup(String name, Collection<Validation> validations) {
- this.name = Objects.requireNonNull(name);
- this.childValidations.addAll(validations);
- this.childValidations = Collections.unmodifiableList(childValidations);
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getType() {
- return "Group";
- }
-
- @Override
- public String getDescription() {
- StringBuilder b = new StringBuilder();
- for(Validation val:childValidations){
- b.append(" >> " + val);
- }
- return b.toString();
- }
-
- public Collection<Validation> getValidations(){
- return childValidations;
- }
-
- @Override
- public Collection<ValidationResult> validate(Configuration config) {
- List<ValidationResult> result = new ArrayList<>(1);
- for(Validation child: childValidations){
- result.addAll(child.validate(config));
- }
- return result;
- }
-
- @Override
- public String toString(){
- StringBuilder b = new StringBuilder();
- b.append(getType()).append(", size: ").append(childValidations.size()).append(": ").append(getDescription());
- return b.toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ValidationProviderSpi.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ValidationProviderSpi.java b/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ValidationProviderSpi.java
deleted file mode 100644
index edb795c..0000000
--- a/sandbox/model/src/main/java/org/apache/tamaya/model/spi/ValidationProviderSpi.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.model.spi;
-
-import org.apache.tamaya.model.Validation;
-
-import java.util.Collection;
-
-/**
- * Model of a configuration state. A model can be a full model, or a partial model, validating only
- * a configuration subset. This allows better user feedback because big configurations can be grouped
- * and validated by multiple (partial) models.
- */
-public interface ValidationProviderSpi {
-
- /**
- * Get the validation defined.
- *
- * @return the sections defined, never null.
- */
- Collection<Validation> getValidations();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/main/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi
----------------------------------------------------------------------
diff --git a/sandbox/model/src/main/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi b/sandbox/model/src/main/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi
deleted file mode 100644
index 47c18de..0000000
--- a/sandbox/model/src/main/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy current the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-org.apache.tamaya.model.internal.ConfiguredPropertiesValidationProviderSpi
-org.apache.tamaya.model.internal.ConfiguredInlineModelProviderSpi
-org.apache.tamaya.model.internal.ConfiguredResourcesModelProviderSpi
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/test/java/org/apache/tamaya/model/TestConfigValidationProvider.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/java/org/apache/tamaya/model/TestConfigValidationProvider.java b/sandbox/model/src/test/java/org/apache/tamaya/model/TestConfigValidationProvider.java
deleted file mode 100644
index f0d24f6..0000000
--- a/sandbox/model/src/test/java/org/apache/tamaya/model/TestConfigValidationProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.apache.tamaya.model;
-
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.model.spi.AreaValidation;
-import org.apache.tamaya.model.spi.ParameterValidation;
-import org.apache.tamaya.model.spi.ValidationGroup;
-import org.apache.tamaya.model.spi.ValidationProviderSpi;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Created by Anatole on 09.08.2015.
- */
-public class TestConfigValidationProvider implements ValidationProviderSpi{
-
- private List<Validation> validations = new ArrayList<>(1);
-
- public TestConfigValidationProvider(){
- validations.add(new TestConfigValidation());
- validations = Collections.unmodifiableList(validations);
- }
-
- @Override
- public Collection<Validation> getValidations() {
- return validations;
- }
-
- private static final class TestConfigValidation extends ValidationGroup{
-
- public TestConfigValidation(){
- super("TestConfig", new AreaValidation.Builder("a.test.existing").setRequired(true).build(),
- ParameterValidation.of("a.test.existing.aParam", true),
- ParameterValidation.of("a.test.existing.optionalParam"),
- ParameterValidation.of("a.test.existing.aABCParam", false, "[ABC].*"),
- new AreaValidation.Builder("a.test.notexisting").setRequired(true).build(),
- ParameterValidation.of("a.test.notexisting.aParam", true),
- ParameterValidation.of("a.test.notexisting.optionalParam"),
- ParameterValidation.of("a.test.existing.aABCParam2", false, "[ABC].*"));
- }
- @Override
- public String getName() {
- return "TestConfigValidation";
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/test/java/org/apache/tamaya/model/ValidationTests.java
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/java/org/apache/tamaya/model/ValidationTests.java b/sandbox/model/src/test/java/org/apache/tamaya/model/ValidationTests.java
deleted file mode 100644
index dd8a829..0000000
--- a/sandbox/model/src/test/java/org/apache/tamaya/model/ValidationTests.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.apache.tamaya.model;
-
-import org.junit.Test;
-
-/**
- * Created by Anatole on 10.08.2015.
- */
-public class ValidationTests {
-
- @Test
- public void testDefaults(){
- System.err.println(ConfigValidator.validate());
- }
-
- @Test
- public void testAllValidations(){
- System.err.println(ConfigValidator.getValidations());
- }
-
- @Test
- public void testAllValidationsInclUndefined(){
- System.err.println("Including UNDEFINED: \n" + ConfigValidator.validate(true));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/test/resources/META-INF/configmodel.properties
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/resources/META-INF/configmodel.properties b/sandbox/model/src/test/resources/META-INF/configmodel.properties
deleted file mode 100644
index af37705..0000000
--- a/sandbox/model/src/test/resources/META-INF/configmodel.properties
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy current the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-###################################################################################
-# Example of a configuration metamodel expressed via properties.
-####################################################################################
-
-# Metamodel information
-{model}.provider=ConfigModel Extension
-
-# reusable parameter definition, referenceable as MyNumber
-{model}.MyNumber.class=Parameter
-{model}.MyNumber.type=Integer
-{model}.MyNumber.description=a (reusable) number type parameter (optional)
-
-####################################################################################
-# Description of Configuration Sections (minimal, can be extended by other modules).
-# By default its interpreted as a section !
-####################################################################################
-
-# a (section)
-{model}.a.class=Section
-{model}.a.params2.class=Parameter
-{model}.a.params2.type=String
-{model}.a.params2.required=true
-{model}.a.params2.description=a required parameter
-
-{model}.a.paramInt.class=Parameter
-{model}.a.paramInt.type=ref:MyNumber
-{model}.a.paramInt.description=an optional parameter (default)
-
-{model}.a._number.class=Parameter
-{model}.a._number.type=Integer
-{model}.a._number.deprecated=true
-{model}.a._number.mappedTo=a.paramInt
-
-# a.b.c (section)
-{model}.a.b.c.class=Section
-{model}.a.b.c.description=Just a test section
-
-# a.b.c.aRequiredSection (section)
-{model}.a.b.c.aRequiredSection.class=Section
-{model}.a.b.c.aRequiredSection.required=true
-{model}.a.b.c.aRequiredSection.description=A section containing required parameters is called a required section.\
- Sections can also explicitly be defined to be required, but without\
- specifying the paramteres to be contained.,
-
-# a.b.c.aRequiredSection.subsection (section)
-{model}.a.b.c.aRequiredSection.subsection.class=Section
-
-{model}.a.b.c.aRequiredSection.subsection.param0.class=Parameter
-{model}.a.b.c.aRequiredSection.subsection.param0.type=String
-{model}.a.b.c.aRequiredSection.subsection.param0.description=a minmally documented String parameter
-# A minmal String parameter
-{model}.a.b.c.aRequiredSection.subsection.param00.class=Parameter
-{model}.a.b.c.aRequiredSection.subsection.param00.type=String
-
-# a.b.c.aRequiredSection.subsection (section)
-{model}.a.b.c.aRequiredSection.subsection.param1.class=Parameter
-{model}.a.b.c.aRequiredSection.subsection.param1.type = String
-{model}.a.b.c.aRequiredSection.subsection.param1.required = true
-{model}.a.b.c.aRequiredSection.subsection.intParam.class=Parameter
-{model}.a.b.c.aRequiredSection.subsection.intParam.type = Integer
-{model}.a.b.c.aRequiredSection.subsection.intParam.description=an optional parameter (default)
-
-# a.b.c.aRequiredSection.nonempty-subsection (section)
-{model}.a.b.c.aRequiredSection.nonempty-subsection.class=Section
-{model}.a.b.c.aRequiredSection.nonempty-subsection.required=true
-
-# a.b.c.aRequiredSection.optional-subsection (section)
-{model}.a.b.c.aRequiredSection.optional-subsection.class=Section
-
-# a.b.c.aValidatedSection (section)
-{model}.a.b.c.aValidatedSection.class=Section
-{model}.a.b.c.aValidatedSection.description=A validated section.
-{model}.a.b.c.aValidatedSection.validations=org.apache.tamaya.model.TestValidator
-
-
-
-
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/test/resources/META-INF/javaconfiguration.properties
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/resources/META-INF/javaconfiguration.properties b/sandbox/model/src/test/resources/META-INF/javaconfiguration.properties
deleted file mode 100644
index b0b8c22..0000000
--- a/sandbox/model/src/test/resources/META-INF/javaconfiguration.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy current the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-a.test.existing.aParam=existingValue
-a.test.existing.optionalParam=optionalValue
-a.test.existing.aABCParam=ABCparam
-a.test.existing.aABCParam2=MMM
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c5343410/sandbox/model/src/test/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi
----------------------------------------------------------------------
diff --git a/sandbox/model/src/test/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi b/sandbox/model/src/test/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi
deleted file mode 100644
index 45c1b86..0000000
--- a/sandbox/model/src/test/resources/META-INF/services/org.apache.tamaya.model.spi.ValidationProviderSpi
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy current the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-org.apache.tamaya.model.TestConfigValidationProvider
\ No newline at end of file