changeset 136:49cf0f26c137 thermostat-mongodb-removal

Remove thermostat-mongodb project from repository Reviewed-by: neugens Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-April/022864.html
author Jie Kang <jkang@redhat.com>
date Thu, 27 Apr 2017 14:26:22 -0400
parents e6d67df4df33
children 6e99767ec5f2
files thermostat-mongodb/README.md thermostat-mongodb/command/pom.xml thermostat-mongodb/command/src/main/java/com/redhat/thermostat/server/command/WebServerCommand.java thermostat-mongodb/core/pom.xml thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/ThermostatMongoStorage.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/configuration/MongoConfiguration.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/filters/MongoRequestFilters.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/handler/MongoStorageHandler.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/request/TimedRequest.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/response/DocumentBuilder.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/response/MongoResponseBuilder.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/configuration/ServerConfiguration.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/http/NamespaceHttpHandler.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/http/StorageHandler.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/WebUser.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/basic/BasicAuthFilter.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/basic/BasicSecurityContext.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/basic/BasicUserStore.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/basic/BasicWebUser.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/none/NoAuthFilter.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/proxy/ProxyAuthFilter.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/proxy/ProxySecurityContext.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/proxy/ProxyWebUser.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authorization/RoleAuthFilter.java thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/web/CoreServer.java thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/json/DocumentBuilderTest.java thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/storage/mongo/response/MongoResponseBuilderTest.java thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/web/security/authentication/basic/BasicAuthFilterTest.java thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/web/security/authentication/basic/BasicUserStoreTest.java thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/web/security/authentication/none/NoAuthFilterTest.java thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/web/security/authentication/proxy/ProxyAuthFilterTest.java thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/web/security/authorization/RoleAuthFilterTest.java thermostat-mongodb/distribution/pom.xml thermostat-mongodb/distribution/src/assembly/src.xml thermostat-mongodb/distribution/src/config/basic-config.properties thermostat-mongodb/distribution/src/config/mongo-config.properties thermostat-mongodb/distribution/src/config/server-config.properties thermostat-mongodb/license/header.txt thermostat-mongodb/license/thermostat-java.xml thermostat-mongodb/license/thermostat-xml.xml thermostat-mongodb/pom.xml thermostat-mongodb/tests/integration-tests/pom.xml thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/storage/ThermostatMongoStorageTest.java thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/CoreServerHttpTest.java thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/DeleteMongoCoreServerTest.java thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/GetMongoCoreServerTest.java thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/PostMongoCoreServerTest.java thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/ProxyCoreServerTest.java thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/PutMongoCoreServerTest.java thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/setup/CoreServerTestSetup.java thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/setup/MongoCoreServerTestSetup.java thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/setup/ProxyCoreServerTestSetup.java thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/setup/TimedTestSetup.java thermostat-mongodb/tests/pom.xml thermostat-mongodb/tests/test-utils/pom.xml thermostat-mongodb/tests/test-utils/src/main/java/com/redhat/thermostat/server/test/util/CoreServerTestUtil.java thermostat-mongodb/tests/test-utils/src/main/java/com/redhat/thermostat/server/test/util/MongodTestUtil.java thermostat-mongodb/tests/test-utils/src/main/java/com/redhat/thermostat/server/test/util/TestPortSetup.java thermostat-mongodb/v1.0.0.yaml
diffstat 59 files changed, 0 insertions(+), 5960 deletions(-) [+]
line wrap: on
line diff
--- a/thermostat-mongodb/README.md	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-# Thermostat Web Server
-
-## Dependencies:
-
-Mongodb
-
-## How To Use
-
-The Web Server will attempt to connect to mongod://127.0.0.1:27518 'thermostat'
-with credentials 'mongodevuser' and 'mongodevpassword'. A valid mongod instance
-can be created via the Thermostat project, running:
-
-```
-$ thermostat-devsetup
-$ thermostata storage --start
-```
-
-Start the Web Server via:
-
-```
-$ java -jar distribution/target/thermostat-mongodb-gateway-distribution-1.99.12-SNAPSHOT-assemble-jar.jar
-```
-
-The default setup will listen on http://localhost:26000/api/v100
-
-## API
-
-See v1.0.0.yaml
-
-## Collections in Thermostat HEAD
-
-agent-config
-backend-info
-cpu-stats
-host-info
-memory-stats
-network-info
-numa-host-info
-numa-stat
-profile-info
-profile-status
-schema-info
-vm-class-stats
-vm-compiler-stats
-vm-cpu-stats
-vm-deadlock-data
-vm-gc-stats
-vm-heap-info
-vm-info
-vm-io-stats
-vm-jmx-notification
-vm-jmx-notification-status
-vm-memory-stats
-vm-numa-stats
-vm-shenandoah-stats
-vm-thread-harvesting
-vm-thread-lock
-vm-thread-session
-vm-thread-state
-vm-thread-summary
-vm-tlab-stats
--- a/thermostat-mongodb/command/pom.xml	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright 2012-2017 Red Hat, Inc.
-
- This file is part of Thermostat.
-
- Thermostat is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- Thermostat is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Thermostat; see the file COPYING.  If not see
- <http://www.gnu.org/licenses/>.
-
- Linking this code with other modules is making a combined work
- based on this code.  Thus, the terms and conditions of the GNU
- General Public License cover the whole combination.
-
- As a special exception, the copyright holders of this code give
- you permission to link this code with independent modules to
- produce an executable, regardless of the license terms of these
- independent modules, and to copy and distribute the resulting
- executable under terms of your choice, provided that you also
- meet, for each linked independent module, the terms and conditions
- of the license of that module.  An independent module is a module
- which is not derived from or based on this code.  If you modify
- this code, you may extend this exception to your version of the
- library, but you are not obligated to do so.  If you do not wish
- to do so, delete this exception statement from your version.
-
--->
-<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>com.redhat.thermostat</groupId>
-        <artifactId>thermostat-mongodb-gateway</artifactId>
-        <version>1.99.12-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>thermostat-mongodb-gateway-command</artifactId>
-
-    <packaging>jar</packaging>
-
-    <name>Thermostat Mongodb Gateway Command</name>
-
-    <dependencies>
-        <!-- Thermostat Web Gateway dependencies -->
-        <dependency>
-            <groupId>com.redhat.thermostat</groupId>
-            <artifactId>thermostat-mongodb-gateway-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <!-- test scoped deps -->
-        <!--<dependency>-->
-            <!--<groupId>junit</groupId>-->
-            <!--<artifactId>junit</artifactId>-->
-            <!--<version></version>-->
-            <!--<scope>test</scope>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.mockito</groupId>-->
-            <!--<artifactId>mockito-core</artifactId>-->
-            <!--<scope>test</scope>-->
-        <!--</dependency>-->
-
-    </dependencies>
-
-</project>
-
--- a/thermostat-mongodb/command/src/main/java/com/redhat/thermostat/server/command/WebServerCommand.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.command;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import com.redhat.thermostat.server.core.web.CoreServer;
-
-
-public class WebServerCommand {
-    public static void main(String[] args) {
-        CoreServer server = new CoreServer();
-
-        Map<String, String> mongoConfig = new HashMap<>();
-        mongoConfig.put("MONGO_URL", "mongodb://127.0.0.1:27518");
-        mongoConfig.put("MONGO_DB", "thermostat");
-        mongoConfig.put("MONGO_USERNAME", "mongodevuser");
-        mongoConfig.put("MONGO_PASSWORD", "mongodevpassword");
-
-        Map<String, String> serverConfig = new HashMap<>();
-        serverConfig.put("URL", "http://localhost:26000");
-        serverConfig.put("SECURITY_PROXY", "false");
-        serverConfig.put("SECURITY_BASIC", "false");
-
-        server.buildServer(serverConfig, mongoConfig, Collections.EMPTY_MAP);
-
-        try {
-            server.getServer().start();
-            server.getServer().join();
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            server.finish();
-        }
-    }
-}
--- a/thermostat-mongodb/core/pom.xml	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright 2012-2017 Red Hat, Inc.
-
- This file is part of Thermostat.
-
- Thermostat is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- Thermostat is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Thermostat; see the file COPYING.  If not see
- <http://www.gnu.org/licenses/>.
-
- Linking this code with other modules is making a combined work
- based on this code.  Thus, the terms and conditions of the GNU
- General Public License cover the whole combination.
-
- As a special exception, the copyright holders of this code give
- you permission to link this code with independent modules to
- produce an executable, regardless of the license terms of these
- independent modules, and to copy and distribute the resulting
- executable under terms of your choice, provided that you also
- meet, for each linked independent module, the terms and conditions
- of the license of that module.  An independent module is a module
- which is not derived from or based on this code.  If you modify
- this code, you may extend this exception to your version of the
- library, but you are not obligated to do so.  If you do not wish
- to do so, delete this exception statement from your version.
-
--->
-<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>com.redhat.thermostat</groupId>
-        <artifactId>thermostat-mongodb-gateway</artifactId>
-        <version>1.99.12-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>thermostat-mongodb-gateway-core</artifactId>
-
-    <packaging>jar</packaging>
-
-    <name>Thermostat Mongodb Gateway Core</name>
-
-    <dependencies>
-        <!-- Jetty deps -->
-        <dependency>
-            <groupId>org.eclipse.jetty</groupId>
-            <artifactId>jetty-server</artifactId>
-            <version>${jetty.version}</version>
-        </dependency>
-
-        <!-- Jersey deps -->
-        <dependency>
-            <groupId>org.glassfish.jersey.containers</groupId>
-            <artifactId>jersey-container-jetty-http</artifactId>
-            <version>${jersey.version}</version>
-            <!-- The jetty-util package here is incompatible with the version of Jetty used -->
-            <exclusions>
-                <exclusion>
-                    <groupId>org.eclipse.jetty</groupId>
-                    <artifactId>jetty-util</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.glassfish.jersey.containers</groupId>
-            <artifactId>jersey-container-servlet-core</artifactId>
-            <version>${jersey.version}</version>
-        </dependency>
-
-        <!-- MongoDB dependencies -->
-        <dependency>
-            <groupId>org.mongodb</groupId>
-            <artifactId>mongo-java-driver</artifactId>
-            <version>${mongo-java-driver.version}</version>
-        </dependency>
-
-        <!-- test scoped deps -->
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>${junit.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.eclipse.jetty</groupId>
-            <artifactId>jetty-client</artifactId>
-            <version>${jetty.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <version>${mockito-core.version}</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-</project>
-
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/ThermostatMongoStorage.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.storage.mongo;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Collections;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import com.mongodb.MongoClient;
-import com.mongodb.MongoClientOptions;
-import com.mongodb.MongoCredential;
-import com.mongodb.ServerAddress;
-import com.mongodb.client.MongoDatabase;
-import com.redhat.thermostat.server.core.internal.storage.mongo.configuration.MongoConfiguration;
-
-public class ThermostatMongoStorage {
-    private static MongoClient mongoClient;
-
-    private static String dbName = "thermostat";
-
-    public static void start(Map<String, String> mongoConfiguration) {
-        String username = null;
-        char[] password = null;
-        String host = "127.0.0.1";
-        int port = 27518;
-        int timeout = 1000;
-
-        if (mongoConfiguration.containsKey(MongoConfiguration.MONGO_DB.toString())) {
-            dbName = mongoConfiguration.get(MongoConfiguration.MONGO_DB.toString());
-        }
-        if (mongoConfiguration.containsKey(MongoConfiguration.MONGO_USERNAME.toString())) {
-            username = mongoConfiguration.get(MongoConfiguration.MONGO_USERNAME.toString());
-        }
-        if (mongoConfiguration.containsKey(MongoConfiguration.MONGO_PASSWORD.toString())) {
-            password = mongoConfiguration.get(MongoConfiguration.MONGO_PASSWORD.toString()).toCharArray();
-        }
-        if (mongoConfiguration.containsKey(MongoConfiguration.MONGO_URL.toString())) {
-            try {
-                URI url = new URI(mongoConfiguration.get(MongoConfiguration.MONGO_URL.toString()));
-                host = url.getHost();
-                port = url.getPort();
-            } catch (URISyntaxException e) {
-                // Do nothing. Defaults will be used.
-            }
-        }
-        if (mongoConfiguration.containsKey(MongoConfiguration.MONGO_SERVER_TIMEOUT.toString())) {
-            timeout = Integer.valueOf(mongoConfiguration.get(MongoConfiguration.MONGO_SERVER_TIMEOUT.toString()));
-        }
-
-        ServerAddress address = new ServerAddress(host, port);
-        if (username != null && password != null) {
-            MongoCredential credential = MongoCredential.createCredential(username, dbName, password);
-            mongoClient = new MongoClient(address, Collections.singletonList(credential), new MongoClientOptions.Builder().serverSelectionTimeout(timeout).connectTimeout(0).socketTimeout(0).build());
-        } else {
-            mongoClient = new MongoClient(address, new MongoClientOptions.Builder().serverSelectionTimeout(timeout).connectTimeout(0).socketTimeout(0).build());
-        }
-
-        Logger mongoLog = Logger.getLogger("org.mongodb.driver");
-        mongoLog.setLevel(Level.OFF);
-    }
-
-    public static boolean isConnected() {
-        try {
-            mongoClient.getAddress();
-        } catch (Exception e) {
-            return false;
-        }
-        return true;
-    }
-
-    public static void finish() {
-        mongoClient.close();
-        mongoClient = null;
-    }
-
-    public static MongoDatabase getDatabase() {
-        return ThermostatMongoStorage.mongoClient.getDatabase(ThermostatMongoStorage.dbName);
-    }
-}
\ No newline at end of file
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/configuration/MongoConfiguration.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.storage.mongo.configuration;
-
-public enum MongoConfiguration {
-    MONGO_URL,
-    MONGO_DB,
-    MONGO_USERNAME,
-    MONGO_PASSWORD,
-
-    MONGO_SERVER_TIMEOUT,
-    ;
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/filters/MongoRequestFilters.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.storage.mongo.filters;
-
-import static com.mongodb.client.model.Filters.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.bson.conversions.Bson;
-
-import com.mongodb.BasicDBList;
-
-public class MongoRequestFilters {
-
-    public static Bson buildGetFilter(String systemId, String agentId, String jvmId, List<String> tags, List<String> queries) {
-        List<Bson> filters = new ArrayList<>();
-
-        filters.add(buildIdFilters(systemId, agentId, jvmId));
-
-        filters.add(buildTagsFilter(tags));
-
-        filters.add(buildQueriesFilter(queries));
-
-        return and(filters);
-    }
-
-
-    private static Bson buildIdFilters(String systemId, String agentId, String jvmId) {
-        List<Bson> filters = new ArrayList<>();
-        if (systemId != null && !(systemId.equals("*"))) {
-            filters.add(eq("systemId", systemId));
-        }
-
-        if (agentId != null && !(agentId.equals("*"))) {
-            filters.add(eq("agentId", agentId));
-        }
-
-        if (jvmId != null && !(jvmId.equals("*"))) {
-            filters.add(eq("vmId", jvmId));
-        }
-        return and(filters);
-    }
-
-    private static Bson buildTagsFilter(List<String> tags) {
-        List<Bson> filters = new ArrayList<>();
-        filters.add(exists("tags", false));
-        if (tags != null && !tags.isEmpty()) {
-            for (String tag : tags) {
-                filters.add(eq("tags", tag));
-            }
-        }
-        return or(filters);
-    }
-
-    private static Bson buildQueriesFilter(List<String> queries) {
-        List<Bson> filters = new ArrayList<>();
-        for (Object q : queries) {
-            String filter = q.toString();
-            Pattern p = Pattern.compile("(<=|>=|<|>|==|!=)");
-            Matcher m = p.matcher(filter);
-            if (m.find()) {
-                String key = filter.substring(0, m.start());
-                String comparator = filter.substring(m.start(), m.end());
-                String valueInput = filter.substring(m.end());
-
-                Object value;
-
-                try {
-                    value = Double.parseDouble(valueInput);
-                } catch (Exception e) {
-                    if (valueInput.startsWith("\"") && valueInput.endsWith("\"")) {
-                        value = valueInput.substring(1, valueInput.length()-1);
-                    } else {
-                        value = valueInput;
-                    }
-                }
-
-                switch (comparator) {
-                    case "<=":
-                        filters.add(lte(key, value));
-                        break;
-                    case ">=":
-                        filters.add(gte(key, value));
-                        break;
-                    case "==":
-                        filters.add(eq(key, value));
-                        break;
-                    case ">":
-                        filters.add(gt(key, value));
-                        break;
-                    case "<":
-                        filters.add(lt(key, value));
-                        break;
-                    case "!=":
-                        filters.add(ne(key, value));
-                        break;
-                }
-            }
-        }
-        return and(filters);
-    }
-
-    public static Bson buildDeleteFilter(String systemId, String agentId, String jvmId, List<String> queries) {
-        List<Bson> filters = new ArrayList<>();
-
-        filters.add(buildIdFilters(systemId, agentId, jvmId));
-
-        filters.add(buildQueriesFilter(queries));
-
-        return and(filters);
-    }
-
-    public static Bson buildPutFilter(String systemId, String agentId, String jvmId, List<String> queries) {
-
-        List<Bson> filters = new ArrayList<>();
-
-        filters.add(buildIdFilters(systemId, agentId, jvmId));
-
-        filters.add(buildQueriesFilter(queries));
-
-        return and(filters);
-    }
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/handler/MongoStorageHandler.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,439 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.storage.mongo.handler;
-
-import static com.mongodb.client.model.Projections.exclude;
-import static com.mongodb.client.model.Projections.excludeId;
-import static com.mongodb.client.model.Projections.fields;
-import static com.mongodb.client.model.Projections.include;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.SecurityContext;
-
-import org.bson.Document;
-import org.bson.conversions.Bson;
-
-import com.mongodb.BasicDBList;
-import com.mongodb.BasicDBObject;
-import com.mongodb.CursorType;
-import com.mongodb.client.FindIterable;
-import com.mongodb.client.model.IndexOptions;
-import com.mongodb.client.model.Indexes;
-import com.mongodb.util.JSON;
-import com.redhat.thermostat.server.core.internal.storage.mongo.ThermostatMongoStorage;
-import com.redhat.thermostat.server.core.internal.storage.mongo.request.TimedRequest;
-import com.redhat.thermostat.server.core.internal.web.http.StorageHandler;
-import com.redhat.thermostat.server.core.internal.storage.mongo.filters.MongoRequestFilters;
-import com.redhat.thermostat.server.core.internal.storage.mongo.response.MongoResponseBuilder;
-import com.redhat.thermostat.server.core.internal.storage.mongo.response.DocumentBuilder;
-
-public class MongoStorageHandler implements StorageHandler {
-
-    private final String systemCollectionSuffix = "";
-    private final String agentCollectionSuffix = "";
-    private final String jvmCollectionSuffix = "";
-
-    private final Set<String> namespaceSet = new HashSet<>();
-    private final Set<String> indexSet = new HashSet<>();
-
-    @Override
-    public void getSystems(final SecurityContext context, final AsyncResponse asyncResponse, final String namespace, final String systemId, final String offset, final String limit, final String sort, final String queries, final String projections) {
-        if (!isMongoConnected(asyncResponse)) {
-            return;
-        }
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                getAll(offset, limit, context, systemId, null, null, namespace, sort, asyncResponse, systemCollectionSuffix, queries, projections);
-            }
-        }).start();
-    }
-
-    @Override
-    public void putSystems(final String body, final SecurityContext context, final AsyncResponse asyncResponse, final String namespace, final String queries, final String systemId) {
-        if (!isMongoConnected(asyncResponse)) {
-            return;
-        }
-
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                putAll(body, context, systemId, null, null, namespace, asyncResponse, systemCollectionSuffix, queries);
-            }
-        }).start();
-    }
-
-    @Override
-    public void postSystems(final String body, final SecurityContext context, final AsyncResponse asyncResponse, final String namespace, final String systemId) {
-        if (!isMongoConnected(asyncResponse)) {
-            return;
-        }
-        if (systemId.equals("*")) {
-            asyncResponse.resume(Response.status(Response.Status.BAD_REQUEST).build());
-            return;
-        }
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                postAll(body, context, systemId, null, null, namespace, asyncResponse, systemCollectionSuffix);
-            }
-        }).start();
-    }
-
-    @Override
-    public void deleteSystems(String body, SecurityContext context, final AsyncResponse asyncResponse, final String namespace, final String systemId, final String queries) {
-        if (!isMongoConnected(asyncResponse)) {
-            return;
-        }
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                deleteAll(systemId, null, null, namespace, asyncResponse, systemCollectionSuffix, queries);
-            }
-        }).start();
-    }
-
-    @Override
-    public void getAgents(final SecurityContext context, final AsyncResponse asyncResponse, final String namespace, final String systemId, final String agentId, final String offset, final String limit, final String sort, final String queries, final String projections) {
-        if (!isMongoConnected(asyncResponse)) {
-            return;
-        }
-
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                getAll(offset,limit,context,systemId,agentId,null,namespace,sort,asyncResponse,agentCollectionSuffix, queries, projections);
-            }
-        }).start();
-    }
-
-    @Override
-    public void putAgents(final String body, final SecurityContext context, final AsyncResponse asyncResponse, final String namespace, final String queries, final String systemId, final String agentId) {
-        if (!isMongoConnected(asyncResponse)) {
-            return;
-        }
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                putAll(body, context, systemId, agentId, null, namespace, asyncResponse, agentCollectionSuffix, queries);
-            }
-        }).start();
-    }
-
-    @Override
-    public void postAgents(final String body, final SecurityContext context, final AsyncResponse asyncResponse, final String namespace, final String systemId, final String agentId) {
-        if (!isMongoConnected(asyncResponse)) {
-            return;
-        }
-        if (agentId.equals("*")) {
-            asyncResponse.resume(Response.status(Response.Status.BAD_REQUEST).build());
-            return;
-        }
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                postAll(body, context, systemId, agentId, null, namespace, asyncResponse, agentCollectionSuffix);
-            }
-        }).start();
-    }
-
-    @Override
-    public void deleteAgents(String body, SecurityContext context, final AsyncResponse asyncResponse, final String namespace, final String systemId, final String agentId, final String queries) {
-        if (!isMongoConnected(asyncResponse)) {
-            return;
-        }
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                deleteAll(systemId, agentId, null, namespace, asyncResponse, agentCollectionSuffix, queries);
-            }
-        }).start();
-    }
-
-    @Override
-    public void getJvms(final SecurityContext context, final AsyncResponse asyncResponse, final String namespace, final String systemId, final String agentId, final String jvmId, final String offset, final String limit, final String sort, final String queries, final String projections) {
-        if (!isMongoConnected(asyncResponse)) {
-            return;
-        }
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                getAll(offset, limit, context, systemId, agentId, jvmId, namespace, sort, asyncResponse, jvmCollectionSuffix, queries, projections);
-            }
-        }).start();
-    }
-
-    @Override
-    public void putJvms(final String body, final SecurityContext context, final AsyncResponse asyncResponse, final String namespace, final String queries, final String systemId, final String agentId, final String jvmId) {
-        if (!isMongoConnected(asyncResponse)) {
-            return;
-        }
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                putAll(body, context, systemId, agentId, jvmId, namespace, asyncResponse, jvmCollectionSuffix, queries);
-            }
-        }).start();
-    }
-
-    @Override
-    public void postJvms(final String body, final SecurityContext context, final AsyncResponse asyncResponse, final String namespace, final String systemId, final String agentId, final String jvmId) {
-        if (!isMongoConnected(asyncResponse)) {
-            return;
-        }
-        if (jvmId.equals("*")) {
-            asyncResponse.resume(Response.status(Response.Status.BAD_REQUEST).build());
-            return;
-        }
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                postAll(body, context, systemId, agentId, jvmId, namespace, asyncResponse, jvmCollectionSuffix);
-            }
-        }).start();
-    }
-
-    @Override
-    public void deleteJvms(String body, SecurityContext context, final AsyncResponse asyncResponse, final String namespace, final String systemId, final String agentId, final String jvmId, final String queries) {
-        if (!isMongoConnected(asyncResponse)) {
-            return;
-        }
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                deleteAll(systemId, agentId, jvmId, namespace, asyncResponse, jvmCollectionSuffix, queries);
-            }
-        }).start();
-    }
-
-    private boolean isMongoConnected(final AsyncResponse asyncResponse) {
-        if (ThermostatMongoStorage.isConnected()) {
-            return true;
-        }
-
-        asyncResponse.resume(Response.status(Response.Status.SERVICE_UNAVAILABLE).entity("Unable to access Backing Storage").build());
-        return false;
-    }
-
-    private Bson createSortObject(String sort) {
-        BasicDBObject sortObject = new BasicDBObject();
-        if (sort != null) {
-            String[] items = sort.split(",");
-            for (String item : items) {
-                if (item.charAt(0) == '+') {
-                    sortObject.append(item.substring(1), 1);
-                } else if (item.charAt(0) == '-') {
-                    sortObject.append(item.substring(1), -1);
-                }
-            }
-        }
-        return sortObject;
-    }
-
-    private Bson createSetObject() {
-        return null;
-    }
-
-    private void getAll(String offset, String limit, SecurityContext context, String systemId, String agentId, String jvmId, final String namespace, final String sort, AsyncResponse asyncResponse, final String collectionSuffix, String queries, String projections) {
-        try {
-            final List<String> queriesList;
-            if (queries != null) {
-                queriesList = Arrays.asList(queries.split(","));
-            } else {
-                queriesList = Collections.emptyList();
-            }
-
-            final List<String> projectionsList;
-            if (projections != null) {
-                projectionsList = Arrays.asList(projections.split(","));
-            } else {
-                projectionsList = Collections.emptyList();
-            }
-
-            final int o = Integer.valueOf(offset);
-            final int l = Integer.valueOf(limit);
-
-            final String userName = context.getUserPrincipal().getName();
-            final Bson filter = MongoRequestFilters.buildGetFilter(systemId, agentId, jvmId, Collections.singletonList(userName), queriesList);
-
-            final Bson projectionFilter;
-            if (projectionsList.size() > 0) {
-                projectionFilter = fields(include(projectionsList), excludeId());
-            } else {
-                projectionFilter = fields(exclude("tags"), excludeId());
-            }
-
-            TimedRequest<String> timedRequest = new TimedRequest<>();
-
-            String documents = timedRequest.run(new TimedRequest.TimedRunnable<String>() {
-                @Override
-                public String run() {
-                    FindIterable<Document> documents = ThermostatMongoStorage.getDatabase().getCollection(namespace + collectionSuffix).find(filter).projection(projectionFilter).sort(createSortObject(sort)).limit(l).skip(o).batchSize(l).cursorType(CursorType.NonTailable);
-                    return MongoResponseBuilder.buildJsonDocuments(documents);
-                }
-            });
-
-            asyncResponse.resume(Response.status(Response.Status.OK).entity(MongoResponseBuilder.buildJsonResponseWithTime(documents, timedRequest.getElapsed())).build());
-        } catch (Exception e) {
-            asyncResponse.resume(Response.status(Response.Status.BAD_REQUEST).build());
-        }
-    }
-    
-    private void putAll(String body, SecurityContext context, final String systemId, final String agentId, final String jvmId, final String namespace, AsyncResponse asyncResponse, final String collectionSuffix, String queries) {
-        try {
-            BasicDBObject inputObject = (BasicDBObject) JSON.parse(body);
-
-            final List<String> queriesList;
-            if (queries != null) {
-                queriesList = Arrays.asList(queries.split(","));
-            } else {
-                queriesList = Collections.emptyList();
-            }
-
-            BasicDBObject setObject = (BasicDBObject) inputObject.get("set");
-            final Bson fields = new Document("$set", setObject);
-            TimedRequest<Boolean> timedRequest = new TimedRequest<>();
-
-            Boolean response = timedRequest.run(new TimedRequest.TimedRunnable<Boolean>() {
-                @Override
-                public Boolean run() {
-                    try {
-                        ThermostatMongoStorage.getDatabase().getCollection(namespace + collectionSuffix).updateMany(MongoRequestFilters.buildPutFilter(systemId, agentId, jvmId, queriesList), fields);
-                    } catch (Exception e) {
-                        return Boolean.FALSE;
-                    }
-                    return Boolean.TRUE;
-                }
-            });
-
-            asyncResponse.resume(Response.status(Response.Status.OK).entity("PUT: " + response.toString()).build());
-        } catch (Exception e) {
-            asyncResponse.resume(Response.status(Response.Status.BAD_REQUEST).build());
-        }
-    }
-
-
-    private void postAll(String body, SecurityContext context, String systemId, String agentId, String jvmId, final String namespace, AsyncResponse asyncResponse, final String collectionSuffix) {
-        if (!namespaceSet.contains(namespace)) {
-            namespaceSet.add(namespace);
-        }
-
-        if (!indexSet.contains(namespace + collectionSuffix)) {
-            if (systemId != null && systemId != "*") {
-                ThermostatMongoStorage.getDatabase().getCollection(namespace + collectionSuffix).createIndex(Indexes.descending("systemId"), new IndexOptions().background(true));
-            }
-            if (agentId != null && systemId != "*") {
-                ThermostatMongoStorage.getDatabase().getCollection(namespace + collectionSuffix).createIndex(Indexes.descending("agentId"), new IndexOptions().background(true));
-            }
-            if (jvmId != null && systemId != "*") {
-                ThermostatMongoStorage.getDatabase().getCollection(namespace + collectionSuffix).createIndex(Indexes.descending("vmId"), new IndexOptions().background(true));
-                indexSet.add(namespace + collectionSuffix);
-            }
-            if (body.contains("timeStamp")) {
-                ThermostatMongoStorage.getDatabase().getCollection(namespace + collectionSuffix).createIndex(Indexes.descending("timeStamp"), new IndexOptions().background(true));
-                indexSet.add(namespace + collectionSuffix);
-            }
-        }
-
-        try {
-            BasicDBList inputList = (BasicDBList) JSON.parse(body);
-
-            final List<Document> items = new ArrayList<>();
-            for (Object item : inputList) {
-                items.add(Document.parse(new DocumentBuilder(item.toString()).addTags(context.getUserPrincipal().getName()).addId("systemId", systemId).addId("agentId", agentId).addId("vmId", jvmId).build()));
-            }
-
-            TimedRequest<Boolean> timedRequest = new TimedRequest<>();
-
-            Boolean response = timedRequest.run(new TimedRequest.TimedRunnable<Boolean>() {
-                @Override
-                public Boolean run() {
-                    try {
-                        ThermostatMongoStorage.getDatabase().getCollection(namespace + collectionSuffix).insertMany(items);
-                    } catch (Exception e) {
-                        return Boolean.FALSE;
-                    }
-                    return Boolean.TRUE;
-                }
-            });
-
-            asyncResponse.resume(Response.status(Response.Status.OK).entity("POST: " + response.toString()).build());
-        } catch (Exception e) {
-            asyncResponse.resume(Response.status(Response.Status.BAD_REQUEST).build());
-        }
-    }
-
-    private void deleteAll(final String systemId, final String agentId, final String jvmId, final String namespace, AsyncResponse asyncResponse, final String collectionSuffix, String queries) {
-        try {
-
-            final List<String> queriesList;
-            if (queries != null) {
-                queriesList = Arrays.asList(queries.split(","));
-            } else {
-                queriesList = Collections.emptyList();
-            }
-
-
-            TimedRequest<Boolean> timedRequest = new TimedRequest<>();
-
-            Boolean response = timedRequest.run(new TimedRequest.TimedRunnable<Boolean>() {
-                @Override
-                public Boolean run() {
-                    try {
-                        ThermostatMongoStorage.getDatabase().getCollection(namespace + collectionSuffix).deleteMany(MongoRequestFilters.buildDeleteFilter(systemId, agentId, jvmId, queriesList));
-                    } catch (Exception e) {
-                        return Boolean.FALSE;
-                    }
-                    return Boolean.TRUE;
-                }
-            });
-            asyncResponse.resume(Response.status(Response.Status.OK).entity("DELETE: " + response.toString()).build());
-        } catch (Exception e) {
-            asyncResponse.resume(Response.status(Response.Status.BAD_REQUEST).build());
-        }
-
-    }
-
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/request/TimedRequest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.storage.mongo.request;
-
-public class TimedRequest <T> {
-    private long elapsed = 0;
-
-    public TimedRequest() {}
-
-    public T run(TimedRunnable<T> r) {
-        long start = System.nanoTime();
-        T value = r.run();
-        elapsed = System.nanoTime() - start;
-        return value;
-    }
-
-    public interface TimedRunnable <T> {
-        T run();
-    }
-
-    public long getElapsed() {
-        return elapsed;
-    }
-}
-
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/response/DocumentBuilder.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.storage.mongo.response;
-
-public class DocumentBuilder {
-
-    private final StringBuilder contentBuilder;
-
-    public DocumentBuilder(String content) {
-        contentBuilder = new StringBuilder().append(content);
-    }
-
-    /**
-     * Adds tags to the JSON content
-     * {/[ ... }/] -> {/[ ... ,tags:["admin",...]}/]
-     * @param tags the tags to add
-     * @return the JSON string with tags attached
-     */
-    public DocumentBuilder addTags(String... tags) {
-        StringBuilder tagBuilder = new StringBuilder();
-        tagBuilder.append(",\"tags\":[\"admin\"");
-        for (String tag : tags) {
-            tagBuilder.append(",\"").append(tag).append("\"");
-        }
-        tagBuilder.append("]");
-
-        contentBuilder.insert(contentBuilder.length() - 1, tagBuilder.toString());
-        return this;
-    }
-
-    /**
-     * Add key-value pair to the JSON content
-     * {/[ ... }/] -> {/[ ... ,"key:"admin"}/]
-     *
-     * @param key the key
-     * @param value the value
-     * @return the JSON string with key-value pair attached
-     */
-    public DocumentBuilder addId(String key, String value) {
-        if (key != null && value != null && !value.equals("*") && !contentBuilder.toString().contains(key)) {
-            String kvPair = ",\"" + key + "\":\"" + value + "\"";
-            contentBuilder.insert(contentBuilder.length() - 1, kvPair);
-        }
-        return this;
-    }
-
-    public String build() {
-        return contentBuilder.toString();
-    }
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/response/MongoResponseBuilder.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.storage.mongo.response;
-
-import org.bson.Document;
-
-import com.mongodb.Block;
-import com.mongodb.client.FindIterable;
-
-public class MongoResponseBuilder {
-
-    /**
-     * JSON Response format
-     * {
-     *   "response" : {
-     *       [ {...}, ... ]
-     *   }
-     * }
-     *
-     * Timed JSON Response format
-     * {
-     *   "response" : {
-     *       [ {...}, ... ]
-     *   },
-     *   "time" : elapsed
-     * }
-     */
-
-    public static String buildJsonResponseWithTime(String documents, long elapsed) {
-        return "{" +
-                documents +
-                buildKeyAddition("time", "" + elapsed) +
-                "}";
-    }
-
-    public static String buildJsonDocuments(FindIterable<Document> documents) {
-        final StringBuilder s = new StringBuilder();
-
-        s.append("\"response\" : [");
-
-        final int[] i = {0};
-
-        documents.forEach(new Block<Document>() {
-            @Override
-            public void apply(Document document) {
-                s.append(document.toJson()).append(",");
-                i[0]++;
-            }
-        });
-
-        if (i[0] != 0) {
-            s.deleteCharAt(s.length() - 1);
-        }
-
-        s.append("]");
-
-        return s.toString();
-    }
-
-    private static String buildKeyAddition(String key, String value) {
-        return ",\"" + key + "\" : \"" + value + "\"";
-    }
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/configuration/ServerConfiguration.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.configuration;
-
-public enum ServerConfiguration {
-    URL,
-
-    SECURITY_PROXY,
-    SECURITY_BASIC,
-    ;
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/http/NamespaceHttpHandler.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.http;
-
-import javax.ws.rs.*;
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.container.Suspended;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.SecurityContext;
-
-@Path("/api/v100/{namespace}")
-public class NamespaceHttpHandler {
-    private final StorageHandler handler;
-
-    public NamespaceHttpHandler(StorageHandler handler) {
-        this.handler = handler;
-    }
-
-    private static final String OFFSET = "0";
-    private static final String LIMIT = "50";
-
-    @GET
-    @Path("systems/{systemId}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public void getSystems(@Context SecurityContext context,
-                           @Suspended final AsyncResponse asyncResponse,
-                           @PathParam("namespace") String namespace,
-                           @PathParam("systemId") String systemId,
-                           @QueryParam("o") @DefaultValue(OFFSET) String offset,
-                           @QueryParam("l") @DefaultValue(LIMIT) String limit,
-                           @QueryParam("s") String sort,
-                           @QueryParam("q") String queries,
-                           @QueryParam("p") String projections) {
-        handler.getSystems(context, asyncResponse, namespace, systemId, offset, limit, sort, queries, projections);
-    }
-
-    @PUT
-    @Path("systems/{systemId}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public void putSystems(String body,
-                           @Context SecurityContext context,
-                           @Suspended final AsyncResponse asyncResponse,
-                           @PathParam("namespace") String namespace,
-                           @QueryParam("q") String queries,
-                           @PathParam("systemId") String systemId) {
-        handler.putSystems(body, context, asyncResponse, namespace, queries, systemId);
-    }
-
-    @POST
-    @Path("systems/{systemId}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public void postSystems(String body,
-                            @Context SecurityContext context,
-                            @Suspended final AsyncResponse asyncResponse,
-                            @PathParam("namespace") String namespace,
-                            @PathParam("systemId") String systemId) {
-        handler.postSystems(body, context, asyncResponse, namespace, systemId);
-    }
-
-    @DELETE
-    @Path("systems/{systemId}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public void deleteSystems(String body,
-                              @Context SecurityContext context,
-                              @Suspended final AsyncResponse asyncResponse,
-                              @PathParam("namespace") String namespace,
-                              @PathParam("systemId") String systemId,
-                              @QueryParam("q") String queries) {
-        handler.deleteSystems(body, context, asyncResponse, namespace, systemId, queries);
-    }
-
-    @GET
-    @Path("systems/{systemId}/agents/{agentId}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public void getAgents(@Context SecurityContext securityContext,
-                          @Suspended final AsyncResponse asyncResponse,
-                          @PathParam("namespace") String namespace,
-                          @PathParam("systemId") String systemId,
-                          @PathParam("agentId") String agentId,
-                          @QueryParam("o") @DefaultValue(OFFSET) String offset,
-                          @QueryParam("l") @DefaultValue(LIMIT) String limit,
-                          @QueryParam("s") String sort,
-                          @QueryParam("q") String queries,
-                          @QueryParam("p") String projections) {
-        handler.getAgents(securityContext, asyncResponse, namespace, systemId, agentId, offset, limit, sort, queries, projections);
-    }
-
-    @PUT
-    @Path("systems/{systemId}/agents/{agentId}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public void putAgents(String body,
-                          @Context SecurityContext context,
-                          @Suspended final AsyncResponse asyncResponse,
-                          @PathParam("namespace") String namespace,
-                          @QueryParam("q") String queries,
-                          @PathParam("systemId") String systemId,
-                          @PathParam("agentId") String agentId) {
-        handler.putAgents(body, context, asyncResponse, namespace, queries, systemId, agentId);
-    }
-
-    @POST
-    @Path("systems/{systemId}/agents/{agentId}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public void postAgents(String body,
-                           @Context SecurityContext context,
-                           @Suspended final AsyncResponse asyncResponse,
-                           @PathParam("namespace") String namespace,
-                           @PathParam("systemId") String systemId,
-                           @PathParam("agentId") String agentId) {
-        handler.postAgents(body, context, asyncResponse, namespace, systemId, agentId);
-    }
-
-    @DELETE
-    @Path("systems/{systemId}/agents/{agentId}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public void deleteAgents(String body,
-                             @Context SecurityContext context,
-                             @Suspended final AsyncResponse asyncResponse,
-                             @PathParam("namespace") String namespace,
-                             @PathParam("systemId") String systemId,
-                             @PathParam("agentId") String agentId,
-                             @QueryParam("q") String queries) {
-        handler.deleteAgents(body, context, asyncResponse, namespace, systemId, agentId, queries);
-    }
-
-    @GET
-    @Path("systems/{systemId}/agents/{agentId}/jvms/{jvmId}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public void getJvms(@Context SecurityContext securityContext,
-                        @Suspended final AsyncResponse asyncResponse,
-                        @PathParam("namespace") String namespace,
-                        @PathParam("systemId") String systemId,
-                        @PathParam("agentId") String agentId,
-                        @PathParam("jvmId") String jvmId,
-                        @QueryParam("o") @DefaultValue(OFFSET) String offset,
-                        @QueryParam("l") @DefaultValue(LIMIT) String limit,
-                        @QueryParam("s") String sort,
-                        @QueryParam("q") String queries,
-                        @QueryParam("p") String projections) {
-        handler.getJvms(securityContext, asyncResponse, namespace, systemId, agentId, jvmId, offset, limit, sort, queries, projections);
-    }
-
-    @PUT
-    @Path("systems/{systemId}/agents/{agentId}/jvms/{jvmId}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public void putJvms(String body,
-                        @Context SecurityContext context,
-                        @Suspended final AsyncResponse asyncResponse,
-                        @PathParam("namespace") String namespace,
-                        @QueryParam("q") String queries,
-                        @PathParam("systemId") String systemId,
-                        @PathParam("agentId") String agentId,
-                        @PathParam("jvmId") String jvmId) {
-        handler.putJvms(body, context, asyncResponse, namespace, queries, systemId, agentId, jvmId);
-    }
-
-    @POST
-    @Path("systems/{systemId}/agents/{agentId}/jvms/{jvmId}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public void postJvms(String body,
-                         @Context SecurityContext context,
-                         @Suspended final AsyncResponse asyncResponse,
-                         @PathParam("namespace") String namespace,
-                         @PathParam("systemId") String systemId,
-                         @PathParam("agentId") String agentId,
-                         @PathParam("jvmId") String jvmId) {
-        handler.postJvms(body, context, asyncResponse, namespace, systemId, agentId, jvmId);
-    }
-
-    @DELETE
-    @Path("systems/{systemId}/agents/{agentId}/jvms/{jvmId}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public void deleteJvms(String body,
-                           @Context SecurityContext context,
-                           @Suspended final AsyncResponse asyncResponse,
-                           @PathParam("namespace") String namespace,
-                           @PathParam("systemId") String systemId,
-                           @PathParam("agentId") String agentId,
-                           @PathParam("jvmId") String jvmId,
-                           @QueryParam("q") String queries) {
-        handler.deleteJvms(body, context, asyncResponse, namespace, systemId, agentId, jvmId, queries);
-    }
-
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/http/StorageHandler.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.http;
-
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.core.SecurityContext;
-
-public interface StorageHandler {
-    void getSystems(SecurityContext context, AsyncResponse asyncResponse, String namespace, String systemId, String offset, String limit, String sort, String queries, String projections);
-
-    void putSystems(String body, SecurityContext context, AsyncResponse asyncResponse, String namespace, String queries, String systemId);
-
-    void postSystems(String body, SecurityContext context, AsyncResponse asyncResponse, String namespace, String systemId);
-
-    void deleteSystems(String body, SecurityContext context, AsyncResponse asyncResponse, String namespace, String systemId, String queries);
-
-    void getAgents(SecurityContext securityContext, AsyncResponse asyncResponse, String namespace, String systemId, String agentId, String offset, String limit, String sort, String queries, String projections);
-
-    void putAgents(String body, SecurityContext context, AsyncResponse asyncResponse, String namespace, String queries, String systemId, String agentId);
-
-    void postAgents(String body, SecurityContext context, AsyncResponse asyncResponse, String namespace, String systemId, String agentId);
-
-    void deleteAgents(String body, SecurityContext context, AsyncResponse asyncResponse, String namespace, String systemId, String agentId, String queries);
-
-    void getJvms(SecurityContext securityContext, AsyncResponse asyncResponse, String namespace, String systemId, String agentId, String jvmId, String offset, String limit, String sort, String queries, String projections);
-
-    void putJvms(String body, SecurityContext context, AsyncResponse asyncResponse, String namespace, String queries, String systemId, String agentId, String jvmId);
-
-    void postJvms(String body, SecurityContext context, AsyncResponse asyncResponse, String namespace, String systemId, String agentId, String jvmId);
-
-    void deleteJvms(String body, SecurityContext context, AsyncResponse asyncResponse, String namespace, String systemId, String agentId, String jvmId, String queries);
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/WebUser.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security;
-
-public interface WebUser {
-    String getUsername();
-    boolean isUserInRole(String role);
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/basic/BasicAuthFilter.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authentication.basic;
-
-import java.io.IOException;
-import java.nio.charset.Charset;
-
-import javax.annotation.Priority;
-import javax.ws.rs.NotAuthorizedException;
-import javax.ws.rs.Priorities;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.ext.Provider;
-import javax.xml.bind.DatatypeConverter;
-
-@Provider
-@Priority(Priorities.AUTHENTICATION)
-public class BasicAuthFilter implements ContainerRequestFilter {
-
-    private static final String notAuthorized = "Basic realm=\"thermostat\"";
-
-    private final BasicUserStore userStore;
-
-    public BasicAuthFilter(BasicUserStore userStore) {
-        this.userStore = userStore;
-    }
-
-    @Override
-    public void filter(ContainerRequestContext requestContext) throws IOException {
-            String authentication = requestContext.getHeaderString(HttpHeaders.AUTHORIZATION);
-            if (authentication == null) {
-                throw new NotAuthorizedException(notAuthorized);
-            }
-
-            if (!authentication.startsWith("Basic ")) {
-                throw new NotAuthorizedException(notAuthorized);
-            }
-
-            authentication = authentication.substring("Basic ".length());
-            String[] values = new String(DatatypeConverter.parseBase64Binary(authentication),
-                    Charset.forName("ASCII")).split(":");
-            if (values.length < 2) {
-                throw new NotAuthorizedException(notAuthorized);
-            }
-
-            String username = values[0];
-            String password = values[1];
-
-            BasicWebUser user = userStore.getUser(username);
-            if (user == null) {
-                throw new NotAuthorizedException(notAuthorized);
-            }
-
-            if (!user.getPassword().equals(password)) {
-                throw new NotAuthorizedException(notAuthorized);
-            }
-
-            requestContext.setSecurityContext(new BasicSecurityContext(user));
-    }
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/basic/BasicSecurityContext.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authentication.basic;
-
-import java.security.Principal;
-
-import javax.ws.rs.core.SecurityContext;
-
-import com.redhat.thermostat.server.core.internal.web.security.WebUser;
-
-class BasicSecurityContext implements SecurityContext {
-    private final WebUser user;
-
-    public BasicSecurityContext(WebUser user) {
-        this.user = user;
-    }
-
-    @Override
-    public Principal getUserPrincipal() {
-        return new Principal() {
-            @Override
-            public String getName() {
-                return user.getUsername();
-            }
-        };
-    }
-
-    @Override
-    public boolean isUserInRole(String role) {
-        return user.isUserInRole(role);
-    }
-
-    @Override
-    public boolean isSecure() {
-        return true;
-    }
-
-    @Override
-    public String getAuthenticationScheme() {
-        return "Basic";
-    }
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/basic/BasicUserStore.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authentication.basic;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-
-public class BasicUserStore {
-
-    private final Map<String, BasicWebUser> users = new HashMap<>();
-
-    public BasicUserStore(Map<String, String> userConfig) {
-        for (Map.Entry<String, String> entry : userConfig.entrySet()) {
-            String username = entry.getKey();
-            ArrayList<String> items = new ArrayList<>(Arrays.asList(entry.getValue().split(",")));
-            BasicWebUser user = new BasicWebUser(username, items.get(0).toCharArray(), new HashSet<>(items.subList(1, items.size())));
-            this.users.put(username, user);
-        }
-    }
-
-    public BasicWebUser getUser(String userName) {
-        return users.get(userName);
-    }
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/basic/BasicWebUser.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authentication.basic;
-
-import java.util.Set;
-
-import com.redhat.thermostat.server.core.internal.web.security.WebUser;
-
-public class BasicWebUser implements WebUser {
-    private final String username;
-    private final Set<String> roles;
-    private final char[] password;
-
-    public BasicWebUser(String username, char[] password, Set<String> roles) {
-        this.username = username;
-        this.roles = roles;
-        this.password = password;
-    }
-
-    @Override
-    public String getUsername() {
-        return this.username;
-    }
-
-    @Override
-    public boolean isUserInRole(String role) {
-        return this.roles.contains(role);
-    }
-
-    public String getPassword() {
-        return new String(password);
-    }
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/none/NoAuthFilter.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authentication.none;
-
-import java.io.IOException;
-import java.security.Principal;
-
-import javax.annotation.Priority;
-import javax.ws.rs.Priorities;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.ext.Provider;
-
-@Provider
-@Priority(Priorities.AUTHENTICATION)
-public class NoAuthFilter implements ContainerRequestFilter {
-    @Override
-    public void filter(ContainerRequestContext requestContext) throws IOException {
-        requestContext.setSecurityContext(new SecurityContext() {
-            @Override
-            public Principal getUserPrincipal() {
-                return new Principal() {
-                    @Override
-                    public String getName() {
-                        return "user";
-                    }
-                };
-            }
-
-            @Override
-            public boolean isUserInRole(String s) {
-                return true;
-            }
-
-            @Override
-            public boolean isSecure() {
-                return false;
-            }
-
-            @Override
-            public String getAuthenticationScheme() {
-                return null;
-            }
-        });
-    }
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/proxy/ProxyAuthFilter.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authentication.proxy;
-
-import java.io.IOException;
-
-import javax.annotation.Priority;
-import javax.ws.rs.NotAuthorizedException;
-import javax.ws.rs.Priorities;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.ext.Provider;
-
-@Provider
-@Priority(Priorities.AUTHENTICATION)
-public class ProxyAuthFilter implements ContainerRequestFilter{
-
-    @Override
-    public void filter(ContainerRequestContext requestContext) throws IOException, NotAuthorizedException {
-        String username = requestContext.getHeaderString("X-SSSD-REMOTE-USER");
-        if (username == null) {
-            throw new NotAuthorizedException("Proxy realm=\"thermostat\"");
-        }
-
-        ProxyWebUser user = new ProxyWebUser(username);
-
-        String groups = requestContext.getHeaderString("X-SSSD-REMOTE-USER-GROUPS");
-        if (groups != null) {
-            String[] roles = groups.split(":");
-            for (String role : roles) {
-                user.addRole(role);
-            }
-        }
-
-        requestContext.setSecurityContext(new ProxySecurityContext(user));
-    }
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/proxy/ProxySecurityContext.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authentication.proxy;
-
-import java.security.Principal;
-
-import javax.ws.rs.core.SecurityContext;
-
-import com.redhat.thermostat.server.core.internal.web.security.WebUser;
-
-class ProxySecurityContext implements SecurityContext{
-    private final WebUser user;
-
-    public ProxySecurityContext(WebUser user) {
-        this.user = user;
-    }
-
-    @Override
-    public Principal getUserPrincipal() {
-        return new Principal() {
-            @Override
-            public String getName() {
-                return user.getUsername();
-            }
-        };
-    }
-
-    @Override
-    public boolean isUserInRole(String role) {
-        return user.isUserInRole(role);
-    }
-
-    @Override
-    public boolean isSecure() {
-        return true;
-    }
-
-    @Override
-    public String getAuthenticationScheme() {
-        return "Proxy";
-    }
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authentication/proxy/ProxyWebUser.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authentication.proxy;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import com.redhat.thermostat.server.core.internal.web.security.WebUser;
-
-public class ProxyWebUser implements WebUser {
-    private final String username;
-    private final Set<String> roles = new HashSet<>();
-
-    public ProxyWebUser(String username) {
-        this.username = username;
-    }
-
-    @Override
-    public String getUsername() {
-        return this.username;
-    }
-
-    @Override
-    public boolean isUserInRole(String role) {
-        return this.roles.contains(role);
-    }
-
-    public void addRole(String role) {
-        if (role != null) {
-            roles.add(role);
-        }
-    }
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/internal/web/security/authorization/RoleAuthFilter.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authorization;
-
-import java.io.IOException;
-
-import javax.annotation.Priority;
-import javax.ws.rs.NotAuthorizedException;
-import javax.ws.rs.Priorities;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.ext.Provider;
-
-@Provider
-@Priority(Priorities.AUTHORIZATION)
-public class RoleAuthFilter implements ContainerRequestFilter {
-    @Override
-    public void filter(ContainerRequestContext containerRequestContext) throws IOException, NotAuthorizedException {
-        String paths[] = containerRequestContext.getUriInfo().getPath().substring(1).split("/");
-        int length = paths.length;
-        SecurityContext securityContext = containerRequestContext.getSecurityContext();
-
-        /*
-         * Path:
-         * /api/v100/{namespace}/systems/{id}/agents/{id}/jvms/{id}
-         *   0    1     2         3        4   5       6   7     8
-         * Roles:
-         *
-         * thermostat-admin
-         * thermostat-namespaces-(name)
-         * thermostat-systems-(name)
-         * thermostat-jvms-(name)
-         * thermostat-agents-(name)
-         *
-         * (name) is either 'all' or some string referencing a specific identity
-         */
-
-        /*
-         * thermostat-admin is always authorized
-         */
-        if (securityContext.isUserInRole("thermostat-admin")) {
-            return;
-        }
-
-        /*
-         * request to / is always authorized
-         */
-        if (length < 3) {
-            return;
-        }
-
-        String namespaceRole = "thermostat-namespaces-" + paths[2];
-        if (!(securityContext.isUserInRole("thermostat-namespaces-all") || securityContext.isUserInRole(namespaceRole))) {
-            throw new NotAuthorizedException("Basic: realm=\"thermostat\"");
-        }
-
-        if (length < 5) {
-            return;
-        }
-
-        String systemRole = "thermostat-systems-" + paths[4];
-        if (!(securityContext.isUserInRole("thermostat-systems-all") || securityContext.isUserInRole(systemRole))) {
-            throw new NotAuthorizedException("Basic: realm=\"thermostat\"");
-        }
-
-        if (length < 7) {
-            return;
-        }
-
-        String agentRole = "thermostat-agents-" + paths[6];
-        if (!(securityContext.isUserInRole("thermostat-agents-all") || securityContext.isUserInRole(agentRole))) {
-            throw new NotAuthorizedException("Basic: realm=\"thermostat\"");
-        }
-
-        if (length < 9) {
-            return;
-        }
-
-        String jvmRole = "thermostat-jvms-" + paths[8];
-        if (!(securityContext.isUserInRole("thermostat-jvms-all") || securityContext.isUserInRole(jvmRole))) {
-            throw new NotAuthorizedException("Basic: realm=\"thermostat\"");
-        }
-    }
-}
--- a/thermostat-mongodb/core/src/main/java/com/redhat/thermostat/server/core/web/CoreServer.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.web;
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.Map;
-
-import javax.ws.rs.core.UriBuilder;
-
-import org.eclipse.jetty.server.Connector;
-import org.eclipse.jetty.server.HttpConfiguration;
-import org.eclipse.jetty.server.HttpConnectionFactory;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ServerConnector;
-import org.glassfish.jersey.jetty.JettyHttpContainerFactory;
-import org.glassfish.jersey.server.ResourceConfig;
-import org.glassfish.jersey.server.filter.RolesAllowedDynamicFeature;
-
-import com.redhat.thermostat.server.core.internal.web.configuration.ServerConfiguration;
-import com.redhat.thermostat.server.core.internal.web.security.authentication.basic.BasicUserStore;
-import com.redhat.thermostat.server.core.internal.web.security.authentication.basic.BasicAuthFilter;
-import com.redhat.thermostat.server.core.internal.web.security.authentication.none.NoAuthFilter;
-import com.redhat.thermostat.server.core.internal.web.security.authentication.proxy.ProxyAuthFilter;
-import com.redhat.thermostat.server.core.internal.web.security.authorization.RoleAuthFilter;
-import com.redhat.thermostat.server.core.internal.storage.mongo.ThermostatMongoStorage;
-import com.redhat.thermostat.server.core.internal.web.http.NamespaceHttpHandler;
-import com.redhat.thermostat.server.core.internal.storage.mongo.handler.MongoStorageHandler;
-
-public class CoreServer {
-    private Server server;
-    private int port = 26000;
-
-    private static final String SWAGGER_WEB_PATH = "/apidocs";
-
-    public void buildServer(Map<String, String> serverConfig, Map<String, String> mongoConfig, Map<String, String> userConfig) {
-        URI baseUri = UriBuilder.fromUri("http://localhost").port(8090).build();
-
-        ResourceConfig resourceConfig = new ResourceConfig();
-        setupResourceConfig(serverConfig, userConfig, resourceConfig);
-
-        server = JettyHttpContainerFactory.createServer(baseUri, resourceConfig, false);
-
-        setupConnectors(serverConfig);
-
-        ThermostatMongoStorage.start(mongoConfig);
-    }
-
-    private void setupResourceConfig(Map<String, String> serverConfig, Map<String, String> userConfig, ResourceConfig resourceConfig) {
-        MongoStorageHandler storageHandler = new MongoStorageHandler();
-        resourceConfig.register(new NamespaceHttpHandler(storageHandler));
-        if (serverConfig.containsKey(ServerConfiguration.SECURITY_PROXY.toString()) &&
-                serverConfig.get(ServerConfiguration.SECURITY_PROXY.toString()).equals("true")) {
-            resourceConfig.register(new ProxyAuthFilter());
-        } else if (serverConfig.containsKey(ServerConfiguration.SECURITY_BASIC.toString()) &&
-                serverConfig.get(ServerConfiguration.SECURITY_BASIC.toString()).equals("true")) {
-            resourceConfig.register(new BasicAuthFilter(new BasicUserStore(userConfig)));
-        } else {
-            resourceConfig.register(new NoAuthFilter());
-        }
-
-        resourceConfig.register(new RolesAllowedDynamicFeature());
-        resourceConfig.register(new RoleAuthFilter());
-    }
-
-    private void setupConnectors(Map<String, String> serverConfig) {
-        server.setConnectors(new Connector[]{});
-        ServerConnector httpConnector = new ServerConnector(server);
-
-        if (serverConfig.containsKey(ServerConfiguration.SECURITY_PROXY.toString()) &&
-                serverConfig.get(ServerConfiguration.SECURITY_PROXY.toString()).equals("true")) {
-            HttpConfiguration httpConfig = new HttpConfiguration();
-            httpConfig.addCustomizer(new org.eclipse.jetty.server.ForwardedRequestCustomizer());
-
-            httpConnector.addConnectionFactory(new HttpConnectionFactory(httpConfig));
-        } else if (serverConfig.containsKey(ServerConfiguration.SECURITY_BASIC.toString()) &&
-                serverConfig.get(ServerConfiguration.SECURITY_BASIC.toString()).equals("true")) {
-            HttpConfiguration httpConfig = new HttpConfiguration();
-            httpConnector.addConnectionFactory(new HttpConnectionFactory(httpConfig));
-        } else {
-            HttpConfiguration httpConfig = new HttpConfiguration();
-            httpConnector.addConnectionFactory(new HttpConnectionFactory(httpConfig));
-        }
-
-        try {
-            URL url = new URL(serverConfig.get(ServerConfiguration.URL.toString()));
-            httpConnector.setHost(url.getHost());
-            port = url.getPort();
-            httpConnector.setPort(port);
-        } catch (MalformedURLException e) {
-            httpConnector.setHost("localhost");
-            httpConnector.setPort(port);
-        }
-
-        httpConnector.setIdleTimeout(30000);
-
-        server.addConnector(httpConnector);
-    }
-
-    public Server getServer() {
-        return server;
-    }
-
-    public void finish() {
-        ThermostatMongoStorage.finish();
-        try {
-            server.stop();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    public int getPort() {
-        return port;
-    }
-}
--- a/thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/json/DocumentBuilderTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.json;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-import com.redhat.thermostat.server.core.internal.storage.mongo.response.DocumentBuilder;
-
-public class DocumentBuilderTest {
-    @Test
-    public void testAddTags() {
-        String content = "{\"a\":\"b\"}";
-        String[] tags = {"x", "y"};
-
-        String result = new DocumentBuilder(content).addTags(tags).build();
-
-        String expected = "{\"a\":\"b\",\"tags\":[\"admin\",\"x\",\"y\"]}";
-        assertEquals(expected, result);
-    }
-
-    @Test
-    public void testAddOneTag() {
-        String content = "{\"a\":\"b\"}";
-        String[] tags = {"x"};
-
-        String result = new DocumentBuilder(content).addTags(tags).build();
-
-        String expected = "{\"a\":\"b\",\"tags\":[\"admin\",\"x\"]}";
-        assertEquals(expected, result);
-    }
-
-    @Test
-    public void testAddZeroTags() {
-        String content = "{\"a\":\"b\"}";
-
-        String result = new DocumentBuilder(content).addTags().build();
-
-        String expected = "{\"a\":\"b\",\"tags\":[\"admin\"]}";
-        assertEquals(expected, result);
-    }
-}
--- a/thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/storage/mongo/response/MongoResponseBuilderTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.storage.mongo.response;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-import org.bson.Document;
-import org.bson.conversions.Bson;
-import org.junit.Test;
-
-import com.mongodb.Block;
-import com.mongodb.CursorType;
-import com.mongodb.Function;
-import com.mongodb.client.FindIterable;
-import com.mongodb.client.MongoCursor;
-import com.mongodb.client.MongoIterable;
-
-public class MongoResponseBuilderTest {
-
-    @Test
-    public void testBuildJsonResponseWithTime() {
-        String documents = "\"response\" : [\"hello\", \"blob\"]";
-        long elapsed = 10;
-        String output = MongoResponseBuilder.buildJsonResponseWithTime(documents, elapsed);
-
-        String expected = "{\"response\" : [\"hello\", \"blob\"],\"time\" : \"10\"}";
-        assertEquals(expected, output);
-    }
-
-    @Test
-    public void testBuildJsonDocument() {
-        Document d1 = Document.parse("{\"hello\" : \"blob\"}");
-        Document d2 = Document.parse("{\"a\" : {\"blob\" : [\"hi\"]}}");
-        final List<Document> list = new ArrayList<>();
-        list.add(d1);
-        list.add(d2);
-
-        FindIterable<Document> iterable = new TestFindIterable<>(list);
-
-        String output = MongoResponseBuilder.buildJsonDocuments(iterable);
-        String expected = "\"response\" : [{ \"hello\" : \"blob\" },{ \"a\" : { \"blob\" : [\"hi\"] } }]";
-        assertEquals(expected, output);
-    }
-
-    private class TestFindIterable<T> implements FindIterable<T> {
-
-        private final List<T> list;
-
-        public TestFindIterable(List<T> list) {
-            this.list = list;
-        }
-
-        @Override
-        public MongoCursor<T> iterator() {
-            return null;
-        }
-
-        @Override
-        public T first() {
-            return null;
-        }
-
-        @Override
-        public <U> MongoIterable<U> map(Function<T, U> mapper) {
-            return null;
-        }
-
-        @Override
-        public void forEach(Block<? super T> block) {
-            for (T item : list) {
-                block.apply(item);
-            }
-        }
-
-        @Override
-        public <A extends Collection<? super T>> A into(A target) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> filter(Bson filter) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> limit(int limit) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> skip(int skip) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> maxTime(long maxTime, TimeUnit timeUnit) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> maxAwaitTime(long maxAwaitTime, TimeUnit timeUnit) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> modifiers(Bson modifiers) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> projection(Bson projection) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> sort(Bson sort) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> noCursorTimeout(boolean noCursorTimeout) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> oplogReplay(boolean oplogReplay) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> partial(boolean partial) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> cursorType(CursorType cursorType) {
-            return null;
-        }
-
-        @Override
-        public FindIterable<T> batchSize(int batchSize) {
-            return null;
-        }
-    }
-}
--- a/thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/web/security/authentication/basic/BasicAuthFilterTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authentication.basic;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.ws.rs.NotAuthorizedException;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.SecurityContext;
-import javax.xml.bind.DatatypeConverter;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-
-public class BasicAuthFilterTest {
-
-    private BasicAuthFilter basicAuthFilter;
-    private ContainerRequestContext crq;
-    private final String userName = "user";
-
-
-    private final ArgumentCaptor<SecurityContext> sc = ArgumentCaptor.forClass(SecurityContext.class);
-
-    @Before
-    public void setup() {
-        String password = "password;";
-        String userInfo = password + ",a,b";
-
-        Map<String, String> entries = new HashMap<>();
-        entries.put(userName, userInfo);
-
-        crq = mock(ContainerRequestContext.class);
-
-        String authString = DatatypeConverter.printBase64Binary((userName + ":" + password).getBytes());
-        when(crq.getHeaderString(HttpHeaders.AUTHORIZATION)).thenReturn("Basic " + authString);
-
-        basicAuthFilter = new BasicAuthFilter(new BasicUserStore(entries));
-    }
-
-    @Test(expected = NotAuthorizedException.class)
-    public void testNoAuthHeader() throws IOException {
-        ContainerRequestContext crq = mock(ContainerRequestContext.class);
-        basicAuthFilter.filter(crq);
-    }
-
-    @Test(expected = NotAuthorizedException.class)
-    public void testInvalidAuthHeader() throws IOException {
-        ContainerRequestContext crq = mock(ContainerRequestContext.class);
-        String authString = DatatypeConverter.printBase64Binary("user:password".getBytes());
-        when(crq.getHeaderString(HttpHeaders.AUTHORIZATION)).thenReturn("NotBasic " + authString);
-        basicAuthFilter.filter(crq);
-    }
-
-    @Test(expected = NotAuthorizedException.class)
-    public void testInvalidUserPassHeader() throws IOException {
-        ContainerRequestContext crq = mock(ContainerRequestContext.class);
-        String authString = DatatypeConverter.printBase64Binary("blob".getBytes());
-        when(crq.getHeaderString(HttpHeaders.AUTHORIZATION)).thenReturn("Basic " + authString);
-        basicAuthFilter.filter(crq);
-    }
-
-
-    @Test(expected = NotAuthorizedException.class)
-    public void testUserNotInStore() throws IOException {
-        basicAuthFilter = new BasicAuthFilter(new BasicUserStore(Collections.EMPTY_MAP));
-        basicAuthFilter.filter(crq);
-    }
-
-    @Test(expected = NotAuthorizedException.class)
-    public void testIncorrectPassword() throws IOException {
-        ContainerRequestContext crq = mock(ContainerRequestContext.class);
-        String authString = DatatypeConverter.printBase64Binary((userName + ":badpassword").getBytes());
-        when(crq.getHeaderString(HttpHeaders.AUTHORIZATION)).thenReturn("Basic " + authString);
-        basicAuthFilter.filter(crq);
-    }
-
-    @Test
-    public void testGetUserPrincipalName() throws IOException {
-        basicAuthFilter.filter(crq);
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals(userName, sc.getValue().getUserPrincipal().getName());
-    }
-
-    @Test
-    public void testIsUserInRole() throws IOException {
-        basicAuthFilter.filter(crq);
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals(true, sc.getValue().isUserInRole("a"));
-        assertEquals(true, sc.getValue().isUserInRole("b"));
-    }
-
-    @Test
-    public void testIsUserNotInRole() throws IOException {
-        basicAuthFilter.filter(crq);
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals(false, sc.getValue().isUserInRole("unknown-role"));
-    }
-
-    @Test
-    public void testIsSecure() throws IOException {
-        basicAuthFilter.filter(crq);
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals(true, sc.getValue().isSecure());
-    }
-
-    @Test
-    public void testGetAuthenticationScheme() throws IOException {
-        basicAuthFilter.filter(crq);
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals("Basic", sc.getValue().getAuthenticationScheme());
-    }
-}
--- a/thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/web/security/authentication/basic/BasicUserStoreTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authentication.basic;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Test;
-
-public class BasicUserStoreTest {
-
-    @Test
-    public void testLoadBasicUser() {
-        String userName = "user";
-        String userInfo = "password,a,b";
-
-        Map<String,String> entries = new HashMap<>();
-        entries.put(userName, userInfo);
-
-        BasicUserStore userStore = new BasicUserStore(entries);
-
-        BasicWebUser user = userStore.getUser(userName);
-
-        assertTrue(user != null);
-
-        assertTrue(user.isUserInRole("a"));
-        assertTrue(user.isUserInRole("b"));
-        assertEquals(userName, user.getUsername());
-        assertEquals("password", user.getPassword());
-    }
-
-    @Test
-    public void testLoadMultipleBasicUser() {
-        Map<String,String> entries = new HashMap<>();
-        int num = 4;
-        for (int i = 0; i < num; i++) {
-            String userName = "user" + i;
-            String userInfo = "password" + i + ",a,b," + i;
-
-            entries.put(userName, userInfo);
-        }
-
-        BasicUserStore userStore = new BasicUserStore(entries);
-
-        for (int i = 0; i < num; i++) {
-            String userName = "user" + i;
-            String password = "password" + i;
-            BasicWebUser user = userStore.getUser(userName);
-
-            assertTrue(user != null);
-
-            assertTrue(user.isUserInRole("a"));
-            assertTrue(user.isUserInRole("b"));
-            assertTrue(user.isUserInRole(String.valueOf(i)));
-            assertEquals(userName, user.getUsername());
-            assertEquals(password, user.getPassword());
-        }
-    }
-}
--- a/thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/web/security/authentication/none/NoAuthFilterTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authentication.none;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
-import java.io.IOException;
-
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.core.SecurityContext;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-
-public class NoAuthFilterTest {
-
-    private ContainerRequestContext crq;
-    private final ArgumentCaptor<SecurityContext> sc = ArgumentCaptor.forClass(SecurityContext.class);
-    @Before
-    public void setup() throws IOException {
-        crq = mock(ContainerRequestContext.class);
-
-        NoAuthFilter noAuthFilter = new NoAuthFilter();
-        noAuthFilter.filter(crq);
-    }
-
-    @Test
-    public void testGetUserPrincipalName() {
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals("user", sc.getValue().getUserPrincipal().getName());
-    }
-
-    @Test
-    public void testIsUserInRole() {
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals(true, sc.getValue().isUserInRole("any-string-works"));
-    }
-
-    @Test
-    public void testIsSecure() {
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals(false, sc.getValue().isSecure());
-    }
-
-    @Test
-    public void testGetAuthenticationScheme() {
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals(null, sc.getValue().getAuthenticationScheme());
-    }
-}
--- a/thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/web/security/authentication/proxy/ProxyAuthFilterTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authentication.proxy;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import java.io.IOException;
-
-import javax.ws.rs.NotAuthorizedException;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.core.SecurityContext;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-
-public class ProxyAuthFilterTest {
-    private ProxyAuthFilter proxyAuthFilter;
-
-    private ContainerRequestContext crq;
-
-    private final String userName = "user";
-
-    private final ArgumentCaptor<SecurityContext> sc = ArgumentCaptor.forClass(SecurityContext.class);
-
-    @Before
-    public void setup() {
-        crq = mock(ContainerRequestContext.class);
-        when(crq.getHeaderString("X-SSSD-REMOTE-USER")).thenReturn(userName);
-        String groups = "a:b";
-        when(crq.getHeaderString("X-SSSD-REMOTE-USER-GROUPS")).thenReturn(groups);
-
-        proxyAuthFilter = new ProxyAuthFilter();
-    }
-
-    @Test (expected = NotAuthorizedException.class)
-    public void testNoUserHeader() throws IOException {
-        ContainerRequestContext crq = mock(ContainerRequestContext.class);
-        proxyAuthFilter.filter(crq);
-    }
-
-    @Test
-    public void testGetUserPrincipalName() throws IOException {
-        proxyAuthFilter.filter(crq);
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals(userName, sc.getValue().getUserPrincipal().getName());
-    }
-
-    @Test
-    public void testIsUserInRole() throws IOException {
-        proxyAuthFilter.filter(crq);
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals(true, sc.getValue().isUserInRole("a"));
-        assertEquals(true, sc.getValue().isUserInRole("b"));
-    }
-
-    @Test
-    public void testIsUserNotInRole() throws IOException {
-        proxyAuthFilter.filter(crq);
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals(false, sc.getValue().isUserInRole("unknown-role"));
-    }
-
-    @Test
-    public void testIsSecure() throws IOException {
-        proxyAuthFilter.filter(crq);
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals(true, sc.getValue().isSecure());
-    }
-
-    @Test
-    public void testGetAuthenticationScheme() throws IOException {
-        proxyAuthFilter.filter(crq);
-        verify(crq).setSecurityContext(sc.capture());
-
-        assertEquals("Proxy", sc.getValue().getAuthenticationScheme());
-    }
-}
--- a/thermostat-mongodb/core/src/test/java/com/redhat/thermostat/server/core/internal/web/security/authorization/RoleAuthFilterTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,286 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.core.internal.web.security.authorization;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.io.IOException;
-
-import javax.ws.rs.NotAuthorizedException;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.core.UriInfo;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class RoleAuthFilterTest {
-    private RoleAuthFilter roleAuthFilter;
-    private ContainerRequestContext containerRequestContext;
-    private UriInfo uriInfo;
-    private SecurityContext securityContext;
-
-    @Before
-    public void setup() {
-        containerRequestContext = mock(ContainerRequestContext.class);
-
-        uriInfo = mock(UriInfo.class);
-        when(containerRequestContext.getUriInfo()).thenReturn(uriInfo);
-
-        securityContext = mock(SecurityContext.class);
-        when(containerRequestContext.getSecurityContext()).thenReturn(securityContext);
-
-        roleAuthFilter = new RoleAuthFilter();
-    }
-
-    @Test
-    public void testAsAdmin() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/systems/all/agents/all/jvms/all");
-
-        when(securityContext.isUserInRole("thermostat-admin")).thenReturn(true);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test (expected = NotAuthorizedException.class)
-    public void testAsNone() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/systems/all/agents/all/jvms/all");
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test
-    public void testAsNoneBase() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100");
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test
-    public void testNamespacesAll() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/any/systems");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-all")).thenReturn(true);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test(expected = NotAuthorizedException.class)
-    public void testNamespacesNone() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/any/systems");
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test
-    public void testNamespacesSpecificYes() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/specific/systems");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-namespaces-specific")).thenReturn(true);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test (expected = NotAuthorizedException.class)
-    public void testNamespacesSpecificNo() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/specific/systems");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-namespaces-specific")).thenReturn(false);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test
-    public void testSystemsAll() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/any/systems/all");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-all")).thenReturn(true);
-        when(securityContext.isUserInRole("thermostat-systems-all")).thenReturn(true);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test(expected = NotAuthorizedException.class)
-    public void testSystemsNone() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/any/systems/all");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-all")).thenReturn(true);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test
-    public void testSystemsSpecificYes() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/specific/systems/specific");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-all")).thenReturn(true);
-
-        when(securityContext.isUserInRole("thermostat-systems-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-systems-specific")).thenReturn(true);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test (expected = NotAuthorizedException.class)
-    public void testSystemsSpecificNo() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/specific/systems/specific");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-specific")).thenReturn(true);
-
-        when(securityContext.isUserInRole("thermostat-systems-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-systems-specific")).thenReturn(false);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test
-    public void testAgentsAll() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/any/systems/all/agents/all");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-all")).thenReturn(true);
-        when(securityContext.isUserInRole("thermostat-systems-all")).thenReturn(true);
-        when(securityContext.isUserInRole("thermostat-agents-all")).thenReturn(true);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test(expected = NotAuthorizedException.class)
-    public void testAgentsNone() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/any/systems/all/agents/all");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-all")).thenReturn(true);
-        when(securityContext.isUserInRole("thermostat-systems-all")).thenReturn(true);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test
-    public void testAgentsSpecificYes() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/specific/systems/specific/agents/specific");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-all")).thenReturn(true);
-
-        when(securityContext.isUserInRole("thermostat-systems-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-systems-specific")).thenReturn(true);
-
-        when(securityContext.isUserInRole("thermostat-agents-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-agents-specific")).thenReturn(true);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test (expected = NotAuthorizedException.class)
-    public void testAgentsSpecificNo() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/specific/systems/specific/agents/specific");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-specific")).thenReturn(true);
-
-        when(securityContext.isUserInRole("thermostat-systems-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-systems-specific")).thenReturn(true);
-
-        when(securityContext.isUserInRole("thermostat-agents-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-agents-specific")).thenReturn(false);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test
-    public void testJvmsAll() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/any/systems/all/agents/all/jvms/all");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-all")).thenReturn(true);
-        when(securityContext.isUserInRole("thermostat-systems-all")).thenReturn(true);
-        when(securityContext.isUserInRole("thermostat-agents-all")).thenReturn(true);
-        when(securityContext.isUserInRole("thermostat-jvms-all")).thenReturn(true);
-
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test(expected = NotAuthorizedException.class)
-    public void testJvmsNone() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/any/systems/all/agents/all/jvms/all");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-all")).thenReturn(true);
-        when(securityContext.isUserInRole("thermostat-systems-all")).thenReturn(true);
-        when(securityContext.isUserInRole("thermostat-agents-all")).thenReturn(true);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test
-    public void testJvmsSpecificYes() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/specific/systems/specific/agents/specific/jvms/specific");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-all")).thenReturn(true);
-
-        when(securityContext.isUserInRole("thermostat-systems-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-systems-specific")).thenReturn(true);
-
-        when(securityContext.isUserInRole("thermostat-agents-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-agents-specific")).thenReturn(true);
-
-
-        when(securityContext.isUserInRole("thermostat-jvms-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-jvms-specific")).thenReturn(true);
-
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-
-    @Test (expected = NotAuthorizedException.class)
-    public void testJvmsSpecificNo() throws IOException {
-        when(uriInfo.getPath()).thenReturn("/api/v100/specific/systems/specific/agents/specific/jvms/specific");
-
-        when(securityContext.isUserInRole("thermostat-namespaces-specific")).thenReturn(true);
-
-        when(securityContext.isUserInRole("thermostat-systems-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-systems-specific")).thenReturn(true);
-
-        when(securityContext.isUserInRole("thermostat-agents-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-agents-specific")).thenReturn(true);
-
-
-        when(securityContext.isUserInRole("thermostat-agents-all")).thenReturn(false);
-        when(securityContext.isUserInRole("thermostat-agents-specific")).thenReturn(false);
-
-        roleAuthFilter.filter(containerRequestContext);
-    }
-}
--- a/thermostat-mongodb/distribution/pom.xml	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright 2012-2017 Red Hat, Inc.
-
- This file is part of Thermostat.
-
- Thermostat is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- Thermostat is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Thermostat; see the file COPYING.  If not see
- <http://www.gnu.org/licenses/>.
-
- Linking this code with other modules is making a combined work
- based on this code.  Thus, the terms and conditions of the GNU
- General Public License cover the whole combination.
-
- As a special exception, the copyright holders of this code give
- you permission to link this code with independent modules to
- produce an executable, regardless of the license terms of these
- independent modules, and to copy and distribute the resulting
- executable under terms of your choice, provided that you also
- meet, for each linked independent module, the terms and conditions
- of the license of that module.  An independent module is a module
- which is not derived from or based on this code.  If you modify
- this code, you may extend this exception to your version of the
- library, but you are not obligated to do so.  If you do not wish
- to do so, delete this exception statement from your version.
-
--->
-<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">
-    <parent>
-        <artifactId>thermostat-mongodb-gateway</artifactId>
-        <groupId>com.redhat.thermostat</groupId>
-        <version>1.99.12-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>thermostat-mongodb-gateway-distribution</artifactId>
-    <name>Thermostat Mongodb Gateway Distribution</name>
-
-    <packaging>jar</packaging>
-
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>2.4</version>
-                <configuration>
-                    <descriptor>src/assembly/src.xml</descriptor>
-                    <archive>
-                        <manifest>
-                            <mainClass>com.redhat.thermostat.server.command.WebServerCommand</mainClass>
-                        </manifest>
-                    </archive>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>assemble-jar</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.7</source>
-                    <target>1.7</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-    <dependencies>
-        <dependency>
-            <groupId>com.redhat.thermostat</groupId>
-            <artifactId>thermostat-mongodb-gateway-command</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.redhat.thermostat</groupId>
-            <artifactId>thermostat-mongodb-gateway-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-</project>
--- a/thermostat-mongodb/distribution/src/assembly/src.xml	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright 2012-2017 Red Hat, Inc.
-
- This file is part of Thermostat.
-
- Thermostat is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- Thermostat is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Thermostat; see the file COPYING.  If not see
- <http://www.gnu.org/licenses/>.
-
- Linking this code with other modules is making a combined work
- based on this code.  Thus, the terms and conditions of the GNU
- General Public License cover the whole combination.
-
- As a special exception, the copyright holders of this code give
- you permission to link this code with independent modules to
- produce an executable, regardless of the license terms of these
- independent modules, and to copy and distribute the resulting
- executable under terms of your choice, provided that you also
- meet, for each linked independent module, the terms and conditions
- of the license of that module.  An independent module is a module
- which is not derived from or based on this code.  If you modify
- this code, you may extend this exception to your version of the
- library, but you are not obligated to do so.  If you do not wish
- to do so, delete this exception statement from your version.
-
--->
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
-    <id>assemble-jar</id>
-    <formats>
-        <format>jar</format>
-    </formats>
-    <includeBaseDirectory>false</includeBaseDirectory>
-    <dependencySets>
-        <dependencySet>
-            <outputDirectory>/</outputDirectory>
-            <useProjectArtifact>true</useProjectArtifact>
-            <unpack>true</unpack>
-            <scope>runtime</scope>
-        </dependencySet>
-    </dependencySets>
-</assembly>
-
--- a/thermostat-mongodb/distribution/src/config/basic-config.properties	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-admin=password,thermostat-admin
\ No newline at end of file
--- a/thermostat-mongodb/distribution/src/config/mongo-config.properties	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-MONGO_URL=mongodb://127.0.0.1:27518
-MONGO_DB=thermostat
-MONGO_USERNAME=mongodevuser
-MONGO_PASSWORD=mongodevpassword
\ No newline at end of file
--- a/thermostat-mongodb/distribution/src/config/server-config.properties	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-URL=http://localhost:8090
-SECURITY_PROXY=true
-SWAGGER_UI_ENABLED=false
\ No newline at end of file
--- a/thermostat-mongodb/license/header.txt	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-Copyright 2012-2017 Red Hat, Inc.
-
-This file is part of Thermostat.
-
-Thermostat is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published
-by the Free Software Foundation; either version 2, or (at your
-option) any later version.
-
-Thermostat is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Thermostat; see the file COPYING.  If not see
-<http://www.gnu.org/licenses/>.
-
-Linking this code with other modules is making a combined work
-based on this code.  Thus, the terms and conditions of the GNU
-General Public License cover the whole combination.
-
-As a special exception, the copyright holders of this code give
-you permission to link this code with independent modules to
-produce an executable, regardless of the license terms of these
-independent modules, and to copy and distribute the resulting
-executable under terms of your choice, provided that you also
-meet, for each linked independent module, the terms and conditions
-of the license of that module.  An independent module is a module
-which is not derived from or based on this code.  If you modify
-this code, you may extend this exception to your version of the
-library, but you are not obligated to do so.  If you do not wish
-to do so, delete this exception statement from your version.
--- a/thermostat-mongodb/license/thermostat-java.xml	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright 2012-2017 Red Hat, Inc.
-
- This file is part of Thermostat.
-
- Thermostat is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- Thermostat is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Thermostat; see the file COPYING.  If not see
- <http://www.gnu.org/licenses/>.
-
- Linking this code with other modules is making a combined work
- based on this code.  Thus, the terms and conditions of the GNU
- General Public License cover the whole combination.
-
- As a special exception, the copyright holders of this code give
- you permission to link this code with independent modules to
- produce an executable, regardless of the license terms of these
- independent modules, and to copy and distribute the resulting
- executable under terms of your choice, provided that you also
- meet, for each linked independent module, the terms and conditions
- of the license of that module.  An independent module is a module
- which is not derived from or based on this code.  If you modify
- this code, you may extend this exception to your version of the
- library, but you are not obligated to do so.  If you do not wish
- to do so, delete this exception statement from your version.
-
--->
-<additionalHeaders>
-    <thermostat_java_style>
-        <firstLine>/*</firstLine>
-        <beforeEachLine> * </beforeEachLine>
-        <endLine> */EOL</endLine>
-        <afterEachLine>EOL</afterEachLine>
-        <!--skipLine></skipLine-->
-        <firstLineDetectionPattern>(\s|\t)*/\*.*$</firstLineDetectionPattern>
-        <lastLineDetectionPattern>.*\*/(\s|\t)*$</lastLineDetectionPattern>
-        <allowBlankLines>false</allowBlankLines>
-        <isMultiline>true</isMultiline>
-        <padLines>false</padLines>
-    </thermostat_java_style>
-</additionalHeaders>
--- a/thermostat-mongodb/license/thermostat-xml.xml	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright 2012-2017 Red Hat, Inc.
-
- This file is part of Thermostat.
-
- Thermostat is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- Thermostat is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Thermostat; see the file COPYING.  If not see
- <http://www.gnu.org/licenses/>.
-
- Linking this code with other modules is making a combined work
- based on this code.  Thus, the terms and conditions of the GNU
- General Public License cover the whole combination.
-
- As a special exception, the copyright holders of this code give
- you permission to link this code with independent modules to
- produce an executable, regardless of the license terms of these
- independent modules, and to copy and distribute the resulting
- executable under terms of your choice, provided that you also
- meet, for each linked independent module, the terms and conditions
- of the license of that module.  An independent module is a module
- which is not derived from or based on this code.  If you modify
- this code, you may extend this exception to your version of the
- library, but you are not obligated to do so.  If you do not wish
- to do so, delete this exception statement from your version.
-
--->
-<additionalHeaders>
-    <thermostat_xml_style>
-        <firstLine><![CDATA[<!--EOL]]></firstLine>
-        <beforeEachLine> </beforeEachLine>
-        <endLine><![CDATA[EOL-->]]></endLine>
-        <!--afterEachLine></afterEachLine-->
-        <skipLine><![CDATA[^<\?xml.*>$]]></skipLine>
-        <firstLineDetectionPattern><![CDATA[(\s|\t)*<!--.*$]]></firstLineDetectionPattern>
-        <lastLineDetectionPattern><![CDATA[.*-->(\s|\t)*$]]></lastLineDetectionPattern>
-        <allowBlankLines>false</allowBlankLines>
-        <isMultiline>true</isMultiline>
-        <padLines>false</padLines>
-    </thermostat_xml_style>
-</additionalHeaders>
--- a/thermostat-mongodb/pom.xml	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright 2012-2017 Red Hat, Inc.
-
- This file is part of Thermostat.
-
- Thermostat is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- Thermostat is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Thermostat; see the file COPYING.  If not see
- <http://www.gnu.org/licenses/>.
-
- Linking this code with other modules is making a combined work
- based on this code.  Thus, the terms and conditions of the GNU
- General Public License cover the whole combination.
-
- As a special exception, the copyright holders of this code give
- you permission to link this code with independent modules to
- produce an executable, regardless of the license terms of these
- independent modules, and to copy and distribute the resulting
- executable under terms of your choice, provided that you also
- meet, for each linked independent module, the terms and conditions
- of the license of that module.  An independent module is a module
- which is not derived from or based on this code.  If you modify
- this code, you may extend this exception to your version of the
- library, but you are not obligated to do so.  If you do not wish
- to do so, delete this exception statement from your version.
-
--->
-<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>
-
-    <groupId>com.redhat.thermostat</groupId>
-    <artifactId>thermostat-mongodb-gateway</artifactId>
-    <packaging>pom</packaging>
-    <version>1.99.12-SNAPSHOT</version>
-
-    <name>Thermostat Mongodb Gateway</name>
-
-    <modules>
-        <module>command</module>
-        <module>core</module>
-        <module>distribution</module>
-
-        <module>tests</module>
-    </modules>
-
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-
-        <java.version>1.7</java.version>
-
-        <jersey.version>2.24</jersey.version>
-        <jetty.version>9.2.19.v20160908</jetty.version>
-        <glassfish.version>2.5.0-b05</glassfish.version>
-        <mongo-java-driver.version>3.2.1</mongo-java-driver.version>
-        <gson.version>2.2.2</gson.version>
-
-        <junit.version>4.12</junit.version>
-        <mockito-core.version>2.7.11</mockito-core.version>
-        <swagger-jersey2-jaxrs.version>1.5.12</swagger-jersey2-jaxrs.version>
-
-	<license.skip>false</license.skip>
-
-	<maven.itest.skip>false</maven.itest.skip>
-	<maven.ptest.skip>true</maven.ptest.skip>
-    </properties>
-
-    <build>
-        <pluginManagement>
-            <plugins>
-                 <plugin>
-                    <groupId>org.apache.felix</groupId>
-                    <artifactId>maven-bundle-plugin</artifactId>
-                    <version>1.4.0</version>
-                </plugin>
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-assembly-plugin</artifactId>
-                    <version>2.3</version>
-                </plugin>
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-compiler-plugin</artifactId>
-                    <version>3.5.1</version>
-                    <configuration>
-                        <fork>true</fork>
-                        <meminitial>128m</meminitial>
-                        <maxmem>1024m</maxmem>
-                        <source>${java.version}</source>
-                        <target>${java.version}</target>
-                    </configuration>
-                </plugin>
-                <plugin>
-                    <groupId>com.mycila</groupId>
-                    <artifactId>license-maven-plugin</artifactId>
-                    <version>2.6</version>
-                    <inherited>false</inherited>
-                    <configuration>
-                        <skip>${license.skip}</skip>
-                        <headerDefinitions>
-                            <headerDefinition>license/thermostat-java.xml</headerDefinition>
-                            <headerDefinition>license/thermostat-xml.xml</headerDefinition>
-                        </headerDefinitions>
-                        <aggregate>true</aggregate>
-                        <mapping>
-                            <java>THERMOSTAT_JAVA_STYLE</java>
-                            <xml>THERMOSTAT_XML_STYLE</xml>
-                            <sh>SCRIPT_STYLE</sh>
-                        </mapping>
-                        <header>license/header.txt</header>
-                        <properties>
-                            <inceptionYear>${project.inceptionYear}</inceptionYear>
-                        </properties>
-                        <includes>
-                            <include>**/*.java</include>
-                            <include>**/*.xml</include>
-                            <include>**/*.sh</include>
-                        </includes>
-                        <excludes>
-                            <exclude>**/src/test/resources/**</exclude>
-                        </excludes>
-                    </configuration>
-                    <executions>
-                        <execution>
-                            <id>check-license</id>
-                            <phase>initialize</phase>
-                            <goals>
-                                <goal>check</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                </plugin>
-            </plugins>
-        </pluginManagement>
-    </build>
-</project>
--- a/thermostat-mongodb/tests/integration-tests/pom.xml	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright 2012-2017 Red Hat, Inc.
-
- This file is part of Thermostat.
-
- Thermostat is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- Thermostat is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Thermostat; see the file COPYING.  If not see
- <http://www.gnu.org/licenses/>.
-
- Linking this code with other modules is making a combined work
- based on this code.  Thus, the terms and conditions of the GNU
- General Public License cover the whole combination.
-
- As a special exception, the copyright holders of this code give
- you permission to link this code with independent modules to
- produce an executable, regardless of the license terms of these
- independent modules, and to copy and distribute the resulting
- executable under terms of your choice, provided that you also
- meet, for each linked independent module, the terms and conditions
- of the license of that module.  An independent module is a module
- which is not derived from or based on this code.  If you modify
- this code, you may extend this exception to your version of the
- library, but you are not obligated to do so.  If you do not wish
- to do so, delete this exception statement from your version.
-
--->
-<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>com.redhat.thermostat</groupId>
-        <artifactId>thermostat-mongodb-gateway-tests</artifactId>
-        <version>1.99.12-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>thermostat-mongodb-gateway-tests-integration</artifactId>
-
-    <packaging>jar</packaging>
-
-    <name>Thermostat Mongodb Gateway Integration Tests</name>
-
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-failsafe-plugin</artifactId>
-                <version>2.19.1</version>
-                <executions>
-                    <execution>
-                        <configuration>
-                            <redirectTestOutputToFile>true</redirectTestOutputToFile>
-                            <skip>${maven.itest.skip}</skip>
-                        </configuration>
-                        <goals>
-                            <goal>integration-test</goal>
-                            <goal>verify</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>3.0.2</version>
-                <configuration>
-                    <skipIfEmpty>true</skipIfEmpty>
-                </configuration>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>test-jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
-    <dependencies>
-        <!-- Thermostat Web Gateway dependencies -->
-        <dependency>
-            <groupId>com.redhat.thermostat</groupId>
-            <artifactId>thermostat-mongodb-gateway-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-         <!--test scoped deps-->
-        <dependency>
-            <groupId>com.redhat.thermostat</groupId>
-            <artifactId>thermostat-mongodb-gateway-tests-utils</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>${junit.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.eclipse.jetty</groupId>
-            <artifactId>jetty-client</artifactId>
-            <version>${jetty.version}</version>
-            <scope>test</scope>
-        </dependency>
-
-    </dependencies>
-
-</project>
-
--- a/thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/storage/ThermostatMongoStorageTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.storage;
-
-import static junit.framework.TestCase.assertFalse;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-
-import org.junit.Test;
-
-import com.redhat.thermostat.server.core.internal.storage.mongo.ThermostatMongoStorage;
-import com.redhat.thermostat.server.test.util.MongodTestUtil;
-
-public class ThermostatMongoStorageTest {
-
-    @Test
-    public void testNoStorage() {
-        ThermostatMongoStorage.start(MongodTestUtil.timeoutMongoConfiguration);
-
-        assertFalse(ThermostatMongoStorage.isConnected());
-
-        ThermostatMongoStorage.finish();
-    }
-
-    @Test
-    public void testStorage() throws IOException, InterruptedException {
-        MongodTestUtil mongodTestUtil = new MongodTestUtil();
-        mongodTestUtil.startMongod();
-
-        ThermostatMongoStorage.start(MongodTestUtil.mongoConfiguration);
-
-        assertTrue(mongodTestUtil.waitForMongodStart());
-        assertTrue(ThermostatMongoStorage.isConnected());
-
-        mongodTestUtil.stopMongod();
-
-        assertTrue(mongodTestUtil.waitForMongodStop());
-        assertEquals(0, mongodTestUtil.process.exitValue());
-
-        ThermostatMongoStorage.finish();
-        mongodTestUtil.finish();
-    }
-
-}
--- a/thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/CoreServerHttpTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.web;
-
-import static org.junit.Assert.assertTrue;
-
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-
-import javax.ws.rs.core.Response;
-
-import org.eclipse.jetty.client.api.ContentResponse;
-import org.eclipse.jetty.http.HttpMethod;
-import org.junit.Test;
-
-import com.redhat.thermostat.web.setup.CoreServerTestSetup;
-
-public class CoreServerHttpTest extends CoreServerTestSetup {
-    @Test
-    public void testGetSystems() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId";
-        ContentResponse response = client.newRequest(url).method(HttpMethod.GET).send();
-        assertTrue(response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
-    }
-
-    @Test
-    public void testGetAgents() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId/agents/agentId";
-        ContentResponse response = client.newRequest(url).method(HttpMethod.GET).send();
-        assertTrue(response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
-    }
-
-    @Test
-    public void testGetJvms() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId/agents/agentId/jvms/jvmId";
-        ContentResponse response = client.newRequest(url).method(HttpMethod.GET).send();
-        assertTrue(response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
-    }
-
-    @Test
-    public void testPutSystems() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId";
-        ContentResponse response = client.newRequest(url).method(HttpMethod.PUT).send();
-        assertTrue(response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
-    }
-
-    @Test
-    public void testPutAgents() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId/agents/agentId";
-        ContentResponse response = client.newRequest(url).method(HttpMethod.PUT).send();
-        assertTrue(response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
-    }
-
-    @Test
-    public void testPutJvms() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId/agents/agentId/jvms/jvmId";
-        ContentResponse response = client.newRequest(url).method(HttpMethod.PUT).send();
-        assertTrue(response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
-    }
-
-    @Test
-    public void testPostSystems() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId";
-        ContentResponse response = client.newRequest(url).method(HttpMethod.POST).send();
-        assertTrue(response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
-    }
-
-    @Test
-    public void testPostAgents() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId/agents/agentId";
-        ContentResponse response = client.newRequest(url).method(HttpMethod.POST).send();
-        assertTrue(response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
-    }
-
-    @Test
-    public void testPostJvms() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId/agents/agentId/jvms/jvmId";
-        ContentResponse response = client.newRequest(url).method(HttpMethod.POST).send();
-        assertTrue(response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
-    }
-
-    @Test
-    public void testDeleteSystems() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId";
-        ContentResponse response = client.newRequest(url).method(HttpMethod.DELETE).send();
-        assertTrue(response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
-    }
-
-    @Test
-    public void testDeleteAgents() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId/agents/agentId";
-        ContentResponse response = client.newRequest(url).method(HttpMethod.DELETE).send();
-        assertTrue(response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
-    }
-
-    @Test
-    public void testDeleteJvms() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId/agents/agentId/jvms/jvmId";
-        ContentResponse response = client.newRequest(url).method(HttpMethod.DELETE).send();
-        assertTrue(response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
-    }
-}
--- a/thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/DeleteMongoCoreServerTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.web;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-
-import javax.ws.rs.core.Response;
-
-import org.eclipse.jetty.client.api.ContentResponse;
-import org.eclipse.jetty.client.util.StringContentProvider;
-import org.eclipse.jetty.http.HttpMethod;
-import org.junit.Test;
-
-import com.redhat.thermostat.web.setup.MongoCoreServerTestSetup;
-
-public class DeleteMongoCoreServerTest extends MongoCoreServerTestSetup {
-    @Test
-    public void testDeleteAgents() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/DeleteAgents/systems/*/agents/agentId";
-        String input = "[{\"agentStuff\":\"a\"},{\"agentStuff\":\"b\"}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(input), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"a\", \"agentId\" : \"agentId\" },\\{ \"agentStuff\" : \"b\", \"agentId\" : \"agentId\" }],\"time\" : \"[0-9]*\"}"));
-
-        ContentResponse deleteResponse = client.newRequest(url).method(HttpMethod.DELETE).send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), deleteResponse.getStatus());
-        assertEquals("DELETE: true", deleteResponse.getContentAsString());
-
-        ContentResponse getAfterResponse = client.newRequest(url).method(HttpMethod.GET).send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getAfterResponse.getStatus());
-        assertTrue(getAfterResponse.getContentAsString().matches("\\{\"response\" : \\[],\"time\" : \"[0-9]*\"}"));
-    }
-    @Test
-    public void testDeleteSpecificAgents() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/DeleteSpecificAgents/systems/*/agents";
-
-        String oneUrl = url + "/one";
-        String twoUrl = url + "/two";
-        String allUrl = url + "/*";
-
-        String oneInput = "[{\"agentStuff\":\"a\"},{\"agentStuff\":\"b\"}]";
-        String twoInput = "[{\"otherStuff\":\"c\"},{\"otherStuff\":\"d\"}]";
-
-        ContentResponse postOneResponse = client.newRequest(oneUrl).method(HttpMethod.POST).content(new StringContentProvider(oneInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postOneResponse.getStatus());
-        assertEquals("POST: true", postOneResponse.getContentAsString());
-
-
-        ContentResponse postTwoResponse = client.newRequest(twoUrl).method(HttpMethod.POST).content(new StringContentProvider(twoInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postTwoResponse.getStatus());
-        assertEquals("POST: true", postTwoResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(allUrl).method(HttpMethod.GET).send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"a\", \"agentId\" : \"one\" },\\{ \"agentStuff\" : \"b\", \"agentId\" : \"one\" },\\{ \"otherStuff\" : \"c\", \"agentId\" : \"two\" },\\{ \"otherStuff\" : \"d\", \"agentId\" : \"two\" }],\"time\" : \"[0-9]*\"}"));
-
-        ContentResponse deleteResponse = client.newRequest(oneUrl).method(HttpMethod.DELETE).send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), deleteResponse.getStatus());
-        assertEquals("DELETE: true", deleteResponse.getContentAsString());
-
-        ContentResponse getAfterResponse = client.newRequest(allUrl).method(HttpMethod.GET).send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getAfterResponse.getStatus());
-        assertTrue(getAfterResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"otherStuff\" : \"c\", \"agentId\" : \"two\" },\\{ \"otherStuff\" : \"d\", \"agentId\" : \"two\" }],\"time\" : \"[0-9]*\"}"));
-    }
-    @Test
-    public void testDeleteQueries() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/testDeleteQueries/systems/*/agents/one";
-
-        String oneInput = "[{\"agentStuff\":\"a\", \"item\":1},{\"agentStuff\":\"b\", \"item\":2}]";
-
-        ContentResponse postOneResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(oneInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postOneResponse.getStatus());
-        assertEquals("POST: true", postOneResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"a\", \"item\" : 1, \"agentId\" : \"one\" },\\{ \"agentStuff\" : \"b\", \"item\" : 2, \"agentId\" : \"one\" }],\"time\" : \"[0-9]*\"}"));
-
-        ContentResponse deleteResponse = client.newRequest(url).method(HttpMethod.DELETE).param("q","item==1").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), deleteResponse.getStatus());
-        assertEquals("DELETE: true", deleteResponse.getContentAsString());
-
-        ContentResponse getAfterResponse = client.newRequest(url).method(HttpMethod.GET).send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getAfterResponse.getStatus());
-        assertTrue(getAfterResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"b\", \"item\" : 2, \"agentId\" : \"one\" }],\"time\" : \"[0-9]*\"}"));
-    }
-}
--- a/thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/GetMongoCoreServerTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.web;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-
-import javax.ws.rs.core.Response;
-
-import org.eclipse.jetty.client.api.ContentResponse;
-import org.eclipse.jetty.client.util.StringContentProvider;
-import org.eclipse.jetty.http.HttpMethod;
-import org.junit.Test;
-
-import com.redhat.thermostat.web.setup.MongoCoreServerTestSetup;
-
-public class GetMongoCoreServerTest extends MongoCoreServerTestSetup {
-    @Test
-    public void testGetSystems() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/GetSystems/systems/systemId";
-
-        String postInput = "[{\"systemStuff\":\"a\"},{\"systemStuff\":\"b\"}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(postInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).send();
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"systemStuff\" : \"a\", \"systemId\" : \"systemId\" },\\{ \"systemStuff\" : \"b\", \"systemId\" : \"systemId\" }],\"time\" : \"[0-9]*\"}"));
-    }
-
-    @Test
-    public void testGetAgents() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/GetAgents/systems/*/agents/agentId";
-        String postInput = "[{\"agentStuff\":\"a\"},{\"agentStuff\":\"b\"}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(postInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"a\", \"agentId\" : \"agentId\" },\\{ \"agentStuff\" : \"b\", \"agentId\" : \"agentId\" }],\"time\" : \"[0-9]*\"}"));
-    }
-
-    @Test
-    public void testGetAgentsLimit() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/GetAgentsLimit/systems/*/agents/agentId";
-        String postInput = "[{\"agentStuff\":\"a\"},{\"agentStuff\":\"b\"}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(postInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).param("l", "1").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"a\", \"agentId\" : \"agentId\" }],\"time\" : \"[0-9]*\"}"));
-    }
-
-    @Test
-    public void testGetAgentsQuery() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/GetAgentsQuery/systems/*/agents/agentId";
-        String postInput = "[{\"agentStuff\":\"a\"},{\"agentStuff\":\"b\"}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(postInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        ContentResponse getAResponse = client.newRequest(url).method(HttpMethod.GET).param("q", "agentStuff==a").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getAResponse.getStatus());
-        assertTrue(getAResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"a\", \"agentId\" : \"agentId\" }],\"time\" : \"[0-9]*\"}"));
-
-        ContentResponse getBResponse = client.newRequest(url).method(HttpMethod.GET).param("q", "agentStuff==b").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getBResponse.getStatus());
-        assertTrue(getBResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"b\", \"agentId\" : \"agentId\" }],\"time\" : \"[0-9]*\"}"));
-
-    }
-
-    @Test
-    public void testGetAgentsProject() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/GetAgentsProject/systems/*/agents/agentId";
-        String postInput = "[{\"agentStuff\":\"a\",\"otherStuff\":\"blob\"},{\"agentStuff\":\"b\",\"otherStuff\":\"blob\"}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(postInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).param("p", "agentStuff").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"a\" },\\{ \"agentStuff\" : \"b\" }],\"time\" : \"[0-9]*\"}"));
-    }
-
-    @Test
-    public void testGetAgentsNotEqual() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/GetAgentsNotEqual/systems/*/agents/agentId";
-        String postInput = "[{\"agentStuff\":\"a\"},{\"agentStuff\":\"b\"}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(postInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).param("q","agentStuff!=a").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"b\", \"agentId\" : \"agentId\" }],\"time\" : \"[0-9]*\"}"));
-    }
-
-    @Test
-    public void testGetAgentsSort() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/GetAgentsSort/systems/*/agents/agentId";
-        String postInput = "[{\"agentStuff\":\"a\"},{\"agentStuff\":\"b\"}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(postInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        ContentResponse sortDescResponse = client.newRequest(url).method(HttpMethod.GET).param("s", "-agentStuff").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), sortDescResponse.getStatus());
-        assertTrue(sortDescResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"b\", \"agentId\" : \"agentId\" },\\{ \"agentStuff\" : \"a\", \"agentId\" : \"agentId\" }],\"time\" : \"[0-9]*\"}"));
-
-        ContentResponse sortAsceResponse = client.newRequest(url).method(HttpMethod.GET).param("s", "+agentStuff").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), sortAsceResponse.getStatus());
-        assertTrue(sortAsceResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"a\", \"agentId\" : \"agentId\" },\\{ \"agentStuff\" : \"b\", \"agentId\" : \"agentId\" }],\"time\" : \"[0-9]*\"}"));
-    }
-
-    @Test
-    public void testGetAgentsLimitSort() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/GetAgentsSortLimit/systems/*/agents/agentId";
-        String postInput = "[{\"agentStuff\":\"a\"},{\"agentStuff\":\"b\"}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(postInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).param("l", "1").param("s", "-agentStuff").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"agentStuff\" : \"b\", \"agentId\" : \"agentId\" }],\"time\" : \"[0-9]*\"}"));
-    }
-
-    @Test
-    public void testGetJvms() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/GetJvms/systems/*/agents/*/jvms/jvmId";
-        String postInput = "[{\"jvmStuff\":\"a\"},{\"jvmStuff\":\"b\"}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(postInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"jvmStuff\" : \"a\", \"vmId\" : \"jvmId\" },\\{ \"jvmStuff\" : \"b\", \"vmId\" : \"jvmId\" }],\"time\" : \"[0-9]*\"}"));
-    }
-}
--- a/thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/PostMongoCoreServerTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.web;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-
-import javax.ws.rs.core.Response;
-
-import org.eclipse.jetty.client.api.ContentResponse;
-import org.eclipse.jetty.client.util.StringContentProvider;
-import org.eclipse.jetty.http.HttpMethod;
-import org.junit.Test;
-
-import com.redhat.thermostat.web.setup.MongoCoreServerTestSetup;
-
-public class PostMongoCoreServerTest extends MongoCoreServerTestSetup {
-    @Test
-    public void testPostAllSystems() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/testPostAllSystems/systems/*";
-
-        String putInput = "[{\"systemStuff\":\"a\"},{\"systemStuff\":\"b\"}]";
-        ContentResponse putResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(putInput), "application/json").send();
-
-        assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), putResponse.getStatus());
-        assertEquals("", putResponse.getContentAsString());
-    }
-
-    @Test
-    public void testPostAllAgents() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/testPostAllAgents/systems/systemId/agents/*";
-
-        String putInput = "[{\"agentStuff\":\"a\"},{\"agentStuff\":\"b\"}]";
-        ContentResponse putResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(putInput), "application/json").send();
-
-        assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), putResponse.getStatus());
-        assertEquals("", putResponse.getContentAsString());
-    }
-
-    @Test
-    public void testPostAllJvms() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/testPostAllJvms/systems/systemId/agents/agentId/jvms/*";
-
-        String putInput = "[{\"jvmStuff\":\"a\"},{\"jvmStuff\":\"b\"}]";
-        ContentResponse putResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(putInput), "application/json").send();
-
-        assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), putResponse.getStatus());
-        assertEquals("", putResponse.getContentAsString());
-    }
-}
--- a/thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/ProxyCoreServerTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.web;
-
-import static org.junit.Assert.assertEquals;
-
-import java.net.URISyntaxException;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-
-import javax.ws.rs.core.Response;
-
-import org.eclipse.jetty.client.api.ContentResponse;
-import org.eclipse.jetty.http.HttpMethod;
-import org.junit.Test;
-
-import com.redhat.thermostat.web.setup.ProxyCoreServerTestSetup;
-
-public class ProxyCoreServerTest extends ProxyCoreServerTestSetup {
-    @Test
-    public void testGetNoAuthHeader() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/namespace/systems/systemId";
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).send();
-
-        assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), getResponse.getStatus());
-    }
-
-    @Test
-    public void testGetNoGroups() throws InterruptedException, ExecutionException, TimeoutException, URISyntaxException {
-        String url = baseUrl + "/namespace/systems/systemId";
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).header("X-SSSD-REMOTE-USERS", "user").send();
-
-        assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), getResponse.getStatus());
-    }
-
-}
--- a/thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/PutMongoCoreServerTest.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.web;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-
-import javax.ws.rs.core.Response;
-
-import org.eclipse.jetty.client.api.ContentResponse;
-import org.eclipse.jetty.client.util.StringContentProvider;
-import org.eclipse.jetty.http.HttpMethod;
-import org.junit.Test;
-
-import com.redhat.thermostat.web.setup.MongoCoreServerTestSetup;
-
-public class PutMongoCoreServerTest extends MongoCoreServerTestSetup {
-    @Test
-    public void testPutNumber() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/testPutNumber/systems/systemId";
-
-        String postInput = "[{\"systemStuff\":\"a\", \"otherStuff\":10},{\"systemStuff\":\"b\", \"otherStuff\":30}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(postInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        String putInput = "{\"set\":{\"otherStuff\":20}}";
-        ContentResponse putResponse = client.newRequest(url).method(HttpMethod.PUT).content(new StringContentProvider(putInput), "application/json").param("q", "systemStuff==a").send();
-        assertEquals(Response.Status.OK.getStatusCode(), putResponse.getStatus());
-        assertEquals("PUT: true", putResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).send();
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"systemStuff\" : \"a\", \"otherStuff\" : 20, \"systemId\" : \"systemId\" },\\{ \"systemStuff\" : \"b\", \"otherStuff\" : 30, \"systemId\" : \"systemId\" }],\"time\" : \"[0-9]*\"}"));
-    }
-
-    @Test
-    public void testPutJsonObject() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/testPutJsonObject/systems/systemId";
-
-        String postInput = "[{\"systemStuff\":\"a\", \"otherStuff\":10},{\"systemStuff\":\"b\", \"otherStuff\":30}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(postInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        String putInput = "{\"set\":{\"otherStuff\":{\"item\":10}}}";
-        ContentResponse putResponse = client.newRequest(url).method(HttpMethod.PUT).content(new StringContentProvider(putInput), "application/json").param("q", "systemStuff==a").send();
-        assertEquals(Response.Status.OK.getStatusCode(), putResponse.getStatus());
-        assertEquals("PUT: true", putResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).send();
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-
-        System.out.println(getResponse.getContentAsString());
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"systemStuff\" : \"a\", \"otherStuff\" : \\{ \"item\" : 10 }, \"systemId\" : \"systemId\" },\\{ \"systemStuff\" : \"b\", \"otherStuff\" : 30, \"systemId\" : \"systemId\" }],\"time\" : \"[0-9]*\"}"));
-    }
-
-    @Test
-    public void testPutJsonArray() throws InterruptedException, ExecutionException, TimeoutException {
-        String url = baseUrl + "/testPutJsonArray/systems/systemId";
-
-        String postInput = "[{\"systemStuff\":\"a\", \"otherStuff\":10},{\"systemStuff\":\"b\", \"otherStuff\":30}]";
-        ContentResponse postResponse = client.newRequest(url).method(HttpMethod.POST).content(new StringContentProvider(postInput), "application/json").send();
-
-        assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
-        assertEquals("POST: true", postResponse.getContentAsString());
-
-        String putInput = "{\"set\":{\"otherStuff\":[{\"item\":10}]}}";
-        ContentResponse putResponse = client.newRequest(url).method(HttpMethod.PUT).content(new StringContentProvider(putInput), "application/json").param("q", "systemStuff==a").send();
-        assertEquals(Response.Status.OK.getStatusCode(), putResponse.getStatus());
-        assertEquals("PUT: true", putResponse.getContentAsString());
-
-        ContentResponse getResponse = client.newRequest(url).method(HttpMethod.GET).send();
-        assertEquals(Response.Status.OK.getStatusCode(), getResponse.getStatus());
-
-        assertTrue(getResponse.getContentAsString().matches("\\{\"response\" : \\[\\{ \"systemStuff\" : \"a\", \"otherStuff\" : \\[\\{ \"item\" : 10 }], \"systemId\" : \"systemId\" },\\{ \"systemStuff\" : \"b\", \"otherStuff\" : 30, \"systemId\" : \"systemId\" }],\"time\" : \"[0-9]*\"}"));
-    }
-}
--- a/thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/setup/CoreServerTestSetup.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.web.setup;
-
-import java.util.Collections;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.jetty.client.HttpClient;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-
-import com.redhat.thermostat.server.core.web.CoreServer;
-import com.redhat.thermostat.server.test.util.CoreServerTestUtil;
-import com.redhat.thermostat.server.test.util.MongodTestUtil;
-
-public class CoreServerTestSetup extends TimedTestSetup {
-    private static CoreServer coreServer;
-    protected static HttpClient client;
-    private static int port;
-    protected final String baseUrl = "http://localhost:" + port + "/api/v100";
-
-    private static Thread thread;
-    private static final AtomicBoolean ready = new AtomicBoolean(false);
-
-    @BeforeClass
-    public static void setupClassCoreServerTestSetup() throws Exception {
-        coreServer= new CoreServer();
-        coreServer.buildServer(CoreServerTestUtil.serverConfiguration, MongodTestUtil.timeoutMongoConfiguration, Collections.EMPTY_MAP);
-        thread = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    coreServer.getServer().start();
-                    ready.getAndSet(true);
-                    coreServer.getServer().join();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        });
-        thread.start();
-
-        client = new HttpClient();
-        client.start();
-
-        port = coreServer.getPort();
-    }
-
-    @AfterClass
-    public static void cleanupClassCoreServerTestSetup() throws Exception {
-        coreServer.finish();
-            client.stop();
-        thread.join();
-    }
-
-    @Before
-    public void setupCoreServerTestSetup() {
-        while (!ready.get()){
-        }
-    }
-}
--- a/thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/setup/MongoCoreServerTestSetup.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.web.setup;
-
-import java.util.Collections;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.jetty.client.HttpClient;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-
-import com.redhat.thermostat.server.core.web.CoreServer;
-import com.redhat.thermostat.server.test.util.CoreServerTestUtil;
-import com.redhat.thermostat.server.test.util.MongodTestUtil;
-
-public class MongoCoreServerTestSetup extends TimedTestSetup {
-    private static CoreServer coreServer;
-    protected static HttpClient client;
-    protected static String baseUrl;
-    private static final MongodTestUtil mongodTestUtil = new MongodTestUtil();
-
-
-    private static Thread thread;
-    private static final AtomicBoolean ready = new AtomicBoolean(false);
-
-    @BeforeClass
-    public static void beforeClassMongoCoreServerTestSetup() throws Exception {
-        ready.getAndSet(false);
-
-        mongodTestUtil.startMongod();
-        mongodTestUtil.waitForMongodStart();
-
-        coreServer= new CoreServer();
-        coreServer.buildServer(CoreServerTestUtil.serverConfiguration, MongodTestUtil.mongoConfiguration, Collections.EMPTY_MAP);
-        thread = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    coreServer.getServer().start();
-                    ready.getAndSet(true);
-                    coreServer.getServer().join();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        });
-        thread.start();
-
-        client = new HttpClient();
-        client.start();
-
-        baseUrl = "http://localhost:" + coreServer.getPort() + "/api/v100";
-
-        while (!ready.get()){
-            Thread.sleep(100L);
-        }
-    }
-
-    @AfterClass
-    public static void afterClassMongoCoreServerTestSetup() throws Exception {
-        coreServer.finish();
-        thread.join();
-
-        mongodTestUtil.stopMongod();
-        mongodTestUtil.waitForMongodStop();
-        mongodTestUtil.finish();
-    }
-
-    @Before
-    public void beforeMongoCoreServerTestSetup() throws InterruptedException {
-        while (!ready.get()){
-            Thread.sleep(100L);
-        }
-    }
-}
--- a/thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/setup/ProxyCoreServerTestSetup.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.web.setup;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.jetty.client.HttpClient;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-
-import com.redhat.thermostat.server.core.internal.web.configuration.ServerConfiguration;
-import com.redhat.thermostat.server.core.web.CoreServer;
-import com.redhat.thermostat.server.test.util.CoreServerTestUtil;
-import com.redhat.thermostat.server.test.util.MongodTestUtil;
-
-public class ProxyCoreServerTestSetup extends TimedTestSetup {
-    private static CoreServer coreServer;
-    protected static HttpClient client;
-    private static int port;
-    protected final String baseUrl = "http://localhost:" + port + "/api/v100";
-
-    private static Thread thread;
-    private static final AtomicBoolean ready = new AtomicBoolean(false);
-
-    @BeforeClass
-    public static void setupClassProxyCoreServerTestSetup() throws Exception {
-        Map<String, String> serverConfig = new HashMap<>(CoreServerTestUtil.serverConfiguration);
-        serverConfig.put(ServerConfiguration.SECURITY_PROXY.toString(), "true");
-
-        coreServer= new CoreServer();
-        coreServer.buildServer(serverConfig, MongodTestUtil.timeoutMongoConfiguration, Collections.EMPTY_MAP);
-        thread = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    coreServer.getServer().start();
-                    ready.getAndSet(true);
-                    coreServer.getServer().join();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        });
-        thread.start();
-
-        client = new HttpClient();
-        client.start();
-
-        port = coreServer.getPort();
-    }
-
-    @AfterClass
-    public static void cleanupClassProxyCoreServerTestSetup() throws Exception {
-        coreServer.finish();
-        thread.join();
-    }
-
-    @Before
-    public void setupProxyCoreServerTestSetup() {
-        while (!ready.get()){
-        }
-    }
-}
--- a/thermostat-mongodb/tests/integration-tests/src/test/java/com/redhat/thermostat/web/setup/TimedTestSetup.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.web.setup;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.junit.AfterClass;
-
-public class TimedTestSetup {
-    protected static final Map<String, List<Long>> times = new HashMap<>();
-
-    @AfterClass
-    public static void afterClassTimedTestSetup() throws Exception {
-        if (times.size() > 0) {
-            for (Map.Entry<String, List<Long>> time : times.entrySet()) {
-                List<Long> values = time.getValue();
-                double sum = 0;
-                long max = values.get(0);
-                long min = max;
-                for (long t : values) {
-                    sum += t;
-                    if (max < t) {
-                        max = t;
-                    }
-                    if (min > t) {
-                        min = t;
-                    }
-                }
-                double average = (sum - max - min) / values.size();
-
-                System.out.println(time.getKey());
-                System.out.println("Average: " + (long) average);
-                System.out.println("Max: " + max);
-                System.out.println("Min: " + min);
-                System.out.println("Sum: " + (long) sum);
-                System.out.println();
-            }
-        }
-
-    }
-}
--- a/thermostat-mongodb/tests/pom.xml	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright 2012-2017 Red Hat, Inc.
-
- This file is part of Thermostat.
-
- Thermostat is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- Thermostat is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Thermostat; see the file COPYING.  If not see
- <http://www.gnu.org/licenses/>.
-
- Linking this code with other modules is making a combined work
- based on this code.  Thus, the terms and conditions of the GNU
- General Public License cover the whole combination.
-
- As a special exception, the copyright holders of this code give
- you permission to link this code with independent modules to
- produce an executable, regardless of the license terms of these
- independent modules, and to copy and distribute the resulting
- executable under terms of your choice, provided that you also
- meet, for each linked independent module, the terms and conditions
- of the license of that module.  An independent module is a module
- which is not derived from or based on this code.  If you modify
- this code, you may extend this exception to your version of the
- library, but you are not obligated to do so.  If you do not wish
- to do so, delete this exception statement from your version.
-
--->
-<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>com.redhat.thermostat</groupId>
-        <artifactId>thermostat-mongodb-gateway</artifactId>
-        <version>1.99.12-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>thermostat-mongodb-gateway-tests</artifactId>
-    <packaging>pom</packaging>
-
-    <name>Thermostat Mongodb Gateway Tests</name>
-
-    <modules>
-        <module>integration-tests</module>
-        <module>test-utils</module>
-    </modules>
-
-</project>
-
--- a/thermostat-mongodb/tests/test-utils/pom.xml	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright 2012-2017 Red Hat, Inc.
-
- This file is part of Thermostat.
-
- Thermostat is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- Thermostat is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Thermostat; see the file COPYING.  If not see
- <http://www.gnu.org/licenses/>.
-
- Linking this code with other modules is making a combined work
- based on this code.  Thus, the terms and conditions of the GNU
- General Public License cover the whole combination.
-
- As a special exception, the copyright holders of this code give
- you permission to link this code with independent modules to
- produce an executable, regardless of the license terms of these
- independent modules, and to copy and distribute the resulting
- executable under terms of your choice, provided that you also
- meet, for each linked independent module, the terms and conditions
- of the license of that module.  An independent module is a module
- which is not derived from or based on this code.  If you modify
- this code, you may extend this exception to your version of the
- library, but you are not obligated to do so.  If you do not wish
- to do so, delete this exception statement from your version.
-
--->
-<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">
-    <parent>
-        <artifactId>thermostat-mongodb-gateway-tests</artifactId>
-        <groupId>com.redhat.thermostat</groupId>
-        <version>1.99.12-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>thermostat-mongodb-gateway-tests-utils</artifactId>
-    <name>Thermostat Mongodb Gateway Test Utilities</name>
-    <packaging>jar</packaging>
-
-    <dependencies>
-        <!-- Thermostat Web Gateway dependencies -->
-        <dependency>
-            <groupId>com.redhat.thermostat</groupId>
-            <artifactId>thermostat-mongodb-gateway-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <!-- Jetty dependencies -->
-        <dependency>
-            <groupId>org.eclipse.jetty</groupId>
-            <artifactId>jetty-client</artifactId>
-            <version>${jetty.version}</version>
-        </dependency>
-    </dependencies>
-</project>
--- a/thermostat-mongodb/tests/test-utils/src/main/java/com/redhat/thermostat/server/test/util/CoreServerTestUtil.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.test.util;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import com.redhat.thermostat.server.core.internal.web.configuration.ServerConfiguration;
-
-public class CoreServerTestUtil {
-    public static final Map<String, String> serverConfiguration = new HashMap<>();
-
-    private static final String host = "127.0.0.1";
-    private static final int port = TestPortSetup.SERVER_PORT;
-
-    static {
-        serverConfiguration.put(ServerConfiguration.URL.toString(), "http://" + host + ":" + port);
-    }
-}
--- a/thermostat-mongodb/tests/test-utils/src/main/java/com/redhat/thermostat/server/test/util/MongodTestUtil.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.test.util;
-
-import java.io.IOException;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.bson.Document;
-
-import com.mongodb.MongoClient;
-import com.mongodb.ServerAddress;
-import com.redhat.thermostat.server.core.internal.storage.mongo.configuration.MongoConfiguration;
-
-public class MongodTestUtil {
-
-    public static final Map<String, String> mongoConfiguration = new HashMap<>();
-
-    public static final Map<String, String> timeoutMongoConfiguration = new HashMap<>();
-
-    private static final String host = "127.0.0.1";
-    private static final int port = TestPortSetup.MONGODB_PORT;
-
-    private MongoClient mongoClient;
-    private Path tempDbDir;
-    private Path tempLogFile;
-    public Process process;
-
-    static {
-        mongoConfiguration.put(MongoConfiguration.MONGO_URL.toString(), "mongodb://" + host + ":" + port);
-        mongoConfiguration.put(MongoConfiguration.MONGO_DB.toString(), "mongoConfig");
-
-        timeoutMongoConfiguration.put(MongoConfiguration.MONGO_URL.toString(), "mongodb://" + host + ":" + port);
-        timeoutMongoConfiguration.put(MongoConfiguration.MONGO_DB.toString(), "timeoutMongoConfig");
-        timeoutMongoConfiguration.put(MongoConfiguration.MONGO_SERVER_TIMEOUT.toString(), "0");
-    }
-
-
-    public void startMongod() throws IOException {
-        tempDbDir = Files.createTempDirectory("tms-mongo");
-        tempDbDir.toFile().deleteOnExit();
-        Files.createDirectories(tempDbDir.resolve("data/db"));
-        tempLogFile = tempDbDir.resolve("mongod.log");
-        tempLogFile.toFile().deleteOnExit();
-
-        String[] command = {"mongod", "--dbpath", tempDbDir.resolve("data/db").toAbsolutePath().toString(), "--port", String.valueOf(port), "--fork", "--logpath", tempLogFile.toAbsolutePath().toString()};
-        ProcessBuilder builder = new ProcessBuilder(command);
-        process = builder.start();
-
-        mongoClient = new MongoClient(new ServerAddress(host, port));
-    }
-
-    public void stopMongod() {
-        try {
-            mongoClient.getDatabase("admin").runCommand(new Document("shutdown", 1));
-        } catch (Exception ignored) {
-        }
-        mongoClient.close();
-        mongoClient = null;
-    }
-
-    public void finish() throws IOException {
-        Files.walkFileTree(tempDbDir, new SimpleFileVisitor<Path>() {
-            @Override
-            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
-                Files.delete(file);
-                return FileVisitResult.CONTINUE;
-            }
-
-            @Override
-            public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
-                Files.delete(dir);
-                return FileVisitResult.CONTINUE;
-            }
-
-        });
-    }
-
-    public boolean waitForMongodStart() throws IOException, InterruptedException {
-        return waitFor("waiting for connections on port");
-    }
-
-    public boolean waitForMongodStop() throws IOException, InterruptedException {
-        return waitFor("dbexit:  rc: 0");
-    }
-
-    private boolean waitFor(String match) throws IOException, InterruptedException {
-        final String[] s = new String[]{""};
-
-        for (int i = 0; i < 100; i++) {
-            if (Files.exists(tempLogFile) && !s[0].contains(match)) {
-                s[0] = new String(Files.readAllBytes(tempLogFile));
-            } else if (s[0].contains(match)) {
-                return true;
-            }
-            Thread.sleep(100L);
-        }
-        return false;
-    }
-}
--- a/thermostat-mongodb/tests/test-utils/src/main/java/com/redhat/thermostat/server/test/util/TestPortSetup.java	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright 2012-2017 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.server.test.util;
-
-class TestPortSetup {
-    public final static int MONGODB_PORT = 28000;
-    public final static int SERVER_PORT = 27000;
-}
--- a/thermostat-mongodb/v1.0.0.yaml	Thu Apr 27 08:46:56 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
-swagger: '2.0'
-info:
-  version: 1.0.0
-  title: Thermostat Mongodb Gateway API
-  license:
-    name: GPL v2 with Classpath Exception
-    url: 'http://www.gnu.org/licenses'
-consumes:
-  - application/json
-produces:
-  - application/json
-  - text/html; charset=utf-8
-basePath: /api/v100
-paths:
-  '/{namespace}/systems/{systemId}':
-    parameters:
-      - $ref: '#/parameters/namespace'
-      - $ref: '#/parameters/system-id'
-    get:
-      description: Get information with matching system id. Use '*' to match against all id's.
-      parameters:
-        - $ref: '#/parameters/limit'
-        - $ref: '#/parameters/offset'
-        - $ref: '#/parameters/sort'
-        - $ref: '#/parameters/query'
-        - $ref: '#/parameters/projection'        
-      responses:
-        '200':
-          description: OK
-          schema:
-            $ref: '#/definitions/system-info'
-    put:
-      description: Update information that matches query with input field, value pairs
-      parameters:
-        - $ref: '#/parameters/query'
-        - $ref: '#/parameters/put-body'
-      responses:
-        '200':
-          description: OK
-    post:
-      description: Add information with provided system id. Do not use '*' for systemId.
-      parameters:
-        - $ref: '#/parameters/system-info'
-      responses:
-        '200':
-          description: OK
-    delete:
-      description: Delete information with matching system id. Use '*' to match against all id's
-      parameters:
-        - $ref: '#/parameters/system-ids'
-      responses:
-        '200':
-          description: OK
-  '/{namespace}/systems/{systemId}/agents/{agentId}':
-    parameters:
-      - $ref: '#/parameters/namespace'
-      - $ref: '#/parameters/system-id'
-      - $ref: '#/parameters/agent-id'
-    get:
-      description: Get information with matching system/agent id. Use '*' to match against all id's.
-      parameters:
-        - $ref: '#/parameters/limit'
-        - $ref: '#/parameters/offset'
-        - $ref: '#/parameters/sort'
-        - $ref: '#/parameters/query'
-        - $ref: '#/parameters/projection'    
-      responses:
-        '200':
-          description: OK
-          schema:
-            $ref: '#/definitions/agent-info'
-        '401':
-          $ref: '#/responses/unauthorized'
-    put:
-      description: Update information that matches query with input field, value pairs
-      parameters:
-        - $ref: '#/parameters/query'
-        - $ref: '#/parameters/put-body'
-      responses:
-        '200':
-          description: OK
-    post:
-      description: Adds information with provided system/agent id. Do not use '*' for agentId.
-      parameters:
-        - $ref: '#/parameters/agent-info'
-      responses:
-        '200':
-          $ref: '#/responses/ok'
-    delete:
-      description: Delete information with matching system/agent id. Use '*' to match againts all id's
-      responses:
-        '200':
-          $ref: '#/responses/ok'
-  '/{namespace}/system/{systemId}/agents/{agentId}/jvms/{jvmId}':
-    parameters:
-      - $ref: '#/parameters/namespace'
-      - $ref: '#/parameters/system-id'
-      - $ref: '#/parameters/agent-id'
-      - $ref: '#/parameters/jvm-id'
-    get:
-      description: Get information with matching system/agent/jvm id. Use '*' to match against all id's.
-      parameters:
-        - $ref: '#/parameters/limit'
-        - $ref: '#/parameters/offset'
-        - $ref: '#/parameters/sort'
-        - $ref: '#/parameters/query'
-        - $ref: '#/parameters/projection'    
-      responses:
-        '200':
-          description: OK
-          schema:
-            $ref: '#/definitions/jvm-info'
-        '401':
-          $ref: '#/responses/unauthorized'
-    put:
-      description: Update information that matches query with input field, value pairs
-      parameters:
-        - $ref: '#/parameters/query'
-        - $ref: '#/parameters/put-body'
-      responses:
-        '200':
-          description: OK
-    post:
-      description: Adds information with provided system/agent/jvm id. Do not use '*' for jvmId.
-      parameters:
-        - $ref: '#/parameters/jvm-info'
-      responses:
-        '200':
-          $ref: '#/responses/ok'
-    delete:
-      description: Delete information with matching system id. Use '*' to match against all id's
-      responses:
-        '200':
-          $ref: '#/responses/ok'
-definitions:
-  system-info:
-    type: array
-    items:
-      type: object
-  agent-info:
-    type: array
-    items:
-      type: object
-  jvm-info:
-    type: array
-    items:
-      type: object
-  put-body:
-    type: object
-    properties:
-      "set":
-        type: object
-parameters:
-  namespace:
-    name: namespace
-    in: path
-    description: The namespace
-    type: string
-    required: true
-  system-ids:
-    name: systemIds
-    in: query
-    description: A list of system identities
-    type: string
-    required: true
-  system-id:
-    name: systemId
-    in: path
-    description: The system identity
-    type: string
-    required: true
-  agent-id:
-    name: agentId
-    in: path
-    description: The agent identity
-    type: string
-    required: true
-  jvm-id:
-    name: jvmId
-    in: path
-    description: The JVM identity
-    type: string
-    required: true
-  system-info:
-    name: systemInfo
-    in: body
-    description: The system information
-    required: true
-    schema:
-      $ref: '#/definitions/system-info'
-  agent-info:
-    name: agentInfo
-    in: body
-    description: The agent information
-    required: true
-    schema:
-      $ref: '#/definitions/agent-info'
-  jvm-info:
-    name: jvmInfo
-    in: body
-    description: The jvm information
-    required: true
-    schema:
-      $ref: '#/definitions/jvm-info'
-  put-body:
-    name: putBody
-    in: body
-    description: "The JSON object containing a 'set' object. This contains single item JSON objects that specify the field to replace and the JSON value to replace with. Example { \"set\" : { \"field\" : \"value\" }, {\"field2\":{\"object\":\"item\"}}}"
-    required: true
-    schema:
-      $ref: '#/definitions/put-body'
-  limit:
-    name: l
-    in: query
-    description: Limit of items to return. Example '1'
-    type: integer
-  offset:
-    name: o
-    in: query
-    description: Offset of items to return. Example '0'
-    type: integer
-  sort:
-    name: s
-    in: query
-    description: Sort string. Comma separated list of fields prefixed with '+' for ascending or '-' for descending. Example '?s=+a,-b' Fields use dot notation for embedded documents. Example 'outer.inner' refers to field inner contained in field outer.
-    type: string
-  query:
-    name: q
-    in: query
-    description: Query string. Comma separated list of key, comparator, value pairs. Comparator supports '==', '<=', '>=', '<', '>', '!='. Example '?q=a==b,c!=d'. Keys are fields in documents and use dot notation for embedded documents. Example 'outer.inner' refers to field inner contained in field outer.
-    type: string
-  projection:
-    name: p
-    in: query
-    description: Projection string. Comma separated list of fields to include in the response. Example '?p=a,b' Fields use dot notation for embedded documents. Example 'outer.inner' refers to field inner contained in field outer.
-    type: string
-responses:
-  ok:
-    description: OK
-  unauthorized:
-    description: Access prohibited.