tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [1/2] incubator-tamaya git commit: Fixed quality gate issues. Added doc templates for new modules (server, remote). Added running code for corresponding remote/server example. Implemented additional functions required. Added/moved remote/server to module
Date Fri, 04 Sep 2015 23:45:45 GMT
Repository: incubator-tamaya
Updated Branches:
  refs/heads/master 8a93bad81 -> 2c64ac027


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/modules/server/src/main/java/org/apache/tamaya/server/internal/DefaultConfigService.java
----------------------------------------------------------------------
diff --git a/modules/server/src/main/java/org/apache/tamaya/server/internal/DefaultConfigService.java b/modules/server/src/main/java/org/apache/tamaya/server/internal/DefaultConfigService.java
new file mode 100644
index 0000000..1765e4f
--- /dev/null
+++ b/modules/server/src/main/java/org/apache/tamaya/server/internal/DefaultConfigService.java
@@ -0,0 +1,188 @@
+/*
+ * 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.internal;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.ConfigurationProvider;
+import org.apache.tamaya.functions.ConfigurationFunctions;
+import org.apache.tamaya.server.spi.ConfigProviderService;
+import org.apache.tamaya.server.spi.ScopeManager;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * Implementation of the JAX-RS interface for serving configuration.
+ */
+public class DefaultConfigService implements ConfigProviderService {
+
+    @Override
+    @GET
+    @Path("/config/filtered/{path}")
+    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML, MediaType.TEXT_PLAIN, MediaType.WILDCARD})
+    public String getConfigurationWithPath(@PathParam("path") String path,
+                                    @Context HttpServletRequest request){
+        Map<String,String> requestInfo = new HashMap<>();
+        requestInfo.put("filter",path);
+        requestInfo.put("timestamp", String.valueOf(System.currentTimeMillis()));
+        String format = request.getParameter("format");
+        if(format==null){
+            format = request.getHeader(HttpHeaders.ACCEPT);
+        }
+        requestInfo.put("format", format);
+        String scope = request.getParameter("scope");
+        String scopeId = request.getParameter("scopeId");
+        if(scope!=null && scopeId!=null){
+            return getScopedConfigurationWithPath(scope, scopeId, path, request, format, requestInfo);
+        }
+        Configuration config = ConfigurationProvider.getConfiguration()
+                .with(ConfigurationFunctions.sectionsRecursive(path.split(",")));
+        if(format.contains(MediaType.APPLICATION_JSON)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_JSON_TYPE);
+            return config.query(ConfigurationFunctions.jsonInfo(requestInfo));
+        }
+        if(format.contains(MediaType.APPLICATION_XML)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_XML_TYPE);
+            return config.query(ConfigurationFunctions.xmlInfo(requestInfo));
+        }
+        if(format.contains(MediaType.TEXT_HTML)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_HTML_TYPE);
+            return config.query(ConfigurationFunctions.htmlInfo(requestInfo));
+        }
+        if(format.contains(MediaType.TEXT_PLAIN)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_PLAIN_TYPE);
+            return config.query(ConfigurationFunctions.textInfo(requestInfo));
+        }
+        Response.status(Response.Status.BAD_REQUEST).allow(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)
+                .build();
+        return null;
+    }
+
+
+
+    @Override
+    @GET
+    @Path("/config")
+    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML, MediaType.TEXT_PLAIN, MediaType.WILDCARD})
+    public String getConfiguration(@Context HttpServletRequest request) {
+        Map<String,String> requestInfo = new HashMap<>();
+        requestInfo.put("timestamp", String.valueOf(System.currentTimeMillis()));
+        String format = request.getParameter("format");
+        if(format==null){
+            format = request.getHeader(HttpHeaders.ACCEPT);
+        }
+        String scope = request.getParameter("scope");
+        String scopeId = request.getParameter("scopeId");
+        if(scope!=null && scopeId!=null){
+            return getScopedConfiguration(scope, scopeId, request, format, requestInfo);
+        }
+        Configuration config = ConfigurationProvider.getConfiguration();
+        if(format.contains(MediaType.APPLICATION_JSON)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_JSON_TYPE);
+            return config.query(ConfigurationFunctions.jsonInfo(requestInfo));
+        }
+        if(format.contains(MediaType.APPLICATION_XML)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_XML_TYPE);
+            return config.query(ConfigurationFunctions.xmlInfo(requestInfo));
+        }
+        if(format.contains(MediaType.TEXT_HTML)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_HTML_TYPE);
+            return config.query(ConfigurationFunctions.htmlInfo(requestInfo));
+        }
+        if(format.contains(MediaType.TEXT_PLAIN)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_PLAIN_TYPE);
+            return config.query(ConfigurationFunctions.textInfo(requestInfo));
+        }
+        Response.status(Response.Status.BAD_REQUEST).allow(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML);
+        return null;
+    }
+
+    private String getScopedConfigurationWithPath(String scope, String scopeId, String path, HttpServletRequest request, String format, Map<String,String> requestInfo) {
+        requestInfo.put("scope", scope);
+        requestInfo.put("scopeId", scopeId);
+        Configuration config = ConfigurationProvider.getConfiguration()
+                .with(ScopeManager.getScope(scope, scopeId)).with(ConfigurationFunctions.sectionsRecursive(path.split(",")));
+        if(format.contains(MediaType.APPLICATION_JSON)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_JSON_TYPE);
+            return config.query(ConfigurationFunctions.jsonInfo(requestInfo));
+        }
+        if(format.contains(MediaType.APPLICATION_XML)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_XML_TYPE);
+            return config.query(ConfigurationFunctions.xmlInfo(requestInfo));
+        }
+        if(format.contains(MediaType.TEXT_HTML)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_HTML_TYPE);
+            return config.query(ConfigurationFunctions.htmlInfo(requestInfo));
+        }
+        if(format.contains(MediaType.TEXT_PLAIN)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_PLAIN_TYPE);
+            return config.query(ConfigurationFunctions.textInfo(requestInfo));
+        }
+        Response.status(Response.Status.BAD_REQUEST).allow(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML);
+        return null;
+    }
+
+    private String getScopedConfiguration(String scope, String scopeId, HttpServletRequest request, String format,
+                                          Map<String,String> requestInfo) {
+        requestInfo.put("scope", scope);
+        requestInfo.put("scopeId", scopeId);
+        Configuration config = ConfigurationProvider.getConfiguration().with(ScopeManager.getScope(scope, scopeId));
+        if(format.contains(MediaType.APPLICATION_JSON)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_JSON_TYPE);
+            return config.query(ConfigurationFunctions.jsonInfo(requestInfo));
+        }
+        if(format.contains(MediaType.APPLICATION_XML)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_XML_TYPE);
+            return config.query(ConfigurationFunctions.xmlInfo(requestInfo));
+        }
+        if(format.contains(MediaType.TEXT_HTML)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_HTML_TYPE);
+            return config.query(ConfigurationFunctions.htmlInfo(requestInfo));
+        }
+        if(format.contains(MediaType.TEXT_PLAIN)) {
+            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_PLAIN_TYPE);
+            return config.query(ConfigurationFunctions.textInfo(requestInfo));
+        }
+        Response.status(Response.Status.BAD_REQUEST).allow(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)
+                .build();
+        return null;
+    }
+
+    @Override
+    public String updateConfiguration(@Context HttpServletRequest request) {
+        Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+        return "UPDATE Configuration: Not implemented";
+    }
+
+    @Override
+    public String deleteConfiguration(String paths, @Context HttpServletRequest request) {
+        Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+        return "DELETE Configuration: Not implemented";
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/modules/server/src/main/java/org/apache/tamaya/server/spi/ConfigProviderService.java
----------------------------------------------------------------------
diff --git a/modules/server/src/main/java/org/apache/tamaya/server/spi/ConfigProviderService.java b/modules/server/src/main/java/org/apache/tamaya/server/spi/ConfigProviderService.java
new file mode 100644
index 0000000..ac26d8b
--- /dev/null
+++ b/modules/server/src/main/java/org/apache/tamaya/server/spi/ConfigProviderService.java
@@ -0,0 +1,56 @@
+/*
+ * 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 javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+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.core.Context;
+import javax.ws.rs.core.MediaType;
+
+/**
+ * Configuration serving RESTful service interface.
+ */
+public interface ConfigProviderService {
+
+    @GET
+    @Path("/config/filtered/{path}")
+    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML, MediaType.TEXT_PLAIN,MediaType.WILDCARD})
+    String getConfigurationWithPath(@PathParam("path") String path,
+                                        @Context HttpServletRequest request);
+
+    @GET
+    @Path("/config")
+    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML, MediaType.TEXT_PLAIN,MediaType.WILDCARD })
+    String getConfiguration(@Context HttpServletRequest request);
+
+    @PUT
+    @Path("/config")
+    @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+    String updateConfiguration(@Context HttpServletRequest request);
+
+    @DELETE
+    @Path("/config/{paths}")
+    String deleteConfiguration(@PathParam("paths") String paths, @Context HttpServletRequest request);
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/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
new file mode 100644
index 0000000..a91ffc2
--- /dev/null
+++ b/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java
@@ -0,0 +1,81 @@
+/*
+ * 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.ConfigException;
+import org.apache.tamaya.ConfigOperator;
+import org.apache.tamaya.spi.ServiceContextManager;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Singleton manager for scopes, used by the server component to filtering returned config.
+ */
+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(){
+        Map<String, ScopeProvider> result = new ConcurrentHashMap<>();
+        for(ScopeProvider prov: ServiceContextManager.getServiceContext().getServices(ScopeProvider.class)){
+            try{
+                result.put(prov.getScopeType(), prov);
+            } catch(Exception e){
+                LOG.log(Level.WARNING, "Error loading scopes from " + prov, e);
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Singleton constructor.
+     */
+    private ScopeManager(){}
+
+    /**
+     * Get the scope given its name.
+     * @param scopeId the scope name
+     * @return the scope matching
+     * @throws ConfigException, if nos such scope is defined.
+     */
+    public static ConfigOperator getScope(String scopeId, String target){
+        ScopeProvider  prov = scopeProviders.get(scopeId);
+        if(prov==null){
+            throw new ConfigException("No such scope: " + scopeId);
+        }
+        return prov.getScope(target);
+    }
+
+    /**
+     * 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/2c64ac02/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
new file mode 100644
index 0000000..d74317c
--- /dev/null
+++ b/modules/server/src/main/java/org/apache/tamaya/server/spi/ScopeProvider.java
@@ -0,0 +1,39 @@
+/*
+ * 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 registratable 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.
+     * @return the scope operator, never null.
+     */
+    ConfigOperator getScope(String scopeId);
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/modules/server/src/main/resources/META-INF/services/org.apache.tamaya.server.Server
----------------------------------------------------------------------
diff --git a/modules/server/src/main/resources/META-INF/services/org.apache.tamaya.server.Server b/modules/server/src/main/resources/META-INF/services/org.apache.tamaya.server.Server
new file mode 100644
index 0000000..72b1998
--- /dev/null
+++ b/modules/server/src/main/resources/META-INF/services/org.apache.tamaya.server.Server
@@ -0,0 +1,19 @@
+#
+# 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.server.internal.CXFServer
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/sandbox/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/pom.xml b/sandbox/pom.xml
index 9012c97..2935530 100644
--- a/sandbox/pom.xml
+++ b/sandbox/pom.xml
@@ -40,7 +40,6 @@ under the License.
         <module>jodatime</module>
         <module>sysprops</module>
         <module>environment</module>
-        <module>remote</module>
     </modules>
 
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/sandbox/remote/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/remote/pom.xml b/sandbox/remote/pom.xml
deleted file mode 100644
index ebc09be..0000000
--- a/sandbox/remote/pom.xml
+++ /dev/null
@@ -1,55 +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.2-incubating-SNAPSHOT</version>
-        <relativePath>..</relativePath>
-    </parent>
-
-    <artifactId>tamaya-remote</artifactId>
-    <name>Apache Tamaya Remote PropertySource / Configuration Support</name>
-    <packaging>jar</packaging>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.tamaya</groupId>
-            <artifactId>tamaya-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.servlet</groupId>
-            <artifactId>javax.servlet-api</artifactId>
-            <version>3.1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>tamaya-json</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-        </dependency>
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/sandbox/remote/src/main/java/org/apache/tamaya/remote/BaseRemotePropertySource.java
----------------------------------------------------------------------
diff --git a/sandbox/remote/src/main/java/org/apache/tamaya/remote/BaseRemotePropertySource.java b/sandbox/remote/src/main/java/org/apache/tamaya/remote/BaseRemotePropertySource.java
deleted file mode 100644
index fd1bd7c..0000000
--- a/sandbox/remote/src/main/java/org/apache/tamaya/remote/BaseRemotePropertySource.java
+++ /dev/null
@@ -1,107 +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.remote;
-
-import org.apache.tamaya.format.ConfigurationData;
-import org.apache.tamaya.format.ConfigurationFormat;
-import org.apache.tamaya.json.JSONFormat;
-import org.apache.tamaya.spi.PropertySource;
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Abstract base class for implementing a PropertySource that reads configuration data from a remote resource. It uses
- * by default the JSON format as defined by the JSON module.
- */
-public abstract class BaseRemotePropertySource implements PropertySource{
-
-    private static final ConfigurationFormat DEFAULT_FORMAT = new JSONFormat();
-
-    private Map<String,String> properties = new HashMap<>();
-
-    protected BaseRemotePropertySource(){
-        reload();
-    }
-
-    @Override
-    public String getName() {
-        return getClass().getSimpleName();
-    }
-
-    @Override
-    public Map<String, String> getProperties() {
-        return properties;
-    }
-
-    /**
-     * Reloads the remote configuration. If reloads fails to whatever reasons the already loaded configuration will
-     * stay untouched.
-     */
-    public void reload(){
-        Map readProperties;
-        ConfigurationFormat format = getConfigurationFormat();
-        for(URL url:getAccessURLs()) {
-            try(InputStream is = url.openStream()) {
-                ConfigurationData data = format.readConfiguration(url.toExternalForm(), is);
-                if(data!=null){
-                    readProperties = data.getDefaultSection();
-                    if(readProperties!=null){
-                        Map<String,String> newProperties = new HashMap<>();
-                        for(Map.Entry<String,String> en:readProperties.entrySet()){
-                            // filter data entries
-                            if(en.getKey().startsWith("data.")) {
-                                newProperties.put(en.getKey().substring(5), en.getValue());
-                            }
-                        }
-                        // the configs served by the tamaya server module has a 'data' root section containing the
-                        // config  entries. if not present, we assume an alternate format, which is sued as is...
-                        if(newProperties.isEmpty()){
-                            Logger.getLogger(getClass().getName()).info(
-                                    "Loaded remote config from: " + url + ", does not have a data section, using as is...");
-                            newProperties = readProperties;
-                        }
-                        this.properties = newProperties;
-                        Logger.getLogger(getClass().getName()).info(
-                                "Reloaded remote config from: " + url + ", entriea read: " + this.properties.size());
-                    }
-                }
-            }
-            catch(Exception e){
-                Logger.getLogger(getClass().getName()).log(Level.SEVERE, "Failed to load config from url: " + url, e);
-            }
-        }
-    }
-
-    protected abstract Collection<URL> getAccessURLs();
-
-    protected ConfigurationFormat getConfigurationFormat(){
-        return DEFAULT_FORMAT;
-    }
-
-    protected Map<String,String> mapConfigurationData(ConfigurationData data){
-        return data.getDefaultSection();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/sandbox/server/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/server/pom.xml b/sandbox/server/pom.xml
deleted file mode 100644
index 4ae4ea1..0000000
--- a/sandbox/server/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.2-incubating-SNAPSHOT</version>
-        <relativePath>..</relativePath>
-    </parent>
-
-    <artifactId>tamaya-server</artifactId>
-    <name>Apache Tamaya Configuration: Server Extension</name>
-    <packaging>jar</packaging>
-
-    <properties>
-        <jdkVersion>1.7</jdkVersion>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.tamaya</groupId>
-            <artifactId>tamaya-java7-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tamaya</groupId>
-            <artifactId>tamaya-java7-core</artifactId>
-            <version>${project.version}</version>
-            <scope>runtime</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.apache.cxf</groupId>
-            <artifactId>apache-cxf</artifactId>
-            <version>3.1.2</version>
-        </dependency>
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/sandbox/server/src/main/java/org/apache/tamaya/server/ConfigServer.java
----------------------------------------------------------------------
diff --git a/sandbox/server/src/main/java/org/apache/tamaya/server/ConfigServer.java b/sandbox/server/src/main/java/org/apache/tamaya/server/ConfigServer.java
deleted file mode 100644
index 101bf7c..0000000
--- a/sandbox/server/src/main/java/org/apache/tamaya/server/ConfigServer.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;
-
-import org.apache.tamaya.spi.ServiceContextManager;
-
-/**
- * Simple abstraction of the Server interface.
- */
-public final class ConfigServer {
-
-    /**
-     * Creates a new server instance.
-     * @return a new server instance.
-     */
-    public static Server createServer(){
-        return ServiceContextManager.getServiceContext().getService(Server.class);
-    }
-
-    public static void main(String... args){
-        createServer().start(8888);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/sandbox/server/src/main/java/org/apache/tamaya/server/Server.java
----------------------------------------------------------------------
diff --git a/sandbox/server/src/main/java/org/apache/tamaya/server/Server.java b/sandbox/server/src/main/java/org/apache/tamaya/server/Server.java
deleted file mode 100644
index 5e2cb52..0000000
--- a/sandbox/server/src/main/java/org/apache/tamaya/server/Server.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;
-
-/**
- * Simple abstraction of the Server interface.
- */
-public interface Server {
-    /**
-     * Starts the server on the given port-
-     * @param port the target port.
-     */
-    void start(int port);
-
-    /**
-     * Checks if the server us started.
-     * @return true if the server us started.
-     */
-    boolean isStarted();
-
-    /**
-     * Stops the server, but does not destroy it, so it might be restarted.
-     */
-    void stop();
-
-    /**
-     * Destroy the server instance.
-     */
-    void destroy();
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/sandbox/server/src/main/java/org/apache/tamaya/server/internal/CXFServer.java
----------------------------------------------------------------------
diff --git a/sandbox/server/src/main/java/org/apache/tamaya/server/internal/CXFServer.java b/sandbox/server/src/main/java/org/apache/tamaya/server/internal/CXFServer.java
deleted file mode 100644
index c976723..0000000
--- a/sandbox/server/src/main/java/org/apache/tamaya/server/internal/CXFServer.java
+++ /dev/null
@@ -1,83 +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.internal;
-
-
-import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
-import org.apache.tamaya.server.Server;
-
-/**
- * CXF based implementation of a JAX-RS server, serving the {@link DefaultConfigService} service.
- */
-public class CXFServer implements Server {
-    /** The CXF endpoint. */
-    private org.apache.cxf.endpoint.Server cxfEndpoint;
-
-    /**
-     * Starts the CXF server under the port.
-     * @param port the port.
-     */
-    public void start(int port) {
-        if(cxfEndpoint!=null){
-            if(cxfEndpoint.isStarted()){
-                return;
-            }
-            // start it at the end...
-        }
-        else {
-            JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
-            DefaultConfigService confService = new DefaultConfigService();
-            sf.setServiceBeanObjects(confService);
-            sf.setAddress("http://localhost:" + port + "/");
-            cxfEndpoint = sf.create();
-        }
-        cxfEndpoint.start();
-    }
-
-    /**
-     * Returns the current started state.
-     * @return true, if the server is started.
-     */
-    public boolean isStarted(){
-        if(cxfEndpoint!=null){
-            return cxfEndpoint.isStarted();
-        }
-        return false;
-    }
-
-    /**
-     * Stops the server if running.
-     */
-    public void stop(){
-        if(cxfEndpoint!=null){
-            cxfEndpoint.stop();
-        }
-    }
-
-    /**
-     * Destroy the server.
-     */
-    public void destroy(){
-        if(cxfEndpoint!=null){
-            cxfEndpoint.destroy();
-            cxfEndpoint = null;
-        }
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/sandbox/server/src/main/java/org/apache/tamaya/server/internal/DefaultConfigService.java
----------------------------------------------------------------------
diff --git a/sandbox/server/src/main/java/org/apache/tamaya/server/internal/DefaultConfigService.java b/sandbox/server/src/main/java/org/apache/tamaya/server/internal/DefaultConfigService.java
deleted file mode 100644
index 019b0b3..0000000
--- a/sandbox/server/src/main/java/org/apache/tamaya/server/internal/DefaultConfigService.java
+++ /dev/null
@@ -1,188 +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.internal;
-
-import org.apache.tamaya.ConfigOperator;
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.ConfigurationProvider;
-import org.apache.tamaya.functions.ConfigurationFunctions;
-import org.apache.tamaya.server.spi.ConfigProviderService;
-import org.apache.tamaya.server.spi.ScopeManager;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.HashMap;
-import java.util.Map;
-
-
-/**
- * Implementation of the JAX-RS interface for serving configuration.
- */
-public class DefaultConfigService implements ConfigProviderService {
-
-    @Override
-    @GET
-    @Path("/config/filtered/{path}")
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML, MediaType.TEXT_PLAIN})
-    public String getConfigurationWithPath(@PathParam("path") String path,
-                                    @Context HttpServletRequest request){
-        Map<String,String> requestInfo = new HashMap<>();
-        requestInfo.put("filter",path);
-        requestInfo.put("timestamp", String.valueOf(System.currentTimeMillis()));
-        String format = request.getParameter("format");
-        if(format==null){
-            format = request.getHeader(HttpHeaders.ACCEPT);
-        }
-        requestInfo.put("format", format);
-        String scope = request.getParameter("scope");
-        if(scope!=null){
-            return getScopedConfigurationWithPath(scope, path, request, format, requestInfo);
-        }
-        Configuration config = ConfigurationProvider.getConfiguration()
-                .with(ConfigurationFunctions.sectionsRecursive(path.split(",")));
-        if(format.contains(MediaType.APPLICATION_JSON)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_JSON_TYPE);
-            return config.query(ConfigurationFunctions.jsonInfo(requestInfo));
-        }
-        if(format.contains(MediaType.APPLICATION_XML)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_XML_TYPE);
-            return config.query(ConfigurationFunctions.xmlInfo(requestInfo));
-        }
-        if(format.contains(MediaType.TEXT_HTML)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_HTML_TYPE);
-            return config.query(ConfigurationFunctions.htmlInfo(requestInfo));
-        }
-        if(format.contains(MediaType.TEXT_PLAIN)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_PLAIN_TYPE);
-            return config.query(ConfigurationFunctions.textInfo(requestInfo));
-        }
-        Response.status(Response.Status.BAD_REQUEST).allow(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)
-                .build();
-        return null;
-    }
-
-
-
-    @Override
-    @GET
-    @Path("/config")
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML, MediaType.TEXT_PLAIN})
-    public String getConfiguration(@Context HttpServletRequest request) {
-        Map<String,String> requestInfo = new HashMap<>();
-        requestInfo.put("timestamp", String.valueOf(System.currentTimeMillis()));
-        String format = request.getParameter("format");
-        if(format==null){
-            format = request.getHeader(HttpHeaders.ACCEPT);
-        }
-        String scope = request.getParameter("scope");
-        if(scope!=null){
-            return getScopedConfiguration(scope, request, format, requestInfo);
-        }
-        Configuration config = ConfigurationProvider.getConfiguration();
-        if(format.contains(MediaType.APPLICATION_JSON)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_JSON_TYPE);
-            return config.query(ConfigurationFunctions.jsonInfo(requestInfo));
-        }
-        if(format.contains(MediaType.APPLICATION_XML)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_XML_TYPE);
-            return config.query(ConfigurationFunctions.xmlInfo(requestInfo));
-        }
-        if(format.contains(MediaType.TEXT_HTML)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_HTML_TYPE);
-            return config.query(ConfigurationFunctions.htmlInfo(requestInfo));
-        }
-        if(format.contains(MediaType.TEXT_PLAIN)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_PLAIN_TYPE);
-            return config.query(ConfigurationFunctions.textInfo(requestInfo));
-        }
-        Response.status(Response.Status.BAD_REQUEST).allow(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML);
-        return null;
-    }
-
-    private String getScopedConfigurationWithPath(String scope, String path, HttpServletRequest request, String format, Map<String,String> requestInfo) {
-        requestInfo.put("scope", scope);
-        Configuration config = ConfigurationProvider.getConfiguration()
-                .with(getScope(scope)).with(ConfigurationFunctions.sectionsRecursive(path.split(",")));
-        if(format.contains(MediaType.APPLICATION_JSON)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_JSON_TYPE);
-            return config.query(ConfigurationFunctions.jsonInfo(requestInfo));
-        }
-        if(format.contains(MediaType.APPLICATION_XML)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_XML_TYPE);
-            return config.query(ConfigurationFunctions.xmlInfo(requestInfo));
-        }
-        if(format.contains(MediaType.TEXT_HTML)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_HTML_TYPE);
-            return config.query(ConfigurationFunctions.htmlInfo(requestInfo));
-        }
-        if(format.contains(MediaType.TEXT_PLAIN)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_PLAIN_TYPE);
-            return config.query(ConfigurationFunctions.textInfo(requestInfo));
-        }
-        Response.status(Response.Status.BAD_REQUEST).allow(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML);
-        return null;
-    }
-
-    private String getScopedConfiguration(String scope, HttpServletRequest request, String format, Map<String,String> requestInfo) {
-        requestInfo.put("scope", scope);
-        Configuration config = ConfigurationProvider.getConfiguration().with(getScope(scope));
-        if(format.contains(MediaType.APPLICATION_JSON)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_JSON_TYPE);
-            return config.query(ConfigurationFunctions.jsonInfo(requestInfo));
-        }
-        if(format.contains(MediaType.APPLICATION_XML)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.APPLICATION_XML_TYPE);
-            return config.query(ConfigurationFunctions.xmlInfo(requestInfo));
-        }
-        if(format.contains(MediaType.TEXT_HTML)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_HTML_TYPE);
-            return config.query(ConfigurationFunctions.htmlInfo(requestInfo));
-        }
-        if(format.contains(MediaType.TEXT_PLAIN)) {
-            Response.status(Response.Status.OK).encoding("utf-8").type(MediaType.TEXT_PLAIN_TYPE);
-            return config.query(ConfigurationFunctions.textInfo(requestInfo));
-        }
-        Response.status(Response.Status.BAD_REQUEST).allow(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML)
-                .build();
-        return null;
-    }
-
-    private ConfigOperator getScope(String scope) {
-        return ScopeManager.getScope(scope);
-    }
-
-    @Override
-    public String updateConfiguration(@Context HttpServletRequest request) {
-        Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-        return "UPDATE Configuration: Not implemented";
-    }
-
-    @Override
-    public String deleteConfiguration(String paths, @Context HttpServletRequest request) {
-        Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-        return "DELETE Configuration: Not implemented";
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/sandbox/server/src/main/java/org/apache/tamaya/server/spi/ConfigProviderService.java
----------------------------------------------------------------------
diff --git a/sandbox/server/src/main/java/org/apache/tamaya/server/spi/ConfigProviderService.java b/sandbox/server/src/main/java/org/apache/tamaya/server/spi/ConfigProviderService.java
deleted file mode 100644
index 1e080c3..0000000
--- a/sandbox/server/src/main/java/org/apache/tamaya/server/spi/ConfigProviderService.java
+++ /dev/null
@@ -1,56 +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 javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-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.core.Context;
-import javax.ws.rs.core.MediaType;
-
-/**
- * Configuration serving RESTful service interface.
- */
-public interface ConfigProviderService {
-
-    @GET
-    @Path("/config/filtered/{path}")
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML, MediaType.TEXT_PLAIN})
-    String getConfigurationWithPath(@PathParam("path") String path,
-                                        @Context HttpServletRequest request);
-
-    @GET
-    @Path("/config")
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML, MediaType.TEXT_PLAIN})
-    String getConfiguration(@Context HttpServletRequest request);
-
-    @PUT
-    @Path("/config")
-    @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    String updateConfiguration(@Context HttpServletRequest request);
-
-    @DELETE
-    @Path("/config/{paths}")
-    String deleteConfiguration(@PathParam("paths") String paths, @Context HttpServletRequest request);
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/sandbox/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java
----------------------------------------------------------------------
diff --git a/sandbox/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java b/sandbox/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java
deleted file mode 100644
index 7bd6c81..0000000
--- a/sandbox/server/src/main/java/org/apache/tamaya/server/spi/ScopeManager.java
+++ /dev/null
@@ -1,85 +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.ConfigException;
-import org.apache.tamaya.ConfigOperator;
-import org.apache.tamaya.spi.ServiceContextManager;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Singleton manager for scopes, used by the server component to filtering returned config.
- */
-public final class ScopeManager {
-    /** The logger used. */
-    private static final Logger LOG = Logger.getLogger(ScopeManager.class.getName());
-
-    /**
-     * Singleton constructor.
-     */
-    private ScopeManager(){
-    }
-
-    /** The scopes read from the {@link org.apache.tamaya.spi.ServiceContext}. */
-    private static final Map<String,ConfigOperator> scopes = readScopes();
-
-    /**
-     * Read the scopes from the providers, ordered by their priority.
-     * @return the map of registered scopes.
-     */
-    private static Map<String, ConfigOperator> readScopes() {
-        Map<String,ConfigOperator> scopes = new ConcurrentHashMap<>();
-        for(ScopeProvider prov: ServiceContextManager.getServiceContext().getServices(ScopeProvider.class)){
-            try{
-                ScopeManager.scopes.putAll(prov.getScopes());
-            }
-            catch(Exception e){
-                LOG.log(Level.WARNING, "Error loading scopes from " + prov, e);
-            }
-        }
-        return scopes;
-    }
-
-    /**
-     * Get the scope given its name.
-     * @param scopeId the scope name
-     * @return the scope matching
-     * @throws ConfigException, if nos such scope is defined.
-     */
-    public static ConfigOperator getScope(String scopeId){
-        ConfigOperator op = scopes.get(scopeId);
-        if(op==null){
-            throw new ConfigException("No such scope: " + scopeId);
-        }
-        return op;
-    }
-
-    /**
-     * Get the defined scope names.
-     * @return the defined scope names, never null.
-     */
-    public Set<String> getScopes(){
-        return scopes.keySet();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/sandbox/server/src/main/java/org/apache/tamaya/server/spi/ScopeProvider.java
----------------------------------------------------------------------
diff --git a/sandbox/server/src/main/java/org/apache/tamaya/server/spi/ScopeProvider.java b/sandbox/server/src/main/java/org/apache/tamaya/server/spi/ScopeProvider.java
deleted file mode 100644
index b74f551..0000000
--- a/sandbox/server/src/main/java/org/apache/tamaya/server/spi/ScopeProvider.java
+++ /dev/null
@@ -1,35 +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;
-
-import java.util.Map;
-
-/**
- * Simple registratable provider class to register scopes for the server extension.
- */
-public interface ScopeProvider {
-
-    /**
-     * Return the scopes to be registered.
-     * @return the scope map. The keys are the scope ids that identify the scope operators to be used.
-     */
-    Map<String,ConfigOperator> getScopes();
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2c64ac02/sandbox/server/src/main/resources/META-INF/services/org.apache.tamaya.server.Server
----------------------------------------------------------------------
diff --git a/sandbox/server/src/main/resources/META-INF/services/org.apache.tamaya.server.Server b/sandbox/server/src/main/resources/META-INF/services/org.apache.tamaya.server.Server
deleted file mode 100644
index 72b1998..0000000
--- a/sandbox/server/src/main/resources/META-INF/services/org.apache.tamaya.server.Server
+++ /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.server.internal.CXFServer
\ No newline at end of file


Mime
View raw message