You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by pl...@apache.org on 2016/09/15 17:26:20 UTC
[03/24] incubator-tamaya git commit: Removed all modules from the
main repository. They will be reborn in separate ASF repository.
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/resources/src/test/resources/resources_testroot/aa_a/a2.file
----------------------------------------------------------------------
diff --git a/modules/resources/src/test/resources/resources_testroot/aa_a/a2.file b/modules/resources/src/test/resources/resources_testroot/aa_a/a2.file
deleted file mode 100644
index 7220975..0000000
--- a/modules/resources/src/test/resources/resources_testroot/aa_a/a2.file
+++ /dev/null
@@ -1,18 +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.
- */
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/resources/src/test/resources/resources_testroot/aa_a/a3.file
----------------------------------------------------------------------
diff --git a/modules/resources/src/test/resources/resources_testroot/aa_a/a3.file b/modules/resources/src/test/resources/resources_testroot/aa_a/a3.file
deleted file mode 100644
index 7220975..0000000
--- a/modules/resources/src/test/resources/resources_testroot/aa_a/a3.file
+++ /dev/null
@@ -1,18 +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.
- */
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/resources/src/test/resources/resources_testroot/aa_a/z3.file
----------------------------------------------------------------------
diff --git a/modules/resources/src/test/resources/resources_testroot/aa_a/z3.file b/modules/resources/src/test/resources/resources_testroot/aa_a/z3.file
deleted file mode 100644
index 7220975..0000000
--- a/modules/resources/src/test/resources/resources_testroot/aa_a/z3.file
+++ /dev/null
@@ -1,18 +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.
- */
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/resources/src/test/resources/resources_testroot/bb/b1/b2/b12.file
----------------------------------------------------------------------
diff --git a/modules/resources/src/test/resources/resources_testroot/bb/b1/b2/b12.file b/modules/resources/src/test/resources/resources_testroot/bb/b1/b2/b12.file
deleted file mode 100644
index 7220975..0000000
--- a/modules/resources/src/test/resources/resources_testroot/bb/b1/b2/b12.file
+++ /dev/null
@@ -1,18 +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.
- */
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/resources/src/test/resources/resources_testroot/bb/b2/b2_1.file
----------------------------------------------------------------------
diff --git a/modules/resources/src/test/resources/resources_testroot/bb/b2/b2_1.file b/modules/resources/src/test/resources/resources_testroot/bb/b2/b2_1.file
deleted file mode 100644
index 7220975..0000000
--- a/modules/resources/src/test/resources/resources_testroot/bb/b2/b2_1.file
+++ /dev/null
@@ -1,18 +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.
- */
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/resources/src/test/resources/resources_testroot/bb/b2/b2_2.datei
----------------------------------------------------------------------
diff --git a/modules/resources/src/test/resources/resources_testroot/bb/b2/b2_2.datei b/modules/resources/src/test/resources/resources_testroot/bb/b2/b2_2.datei
deleted file mode 100644
index 7220975..0000000
--- a/modules/resources/src/test/resources/resources_testroot/bb/b2/b2_2.datei
+++ /dev/null
@@ -1,18 +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.
- */
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/resources/src/test/resources/resources_testroot/bb/b2/b3.foo
----------------------------------------------------------------------
diff --git a/modules/resources/src/test/resources/resources_testroot/bb/b2/b3.foo b/modules/resources/src/test/resources/resources_testroot/bb/b2/b3.foo
deleted file mode 100644
index 7220975..0000000
--- a/modules/resources/src/test/resources/resources_testroot/bb/b2/b3.foo
+++ /dev/null
@@ -1,18 +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.
- */
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/resources/src/test/resources/test.properties
----------------------------------------------------------------------
diff --git a/modules/resources/src/test/resources/test.properties b/modules/resources/src/test/resources/test.properties
deleted file mode 100644
index f3199f2..0000000
--- a/modules/resources/src/test/resources/test.properties
+++ /dev/null
@@ -1,18 +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.
-#
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/server/pom.xml
----------------------------------------------------------------------
diff --git a/modules/server/pom.xml b/modules/server/pom.xml
deleted file mode 100644
index 9b302d8..0000000
--- a/modules/server/pom.xml
+++ /dev/null
@@ -1,203 +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-extensions</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
-
- <artifactId>tamaya-server</artifactId>
- <name>Apache Tamaya Modules - Server Extension</name>
- <packaging>bundle</packaging>
-
- <properties>
- <jdkVersion>1.7</jdkVersion>
- <tomcat.version>7.0.57</tomcat.version>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tamaya</groupId>
- <artifactId>tamaya-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tomcat.embed</groupId>
- <artifactId>tomcat-embed-core</artifactId>
- <version>${tomcat.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tomcat.embed</groupId>
- <artifactId>tomcat-embed-jasper</artifactId>
- <version>${tomcat.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tomcat.embed</groupId>
- <artifactId>tomcat-embed-logging-juli</artifactId>
- <version>${tomcat.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jaxrs_2.0_spec</artifactId>
- <version>1.0-alpha-1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-frontend-jaxrs</artifactId>
- <version>3.1.6</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tamaya</groupId>
- <artifactId>tamaya-core</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>tamaya-json</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>tamaya-functions</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>java-hamcrest</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>${project.basedir}/src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>META-INF/server-version.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>${project.basedir}/src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>META-INF/server-version.properties</exclude>
- </excludes>
- </resource>
-
- </resources>
- <plugins>
- <plugin>
- <groupId>com.spotify</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <version>0.3.258</version>
- <configuration>
- <imageName>apache/tamaya/config-server</imageName>
- <imageTags>
- <imageTag>${project.version}</imageTag>
- </imageTags>
- <baseImage>java:8-jre</baseImage>
- <entryPoint>["java", "-jar", "/${project.build.finalName}.jar", "server", "/config-server.yml"]</entryPoint>
- <exposes>
- <expose>8080</expose>
- </exposes>
- <resources>
- <resource>
- <targetPath>/</targetPath>
- <directory>${project.build.directory}</directory>
- <include>${project.build.finalName}.jar</include>
- </resource>
- <resource>
- <targetPath>/</targetPath>
- <directory>${project.build.directory}/classes</directory>
- <include>config-server.yml</include>
- </resource>
- </resources>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- <filters>
- <filter>
- <artifact>*:*</artifact>
- <excludes>
- <exclude>META-INF/*.SF</exclude>
- <exclude>META-INF/*.DSA</exclude>
- <exclude>META-INF/*.RSA</exclude>
- </excludes>
- </filter>
- </filters>
- </configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
- <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
- <mainClass>org.apache.tamaya.server.ConfigServiceApp</mainClass>
- </transformer>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Export-Package>
- org.apache.tamaya.server,
- org.apache.tamaya.server.spi
- </Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/server/src/main/java/org/apache/tamaya/server/ConfigServiceApp.java
----------------------------------------------------------------------
diff --git a/modules/server/src/main/java/org/apache/tamaya/server/ConfigServiceApp.java b/modules/server/src/main/java/org/apache/tamaya/server/ConfigServiceApp.java
deleted file mode 100644
index 1db06f3..0000000
--- a/modules/server/src/main/java/org/apache/tamaya/server/ConfigServiceApp.java
+++ /dev/null
@@ -1,77 +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.server;
-
-import org.apache.catalina.Context;
-import org.apache.catalina.Wrapper;
-import org.apache.catalina.startup.Tomcat;
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.ConfigurationProvider;
-
-import javax.ws.rs.core.Application;
-import java.io.File;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Main Application for the Tamaya Configuration Server.
- */
-public class ConfigServiceApp {
-
- /**
- * Utility class.
- */
- private ConfigServiceApp(){}
-
- /**
- * JAX RS Application.
- */
- public static class ResourceLoader extends Application{
-
- @Override
- public Set<Class<?>> getClasses() {
- final Set<Class<?>> classes = new HashSet<>();
- // register root resource
- classes.add(ConfigurationResource.class);
- return classes;
- }
- }
-
- public static void main(String... args) throws Exception {
- Configuration config = ConfigurationProvider.getConfiguration();
- String contextPath = config.getOrDefault("tamaya.server.contextPath", "/");
- String appBase = ".";
- Tomcat tomcat = new Tomcat();
- tomcat.setPort(config.getOrDefault("tamaya.server.port", Integer.class, 8085));
-
- // Define a web application context.
- Context context = tomcat.addWebapp(contextPath, new File(
- appBase).getAbsolutePath());
- // Add servlet that will register Jersey REST resources
- String servletName = "cxf-servlet";
- Wrapper wrapper = tomcat.addServlet(context, servletName,
- org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet.class.getName());
- wrapper.addInitParameter("javax.ws.rs.Application", ResourceLoader.class.getName());
- context.addServletMapping("/*", servletName);
- tomcat.start();
- tomcat.getServer().await();
- }
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/server/src/main/java/org/apache/tamaya/server/ConfigurationResource.java
----------------------------------------------------------------------
diff --git a/modules/server/src/main/java/org/apache/tamaya/server/ConfigurationResource.java b/modules/server/src/main/java/org/apache/tamaya/server/ConfigurationResource.java
deleted file mode 100644
index f13446a..0000000
--- a/modules/server/src/main/java/org/apache/tamaya/server/ConfigurationResource.java
+++ /dev/null
@@ -1,310 +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.server;
-
-import java.io.StringWriter;
-import java.util.Map;
-import java.util.Objects;
-import java.util.concurrent.atomic.AtomicLong;
-
-import javax.json.Json;
-import javax.json.JsonArray;
-import javax.json.JsonArrayBuilder;
-import javax.json.JsonObject;
-import javax.json.JsonObjectBuilder;
-import javax.json.JsonWriter;
-import javax.json.stream.JsonGenerator;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.GET;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.ConfigurationProvider;
-import org.apache.tamaya.functions.ConfigurationFunctions;
-
-/**
- * Configuration resource with an etcd compatible REST API
- * (excluding the blocking API calls).
- */
-@Path("/")
-@Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN})
-public class ConfigurationResource {
- private final AtomicLong readCounter = new AtomicLong();
- private final AtomicLong writeCounter = new AtomicLong();
- private final AtomicLong deleteCounter = new AtomicLong();
-
-
- @GET
- @Path("/version")
- @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN})
- public String version() {
- String product = VersionProperties.getProduct().replace("\"", "\\\"");
- String version = VersionProperties.getVersion().replace("\"", "\\\"");
-
- return String.format("{ \"version\" : \"%s: %s\" }", product, version);
- }
-
- @GET
- @Path("/v2/keys")
- public String readEtcdConfig(@QueryParam("recursive") Boolean recursive) {
- return readConfig(recursive);
- }
-
- /**
- * This models a etcd2 compliant access point for getting a property value.
- *
- * @param recursive NOT YET IMPLEMENTED!
- * @return all configuration property values.
- */
- @GET
- @Path("/keys")
- public String readConfig(@QueryParam("recursive") Boolean recursive) {
- readCounter.incrementAndGet();
- final Configuration config = ConfigurationProvider.getConfiguration();
- final Map<String, String> children = config.getProperties();
- final JsonArrayBuilder ab = Json.createArrayBuilder();
- for (final Map.Entry<String, String> en : children.entrySet()) {
- final Node node = new Node(config, en.getKey(), "node");
- ab.add(node.createJsonObject());
- }
- final Node node = new Node(config, null, "node", ab.build());
- final JsonObjectBuilder root = Json.createObjectBuilder().add("action", "get")
- .add("node", node.createJsonObject());
- final StringWriter writer = new StringWriter();
- final JsonWriter jwriter = Json.createWriter(writer);
- jwriter.writeObject(root.build());
- return writer.toString();
- }
-
- /**
- * This models a etcd2 compliant access point for getting a property value.
- *
- * @param key name of the key to show
- * @param recursive NOT YET IMPLEMENTED!
- * @return specific configuration key derived from the given key name.
- */
- @GET
- @Path("/v2/keys/{key}")
- public String readEtcdConfig(@PathParam("key") String key, @QueryParam("recursive") Boolean recursive) {
- return readConfig(key, recursive);
- }
-
- /**
- * This models a etcd2 compliant access point for getting a property value.
- *
- * @param key name of the key to show
- * @param recursive NOT YET IMPLEMENTED!
- * @return configuration value of the given key.
- */
- @GET
- @Path("/keys/{key}")
- public String readConfig(@PathParam("key") String key, @QueryParam("recursive") Boolean recursive) {
- readCounter.incrementAndGet();
- final Configuration config = ConfigurationProvider.getConfiguration();
- if (key != null) {
- if (key.startsWith("/")) {
- key = key.substring(1);
- }
- if (config.get(key) != null && !recursive) {
- final Node node = new Node(config, key, "node");
- final JsonObjectBuilder root = Json.createObjectBuilder().add("action", "get")
- .add("node", node.createJsonObject());
- final StringWriter writer = new StringWriter();
- final JsonGenerator gen = Json.createGenerator(writer);
- gen.write(root.build());
- return writer.toString();
- }
- }
- Map<String, String> children = null;
- if (key == null) {
- children = config.getProperties();
- } else {
- children = config.with(ConfigurationFunctions.section(key)).getProperties();
- }
- final JsonArrayBuilder ab = Json.createArrayBuilder();
- for (final Map.Entry<String, String> en : children.entrySet()) {
- final Node node = new Node(config, en.getKey(), "node");
- ab.add(node.createJsonObject());
- }
- final Node node = new Node(config, key, "node", ab.build());
- final JsonObjectBuilder root = Json.createObjectBuilder().add("action", "get")
- .add("node", node.createJsonObject());
- final StringWriter writer = new StringWriter();
- final JsonWriter jwriter = Json.createWriter(writer);
- jwriter.writeObject(root.build());
- return writer.toString();
- }
-
- @PUT
- @Path("/v2/keys/{key}")
- public String writeEtcdConfig(@PathParam("key") String key, @javax.ws.rs.FormParam("value") String value,
- @FormParam("ttl") Integer ttl) {
- return writeConfig(key, value, ttl);
- }
-
- /**
- * This models a etcd2 compliant access point for setting a property value:
- * <pre>
- * {
- * "action": "set",
- * "node": {
- * "createdIndex": 3,
- * "key": "/message",
- * "modifiedIndex": 3,
- * "value": "Hello etcd"
- * },
- * "prevNode": {
- * "createdIndex": 2,
- * "key": "/message",
- * "value": "Hello world",
- * "modifiedIndex": 2
- * }
- * }
- * </pre>
- *
- * @param key name of the key to show
- * @param value configuration value for the given key
- * @param ttl time to live
- * @return written configuration value.
- */
- @PUT
- @Path("/keys/{key}")
- public String writeConfig(@PathParam("key") String key, @javax.ws.rs.FormParam("value") String value,
- @FormParam("ttl") Integer ttl) {
- writeCounter.incrementAndGet();
- final Configuration config = ConfigurationProvider.getConfiguration();
- if (key.startsWith("/")) {
- key = key.substring(1);
- }
- final Node prevNode = new Node(config, key, "prevNode");
- // TODO implement write! value and ttl as input
- final Node node = new Node(config, key, "node");
- final JsonObjectBuilder root = Json.createObjectBuilder().add("action", "set")
- .add("node", node.createJsonObject())
- .add("prevNode", prevNode.createJsonObject());
- final StringWriter writer = new StringWriter();
- final JsonWriter jwriter = Json.createWriter(writer);
- jwriter.writeObject(root.build());
- return writer.toString();
- }
-
- @DELETE
- @Path("/v2/keys/{key}")
- public String deleteEtcdConfig(@PathParam("key") String key) {
- return deleteConfig(key);
- }
-
- @DELETE
- @Path("/keys/{key}")
- public String deleteConfig(@PathParam("key") String key) {
- deleteCounter.incrementAndGet();
- final Configuration config = ConfigurationProvider.getConfiguration();
- if (key.startsWith("/")) {
- key = key.substring(1);
- }
- final Node prevNode = new Node(config, key, "prevNode");
- // TODO implement write! value and ttl as input
- final Node node = new Node(config, key, "node");
- final JsonObjectBuilder root = Json.createObjectBuilder().add("action", "delete")
- .add("node", node.createJsonObject())
- .add("prevNode", prevNode.createJsonObject());
- final StringWriter writer = new StringWriter();
- final JsonWriter jwriter = Json.createWriter(writer);
- jwriter.writeObject(root.build());
- return writer.toString();
- }
-
- public long getDeleteCounter() {
- return deleteCounter.get();
- }
-
- public long getReadCounter() {
- return readCounter.get();
- }
-
- public long getWriteCounter() {
- return writeCounter.get();
- }
-
- /**
- * Internal representation of a configuration node as modeled by etc.
- */
- private static final class Node {
- private Integer createdIndex;
- private Integer modifiedIndex;
- private final String key;
- private String value;
- private final String nodeId;
- private Integer ttl;
- private String expiration;
- private final JsonArray nodes;
-
- Node(Configuration config, String key, String nodeId) {
- this(config, key, nodeId, null);
- }
-
- Node(Configuration config, String key, String nodeId, JsonArray nodes) {
- this.key = key;
- this.nodeId = Objects.requireNonNull(nodeId);
- if (key != null) {
- value = config.get(key);
- createdIndex = config.getOrDefault("_" + key + ".createdIndex", Integer.class, null);
- modifiedIndex = config.getOrDefault("_" + key + ".modifiedIndex", Integer.class, null);
- ttl = config.getOrDefault("_" + key + ".ttl", Integer.class, null);
- expiration = config.getOrDefault("_" + key + ".expiration", null);
- }
- this.nodes = nodes;
- }
-
- JsonObject createJsonObject() {
- final JsonObjectBuilder nodeBuilder = Json.createObjectBuilder();
- if (key != null) {
- nodeBuilder.add("key", '/' + key);
- } else {
- nodeBuilder.add("dir", true);
- }
- if (value != null) {
- nodeBuilder.add("value", value);
- }
- if (createdIndex != null) {
- nodeBuilder.add("createdIndex", createdIndex.intValue());
- }
- if (modifiedIndex != null) {
- nodeBuilder.add("modifiedIndex", modifiedIndex.intValue());
- }
- if (ttl != null) {
- nodeBuilder.add("ttl", ttl.intValue());
- }
- if (expiration != null) {
- nodeBuilder.add("expiration", value);
- }
- if (nodes != null) {
- nodeBuilder.add("nodes", nodes);
- }
- return nodeBuilder.build();
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/server/src/main/java/org/apache/tamaya/server/VersionProperties.java
----------------------------------------------------------------------
diff --git a/modules/server/src/main/java/org/apache/tamaya/server/VersionProperties.java b/modules/server/src/main/java/org/apache/tamaya/server/VersionProperties.java
deleted file mode 100644
index e271694..0000000
--- a/modules/server/src/main/java/org/apache/tamaya/server/VersionProperties.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.server;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-/**
- * <p>This class gives access to the current name and the current version information
- * at runtime.</p>
- *
- * <p>All information offered by this is loaded from a properties file at
- * {@link VersionProperties#VERSION_PROPERTY_FILE}.</p>
- */
-public class VersionProperties {
- private static final String VERSION_PROPERTY_FILE = "/META-INF/tamaya-server-version.properties";
-
- static {
- try (InputStream resource = VersionProperties.class.getResourceAsStream(VERSION_PROPERTY_FILE)) {
- if (null == resource) {
- throw new ExceptionInInitializerError("Failed to version information resource. " +
- VERSION_PROPERTY_FILE + " not found.");
- }
-
- Properties properties = new Properties();
- properties.load(resource);
-
- product = properties.getProperty("server.product", "n/a");
- version = properties.getProperty("server.version", "n/a");
-
- } catch (IOException e) {
- throw new ExceptionInInitializerError(e);
- }
- }
-
- private static String product;
- private static String version;
-
- private VersionProperties() {
- }
-
- public static String getProduct() {
- return product;
- }
-
- public static String getVersion() {
- return version;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java
----------------------------------------------------------------------
diff --git a/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java b/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java
deleted file mode 100644
index 3d2757a..0000000
--- a/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java
+++ /dev/null
@@ -1,84 +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.server.spi;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.ConfigOperator;
-import org.apache.tamaya.spi.ServiceContextManager;
-
-/**
- * Singleton manager for scopes, used by the server component to filtering returned configurations.
- */
-public final class ScopeManager {
- /** The logger used. */
- private static final Logger LOG = Logger.getLogger(ScopeManager.class.getName());
-
- private static Map<String, ScopeProvider> scopeProviders = initProviders();
-
- /**
- * Singleton constructor.
- */
- private static Map<String, ScopeProvider> initProviders(){
- final Map<String, ScopeProvider> result = new ConcurrentHashMap<>();
- for(final ScopeProvider prov: ServiceContextManager.getServiceContext().getServices(ScopeProvider.class)){
- try{
- result.put(prov.getScopeType(), prov);
- } catch(final Exception e){
- LOG.log(Level.WARNING, "Error loading scopes from " + prov, e);
- }
- }
- return result;
- }
-
- /**
- * Singleton constructor.
- */
- private ScopeManager(){}
-
- /**
- * Get the scope given its id and provider.
- *
- * @param scopeId the scope name
- * @param targetScope name of the targetScope
- * @return the scope matching
- * @throws ConfigException if no such scope is defined
- */
- public static ConfigOperator getScope(String scopeId, String targetScope)
- throws ConfigException {
- final ScopeProvider prov = scopeProviders.get(scopeId);
- if(prov==null){
- throw new ConfigException("No such scope: " + scopeId);
- }
- return prov.getScope(targetScope);
- }
-
- /**
- * Get the defined scope names.
- * @return the defined scope names, never null.
- */
- public static Set<String> getScopes(){
- return scopeProviders.keySet();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeProvider.java
----------------------------------------------------------------------
diff --git a/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeProvider.java b/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeProvider.java
deleted file mode 100644
index 5c247d8..0000000
--- a/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeProvider.java
+++ /dev/null
@@ -1,40 +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.server.spi;
-
-import org.apache.tamaya.ConfigOperator;
-
-/**
- * Simple registrable provider class to register scopes for the server extension.
- */
-public interface ScopeProvider {
-
- /**
- * Access the unique scope name.
- * @return the unique scope name.
- */
- String getScopeType();
-
- /**
- * Return the scope operator that implements the scope for the given scope id.
- * @param scopeId target scope id.
- * @return the scope operator, never null.
- */
- ConfigOperator getScope(String scopeId);
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/server/src/main/resources/META-INF/tamaya-server-version.properties
----------------------------------------------------------------------
diff --git a/modules/server/src/main/resources/META-INF/tamaya-server-version.properties b/modules/server/src/main/resources/META-INF/tamaya-server-version.properties
deleted file mode 100644
index ef0ca70..0000000
--- a/modules/server/src/main/resources/META-INF/tamaya-server-version.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.
-#
-
-server.product=Apache Tamaya
-server.version=${project.version}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/server/src/main/resources/banner.txt
----------------------------------------------------------------------
diff --git a/modules/server/src/main/resources/banner.txt b/modules/server/src/main/resources/banner.txt
deleted file mode 100644
index 4e2714b..0000000
--- a/modules/server/src/main/resources/banner.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-
- \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557
-\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255d\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255d \u255a\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255d\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u255a\u2588\u2588\u2557 \u2588\u2588\u2554\u255d\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
-\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255d\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u255a\u2588\u2588\u2588\u2588\u2554\u255d \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551
-\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255d \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255d \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551\u255a\u2588\u2588\u2554\u255d\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551 \u255a\u2588\u2588\u2554\u255d \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551
-\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u255a\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u255a\u2550\u255d \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551
-\u255a\u2550\u255d \u255a\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d \u255a\u2550\u255d \u255a\u2550\u2550\u2550\u2550\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d\u255a\u2550\u2550\u2550\u2550\u2550\u2550\u255d \u255a\u2550\u255d \u255a\u2550\u255d \u255a\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d \u255a\u2550\u255d \u255a\u2550\u255d \u255a\u2550\u255d
- \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557
- \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255d\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255d\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255d\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
- \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255d\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255d
- \u255a\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255d \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u255a\u2588\u2588\u2557 \u2588\u2588\u2554\u255d\u2588\u2588\u2554\u2550\u2550\u255d \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
- \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u255a\u2588\u2588\u2588\u2588\u2554\u255d \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551
- \u255a\u2550\u2550\u2550\u2550\u2550\u2550\u255d\u255a\u2550\u2550\u2550\u2550\u2550\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d \u255a\u2550\u2550\u2550\u255d \u255a\u2550\u2550\u2550\u2550\u2550\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d
-
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/server/src/main/resources/config-server.yml
----------------------------------------------------------------------
diff --git a/modules/server/src/main/resources/config-server.yml b/modules/server/src/main/resources/config-server.yml
deleted file mode 100644
index 2e210a6..0000000
--- a/modules/server/src/main/resources/config-server.yml
+++ /dev/null
@@ -1,31 +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.
-#
-
-scope: java
-
-server:
- applicationConnectors:
- - type: http
- port: 4001
- adminConnectors:
- - type: http
- port: 4099
-
- # ${project.version}
-
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/server/src/test/java/org/apache/tamaya/server/ConfigServiceAppTest.java
----------------------------------------------------------------------
diff --git a/modules/server/src/test/java/org/apache/tamaya/server/ConfigServiceAppTest.java b/modules/server/src/test/java/org/apache/tamaya/server/ConfigServiceAppTest.java
deleted file mode 100644
index 5f7163d..0000000
--- a/modules/server/src/test/java/org/apache/tamaya/server/ConfigServiceAppTest.java
+++ /dev/null
@@ -1,32 +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.server;
-
-//import static org.junit.Assert.*;
-
-/**
- * Created by atsticks on 22.01.16.
- */
-public class ConfigServiceAppTest {
-
-// @org.junit.Test
-// public void testMain() throws Exception {
-//
-// }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/server/src/test/java/org/apache/tamaya/server/EtcdAccessor.java
----------------------------------------------------------------------
diff --git a/modules/server/src/test/java/org/apache/tamaya/server/EtcdAccessor.java b/modules/server/src/test/java/org/apache/tamaya/server/EtcdAccessor.java
deleted file mode 100644
index 1c8e94b..0000000
--- a/modules/server/src/test/java/org/apache/tamaya/server/EtcdAccessor.java
+++ /dev/null
@@ -1,519 +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.etcd;
-//
-//import org.apache.http.HttpEntity;
-//import org.apache.http.HttpStatus;
-//import org.apache.http.NameValuePair;
-//import org.apache.http.client.config.RequestConfig;
-//import org.apache.http.client.entity.UrlEncodedFormEntity;
-//import org.apache.http.client.methods.CloseableHttpResponse;
-//import org.apache.http.client.methods.HttpDelete;
-//import org.apache.http.client.methods.HttpGet;
-//import org.apache.http.client.methods.HttpPut;
-//import org.apache.http.impl.client.CloseableHttpClient;
-//import org.apache.http.impl.client.HttpClients;
-//import org.apache.http.message.BasicNameValuePair;
-//import org.apache.http.util.EntityUtils;
-//
-//import javax.json.Json;
-//import javax.json.JsonArray;
-//import javax.json.JsonObject;
-//import javax.json.JsonReader;
-//import javax.json.JsonReaderFactory;
-//import java.io.IOException;
-//import java.io.StringReader;
-//import java.util.ArrayList;
-//import java.util.HashMap;
-//import java.util.List;
-//import java.util.Map;
-//import java.util.logging.Level;
-//import java.util.logging.Logger;
-//
-///**
-// * Accessor for reading/writing an etcd endpoint.
-// */
-//public class EtcdAccessor {
-//
-// private static final Logger LOG = Logger.getLogger(EtcdAccessor.class.getName());
-//
-// /** Timeout in seconds. */
-// private int timeout = 2;
-// /** Property that make Johnzon accept commentc. */
-// public static final String JOHNZON_SUPPORTS_COMMENTS_PROP = "org.apache.johnzon.supports-comments";
-// /** The JSON reader factory used. */
-// private final JsonReaderFactory readerFactory = initReaderFactory();
-//
-// /** Initializes the factory to be used for creating readers. */
-// private JsonReaderFactory initReaderFactory() {
-// Map<String, Object> config = new HashMap<>();
-// config.put(JOHNZON_SUPPORTS_COMMENTS_PROP, true);
-// return Json.createReaderFactory(config);
-// }
-//
-// /** The base server url. */
-// private final String serverURL;
-// /** The http client. */
-// private CloseableHttpClient httpclient = HttpClients.createDefault();
-//
-// /**
-// * Creates a new instance with the basic access url.
-// * @param server server url, e.g. {@code http://127.0.0.1:4001}, not null.
-// */
-// public EtcdAccessor(String server){
-// this(server, 2);
-// }
-//
-// public EtcdAccessor(String server, int timeout) {
-// this.timeout = timeout;
-// if(server.endsWith("/")){
-// serverURL = server.substring(0, server.length()-1);
-// } else{
-// serverURL = server;
-// }
-//
-// }
-//
-// /**
-// * Get the etcd server version.
-// * @return the etcd server version, never null.
-// */
-// public String getVersion(){
-// CloseableHttpResponse response = null;
-// String version = "<ERROR>";
-// try {
-// CloseableHttpClient httpclient = HttpClients.createDefault();
-// HttpGet httpGet = new HttpGet(serverURL + "/version");
-// httpGet.setConfig(RequestConfig.copy(RequestConfig.DEFAULT).setSocketTimeout(timeout)
-// .setConnectionRequestTimeout(timeout).setConnectTimeout(timeout).build());
-// response = httpclient.execute(httpGet);
-// HttpEntity entity;
-// if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
-// entity = response.getEntity();
-// // and ensure it is fully consumed
-// version = EntityUtils.toString(entity);
-// EntityUtils.consume(entity);
-// }
-// return version;
-// } catch(Exception e){
-// LOG.log(Level.INFO, "Error getting etcd version from: " + serverURL, e);
-// } finally {
-// if(response!=null){
-// try {
-// response.close();
-// } catch (IOException e) {
-// LOG.log(Level.WARNING, "Failed to close http response", e);
-// }
-// }
-// }
-// return version;
-// }
-//
-// /**
-// * Ask etcd for s aingle key, value pair. Hereby the response returned from etcd:
-// * <pre>
-// * {
-// "action": "get",
-// "node": {
-// "createdIndex": 2,
-// "key": "/message",
-// "modifiedIndex": 2,
-// "value": "Hello world"
-// }
-// * }
-// * </pre>
-// * is mapped to:
-// * <pre>
-// * key=value
-// * _key.source=[etcd]http://127.0.0.1:4001
-// * _key.createdIndex=12
-// * _key.modifiedIndex=34
-// * _key.ttl=300
-// * _key.expiration=...
-// * </pre>
-// * @param key the requested key
-// * @return the mapped result, including meta-entries.
-// */
-// public Map<String,String> get(String key){
-// CloseableHttpResponse response = null;
-// Map<String,String> result = new HashMap<>();
-// try {
-// HttpGet httpGet = new HttpGet(serverURL + "/v2/keys/"+key);
-// httpGet.setConfig(RequestConfig.copy(RequestConfig.DEFAULT).setSocketTimeout(timeout)
-// .setConnectionRequestTimeout(timeout).setConnectTimeout(timeout).build());
-// response = httpclient.execute(httpGet);
-// if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
-// HttpEntity entity = response.getEntity();
-// JsonReader reader = readerFactory.createReader(new StringReader(EntityUtils.toString(entity)));
-// JsonObject o = reader.readObject();
-// JsonObject node = o.getJsonObject("node");
-// result.put(key, node.getString("value"));
-// result.put("_" + key +".source", "[etcd]"+serverURL);
-// if(node.containsKey("createdIndex")) {
-// result.put("_" + key +".createdIndex", String.valueOf(node.getInt("createdIndex")));
-// }
-// if(node.containsKey("modifiedIndex")) {
-// result.put("_" + key +".modifiedIndex", String.valueOf(node.getInt("modifiedIndex")));
-// }
-// if(node.containsKey("expiration")) {
-// result.put("_" + key +".expiration", String.valueOf(node.getString("expiration")));
-// }
-// if(node.containsKey("ttl")) {
-// result.put("_" + key +".ttl", String.valueOf(node.getInt("ttl")));
-// }
-// EntityUtils.consume(entity);
-// }else{
-// result.put("_" + key +".NOT_FOUND.target", "[etcd]"+serverURL);
-// }
-// } catch(Exception e){
-// LOG.log(Level.INFO, "Error reading key '"+key+"' from etcd: " + serverURL, e);
-// result.put("_ERROR", "Error reading key '"+key+"' from etcd: " + serverURL + ": " + e.toString());
-// } finally {
-// if(response!=null){
-// try {
-// response.close();
-// } catch (IOException e) {
-// LOG.log(Level.WARNING, "Failed to close http response", e);
-// }
-// }
-// }
-// return result;
-// }
-//
-// /**
-// * Creates/updates an entry in etcd without any ttl set.
-// * @see #set(String, String, Integer)
-// * @param key the property key, not null
-// * @param value the value to be set
-// * @return the result map as described above.
-// */
-// public Map<String,String> set(String key, String value){
-// return set(key, value, null);
-// }
-//
-// /**
-// * Creates/updates an entry in etcd. The response as follows:
-// * <pre>
-// * {
-// "action": "set",
-// "node": {
-// "createdIndex": 3,
-// "key": "/message",
-// "modifiedIndex": 3,
-// "value": "Hello etcd"
-// },
-// "prevNode": {
-// "createdIndex": 2,
-// "key": "/message",
-// "value": "Hello world",
-// "modifiedIndex": 2
-// }
-// }
-// * </pre>
-// * is mapped to:
-// * <pre>
-// * key=value
-// * _key.source=[etcd]http://127.0.0.1:4001
-// * _key.createdIndex=12
-// * _key.modifiedIndex=34
-// * _key.ttl=300
-// * _key.expiry=...
-// * // optional
-// * _key.prevNode.createdIndex=12
-// * _key.prevNode.modifiedIndex=34
-// * _key.prevNode.ttl=300
-// * _key.prevNode.expiration=...
-// * </pre>
-// * @param key the property key, not null
-// * @param value the value to be set
-// * @param ttlSeconds the ttl in seconds (optional)
-// * @return the result map as described above.
-// */
-// public Map<String,String> set(String key, String value, Integer ttlSeconds){
-// CloseableHttpResponse response = null;
-// Map<String,String> result = new HashMap<>();
-// try{
-// HttpPut put = new HttpPut(serverURL + "/v2/keys/"+key);
-// put.setConfig(RequestConfig.copy(RequestConfig.DEFAULT).setSocketTimeout(timeout)
-// .setConnectionRequestTimeout(timeout).setConnectTimeout(timeout).build());
-// List<NameValuePair> nvps = new ArrayList<>();
-// nvps.add(new BasicNameValuePair("value", value));
-// if(ttlSeconds!=null){
-// nvps.add(new BasicNameValuePair("ttl", ttlSeconds.toString()));
-// }
-// put.setEntity(new UrlEncodedFormEntity(nvps));
-// response = httpclient.execute(put);
-// if (response.getStatusLine().getStatusCode() == HttpStatus.SC_CREATED ||
-// response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
-// HttpEntity entity = response.getEntity();
-// JsonReader reader = readerFactory.createReader(new StringReader(EntityUtils.toString(entity)));
-// JsonObject o = reader.readObject();
-// JsonObject node = o.getJsonObject("node");
-// if(node.containsKey("createdIndex")) {
-// result.put("_" + key +".createdIndex", String.valueOf(node.getInt("createdIndex")));
-// }
-// if(node.containsKey("modifiedIndex")) {
-// result.put("_" + key +".modifiedIndex", String.valueOf(node.getInt("modifiedIndex")));
-// }
-// if(node.containsKey("expiration")) {
-// result.put("_" + key +".expiration", String.valueOf(node.getString("expiration")));
-// }
-// if(node.containsKey("ttl")) {
-// result.put("_" + key +".ttl", String.valueOf(node.getInt("ttl")));
-// }
-// result.put(key, node.getString("value"));
-// result.put("_" + key +".source", "[etcd]"+serverURL);
-// if(node.containsKey("prevNode")){
-// JsonObject prevNode = node.getJsonObject("prevNode");
-// if (prevNode.containsKey("createdIndex")) {
-// result.put("_" + key +".prevNode.createdIndex", String.valueOf(prevNode.getInt("createdIndex")));
-// }
-// if (prevNode.containsKey("modifiedIndex")) {
-// result.put("_" + key +".prevNode.modifiedIndex", String.valueOf(prevNode.getInt("modifiedIndex")));
-// }
-// if(prevNode.containsKey("expiration")) {
-// result.put("_" + key +".prevNode.expiration", String.valueOf(prevNode.getString("expiration")));
-// }
-// if(prevNode.containsKey("ttl")) {
-// result.put("_" + key +".prevNode.ttl", String.valueOf(prevNode.getInt("ttl")));
-// }
-// result.put("_" + key +".prevNode.value", prevNode.getString("value"));
-// }
-// EntityUtils.consume(entity);
-// }
-// } catch(Exception e){
-// LOG.log(Level.INFO, "Error writing to etcd: " + serverURL, e);
-// result.put("_ERROR", "Error writing '"+key+"' to etcd: " + serverURL + ": " + e.toString());
-// } finally {
-// if(response!=null){
-// try {
-// response.close();
-// } catch (IOException e) {
-// LOG.log(Level.WARNING, "Failed to close http response", e);
-// }
-// }
-// }
-// return result;
-// }
-//
-//
-// /**
-// * Deletes a given key. The response is as follows:
-// * <pre>
-// * _key.source=[etcd]http://127.0.0.1:4001
-// * _key.createdIndex=12
-// * _key.modifiedIndex=34
-// * _key.ttl=300
-// * _key.expiry=...
-// * // optional
-// * _key.prevNode.createdIndex=12
-// * _key.prevNode.modifiedIndex=34
-// * _key.prevNode.ttl=300
-// * _key.prevNode.expiration=...
-// * _key.prevNode.value=...
-// * </pre>
-// * @param key the key to be deleted.
-// * @return the response mpas as described above.
-// */
-// public Map<String,String> delete(String key){
-// CloseableHttpResponse response = null;
-// Map<String,String> result = new HashMap<>();
-// try{
-// HttpDelete delete = new HttpDelete(serverURL + "/v2/keys/"+key);
-// delete.setConfig(RequestConfig.copy(RequestConfig.DEFAULT).setSocketTimeout(timeout)
-// .setConnectionRequestTimeout(timeout).setConnectTimeout(timeout).build());
-// response = httpclient.execute(delete);
-// if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
-// HttpEntity entity = response.getEntity();
-// JsonReader reader = readerFactory.createReader(new StringReader(EntityUtils.toString(entity)));
-// JsonObject o = reader.readObject();
-// JsonObject node = o.getJsonObject("node");
-// if(node.containsKey("createdIndex")) {
-// result.put("_" + key +".createdIndex", String.valueOf(node.getInt("createdIndex")));
-// }
-// if(node.containsKey("modifiedIndex")) {
-// result.put("_" + key +".modifiedIndex", String.valueOf(node.getInt("modifiedIndex")));
-// }
-// if(node.containsKey("expiration")) {
-// result.put("_" + key +".expiration", String.valueOf(node.getString("expiration")));
-// }
-// if(node.containsKey("ttl")) {
-// result.put("_" + key +".ttl", String.valueOf(node.getInt("ttl")));
-// }
-// if(o.containsKey("prevNode")){
-// JsonObject prevNode = o.getJsonObject("prevNode");
-// if (prevNode.containsKey("createdIndex")) {
-// result.put("_" + key +".prevNode.createdIndex", String.valueOf(prevNode.getInt("createdIndex")));
-// }
-// if (prevNode.containsKey("modifiedIndex")) {
-// result.put("_" + key +".prevNode.modifiedIndex", String.valueOf(prevNode.getInt("modifiedIndex")));
-// }
-// if(prevNode.containsKey("expiration")) {
-// result.put("_" + key +".prevNode.expiration", String.valueOf(prevNode.getString("expiration")));
-// }
-// if(prevNode.containsKey("ttl")) {
-// result.put("_" + key +".prevNode.ttl", String.valueOf(prevNode.getInt("ttl")));
-// }
-// result.put("_" + key +".prevNode.value", prevNode.getString("value"));
-// }
-// EntityUtils.consume(entity);
-// }
-// } catch(Exception e){
-// LOG.log(Level.INFO, "Error deleting key '"+key+"' from etcd: " + serverURL, e);
-// result.put("_ERROR", "Error deleting '"+key+"' from etcd: " + serverURL + ": " + e.toString());
-// } finally {
-// if(response!=null){
-// try {
-// response.close();
-// } catch (IOException e) {
-// LOG.log(Level.WARNING, "Failed to close http response", e);
-// }
-// }
-// }
-// return result;
-// }
-//
-// /**
-// * Get all properties for the given directory key recursively.
-// * @see #getProperties(String, boolean)
-// * @param directory the directory entry
-// * @return the properties and its metadata
-// */
-// public Map<String,String> getProperties(String directory){
-// return getProperties(directory, true);
-// }
-//
-// /**
-// * Access all properties.
-// * The response of:
-// * <pre>
-// {
-// "action": "get",
-// "node": {
-// "key": "/",
-// "dir": true,
-// "nodes": [
-// {
-// "key": "/foo_dir",
-// "dir": true,
-// "modifiedIndex": 2,
-// "createdIndex": 2
-// },
-// {
-// "key": "/foo",
-// "value": "two",
-// "modifiedIndex": 1,
-// "createdIndex": 1
-// }
-// ]
-// }
-//}
-// </pre>
-// is mapped to a regular Tamaya properties map as follows:
-// <pre>
-// * key1=myvalue
-// * _key1.source=[etcd]http://127.0.0.1:4001
-// * _key1.createdIndex=12
-// * _key1.modifiedIndex=34
-// * _key1.ttl=300
-// * _key1.expiration=...
-// *
-// * key2=myvaluexxx
-// * _key2.source=[etcd]http://127.0.0.1:4001
-// * _key2.createdIndex=12
-// *
-// * key3=val3
-// * _key3.source=[etcd]http://127.0.0.1:4001
-// * _key3.createdIndex=12
-// * _key3.modifiedIndex=2
-// * </pre>
-// */
-// public Map<String,String> getProperties(String directory, boolean recursive){
-// CloseableHttpResponse response = null;
-// Map<String,String> result = new HashMap<>();
-// try{
-// HttpGet get = new HttpGet(serverURL + "/v2/keys/"+directory+"?recursive="+recursive);
-// get.setConfig(RequestConfig.copy(RequestConfig.DEFAULT).setSocketTimeout(timeout)
-// .setConnectionRequestTimeout(timeout).setConnectTimeout(timeout).build());
-// response = httpclient.execute(get);
-// if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
-// HttpEntity entity = response.getEntity();
-// JsonReader reader = readerFactory.createReader(new StringReader(EntityUtils.toString(entity)));
-// JsonObject o = reader.readObject();
-// JsonObject node = o.getJsonObject("node");
-// if(node!=null){
-// addNodes(result, node);
-// }
-// EntityUtils.consume(entity);
-// }
-// } catch(Exception e){
-// LOG.log(Level.INFO, "Error reading properties for '"+directory+"' from etcd: " + serverURL, e);
-// result.put("_ERROR", "Error reading properties for '"+directory+"' from etcd: " + serverURL + ": " + e.toString());
-// } finally {
-// if(response!=null){
-// try {
-// response.close();
-// } catch (IOException e) {
-// LOG.log(Level.WARNING, "Failed to close http response", e);
-// }
-// }
-// }
-// return result;
-// }
-//
-// /**
-// * Recursively read out all key/values from this etcd JSON array.
-// * @param result map with key, values and metadata.
-// * @param node the node to parse.
-// */
-// private void addNodes(Map<String, String> result, JsonObject node) {
-// if(!node.containsKey("dir") || "false".equals(node.get("dir").toString())) {
-// String key = node.getString("key").substring(1);
-// result.put(key, node.getString("value"));
-// if (node.containsKey("createdIndex")) {
-// result.put("_" + key + ".createdIndex", String.valueOf(node.getInt("createdIndex")));
-// }
-// if (node.containsKey("modifiedIndex")) {
-// result.put("_" + key + ".modifiedIndex", String.valueOf(node.getInt("modifiedIndex")));
-// }
-// if (node.containsKey("expiration")) {
-// result.put("_" + key + ".expiration", String.valueOf(node.getString("expiration")));
-// }
-// if (node.containsKey("ttl")) {
-// result.put("_" + key + ".ttl", String.valueOf(node.getInt("ttl")));
-// }
-// result.put("_" + key +".source", "[etcd]"+serverURL);
-// } else {
-// JsonArray nodes = node.getJsonArray("nodes");
-// if (nodes != null) {
-// for (int i = 0; i < nodes.size(); i++) {
-// addNodes(result, nodes.getJsonObject(i));
-// }
-// }
-// }
-// }
-//
-// /**
-// * Access the server root URL used by this accessor.
-// * @return
-// */
-// public String getUrl() {
-// return serverURL;
-// }
-//}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/server/src/test/java/org/apache/tamaya/server/VersionPropertiesTest.java
----------------------------------------------------------------------
diff --git a/modules/server/src/test/java/org/apache/tamaya/server/VersionPropertiesTest.java b/modules/server/src/test/java/org/apache/tamaya/server/VersionPropertiesTest.java
deleted file mode 100644
index 18bc0ba..0000000
--- a/modules/server/src/test/java/org/apache/tamaya/server/VersionPropertiesTest.java
+++ /dev/null
@@ -1,46 +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.server;
-
-import org.hamcrest.Matchers;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.*;
-
-public class VersionPropertiesTest {
-
- @Test
- public void correctVersionPropertiesAreReadAndSet() throws IOException {
- InputStream resource = VersionProperties.class.getResourceAsStream("/META-INF/tamaya-server-version.properties");
-
- Properties properties = new Properties();
- properties.load(resource);
-
- assertThat(VersionProperties.getVersion(), not(Matchers.isEmptyOrNullString()));
- assertThat(VersionProperties.getVersion(), equalTo(properties.get("server.version")));
- assertThat(VersionProperties.getProduct(), not(Matchers.isEmptyOrNullString()));
- assertThat(VersionProperties.getProduct(), equalTo(properties.get("server.product")));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/spi-support/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spi-support/pom.xml b/modules/spi-support/pom.xml
deleted file mode 100644
index 62082eb..0000000
--- a/modules/spi-support/pom.xml
+++ /dev/null
@@ -1,75 +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-extensions</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
-
- <artifactId>tamaya-spisupport</artifactId>
- <name> Apache Tamaya Modules - Common Support Classes</name>
- <description>Apache Tamaya Support Classes useful when implementing the Tamaya SPI or code independent of the core RI
- implementation.</description>
- <packaging>bundle</packaging>
-
- <properties>
- <jdkVersion>1.7</jdkVersion>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tamaya</groupId>
- <artifactId>tamaya-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <!-- Test scope only, do not create a code dependency! -->
- <dependency>
- <groupId>org.apache.tamaya</groupId>
- <artifactId>tamaya-core</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Export-Package>
- org.apache.tamaya.spisupport
- </Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/359d3e4a/modules/spi-support/src/main/java/org/apache/tamaya/spisupport/BasePropertySource.java
----------------------------------------------------------------------
diff --git a/modules/spi-support/src/main/java/org/apache/tamaya/spisupport/BasePropertySource.java b/modules/spi-support/src/main/java/org/apache/tamaya/spisupport/BasePropertySource.java
deleted file mode 100644
index 0d90c8c..0000000
--- a/modules/spi-support/src/main/java/org/apache/tamaya/spisupport/BasePropertySource.java
+++ /dev/null
@@ -1,86 +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.spisupport;
-
-import org.apache.tamaya.spi.PropertySource;
-import org.apache.tamaya.spi.PropertyValue;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Abstract {@link org.apache.tamaya.spi.PropertySource} that allows to set a default ordinal that will be used, if no
- * ordinal is provided with the config.
- */
-public abstract class BasePropertySource implements PropertySource{
- /** default ordinal that will be used, if no ordinal is provided with the config. */
- private final int defaultOrdinal;
-
- /**
- * Constructor.
- * @param defaultOrdinal default ordinal that will be used, if no ordinal is provided with the config.
- */
- protected BasePropertySource(int defaultOrdinal){
- this.defaultOrdinal = defaultOrdinal;
- }
-
- /**
- * Constructor, using a default ordinal of 0.
- */
- protected BasePropertySource(){
- this(0);
- }
-
- @Override
- public String getName() {
- return getClass().getSimpleName();
- }
-
- @Override
- public int getOrdinal() {
- PropertyValue configuredOrdinal = get(TAMAYA_ORDINAL);
- if(configuredOrdinal!=null){
- try{
- return Integer.parseInt(configuredOrdinal.get(TAMAYA_ORDINAL));
- } catch(Exception e){
- Logger.getLogger(getClass().getName()).log(Level.WARNING,
- "Configured Ordinal is not an int number: " + configuredOrdinal, e);
- }
- }
- return getDefaultOrdinal();
- }
-
- /**
- * Returns the default ordinal used, when no ordinal is set, or the ordinal was not parseable to an int value.
- * @return the default ordinal used, by default 0.
- */
- public int getDefaultOrdinal(){
- return defaultOrdinal;
- }
-
- @Override
- public PropertyValue get(String key) {
- return PropertyValue.of(key, getProperties().get(key), getName());
- }
-
- @Override
- public boolean isScannable(){
- return true;
- }
-}