changeset 225:631f6e045fe5

Move ArgumentRunnable to common-mongodb. Reviewed-by: jkang Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-August/024439.html
author Severin Gehwolf <sgehwolf@redhat.com>
date Fri, 04 Aug 2017 11:15:28 +0200
parents 99eebeb47f89
children bc1a040d8234
files common/core/src/main/java/com/redhat/thermostat/gateway/common/util/ArgumentRunnable.java common/mongodb/src/main/java/com/redhat/thermostat/gateway/common/mongodb/response/ArgumentRunnable.java common/mongodb/src/main/java/com/redhat/thermostat/gateway/common/mongodb/response/MongoResponseBuilder.java common/mongodb/src/test/java/com/redhat/thermostat/gateway/common/mongodb/response/MongoResponseBuilderTest.java services/jvms/src/main/java/com/redhat/thermostat/gateway/service/jvms/mongo/JvmInfoMongoStorageHandler.java
diffstat 5 files changed, 44 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/common/core/src/main/java/com/redhat/thermostat/gateway/common/util/ArgumentRunnable.java	Fri Aug 04 11:07:45 2017 +0200
+++ /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.gateway.common.util;
-
-public interface ArgumentRunnable<T> {
-    void run(T arg);
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/mongodb/src/main/java/com/redhat/thermostat/gateway/common/mongodb/response/ArgumentRunnable.java	Fri Aug 04 11:15:28 2017 +0200
@@ -0,0 +1,42 @@
+/*
+ * 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.gateway.common.mongodb.response;
+
+public interface ArgumentRunnable<T> {
+    void run(T arg);
+
+}
--- a/common/mongodb/src/main/java/com/redhat/thermostat/gateway/common/mongodb/response/MongoResponseBuilder.java	Fri Aug 04 11:07:45 2017 +0200
+++ b/common/mongodb/src/main/java/com/redhat/thermostat/gateway/common/mongodb/response/MongoResponseBuilder.java	Fri Aug 04 11:15:28 2017 +0200
@@ -45,7 +45,6 @@
 import com.mongodb.Block;
 import com.mongodb.client.FindIterable;
 import com.redhat.thermostat.gateway.common.mongodb.keycloak.KeycloakFields;
-import com.redhat.thermostat.gateway.common.util.ArgumentRunnable;
 
 /*
  *  Builds the appropriate response after executing the request's MongoDB Query.
--- a/common/mongodb/src/test/java/com/redhat/thermostat/gateway/common/mongodb/response/MongoResponseBuilderTest.java	Fri Aug 04 11:07:45 2017 +0200
+++ b/common/mongodb/src/test/java/com/redhat/thermostat/gateway/common/mongodb/response/MongoResponseBuilderTest.java	Fri Aug 04 11:15:28 2017 +0200
@@ -55,7 +55,6 @@
 import com.mongodb.client.FindIterable;
 import com.mongodb.client.MongoCursor;
 import com.mongodb.client.MongoIterable;
-import com.redhat.thermostat.gateway.common.util.ArgumentRunnable;
 
 public class MongoResponseBuilderTest {
 
--- a/services/jvms/src/main/java/com/redhat/thermostat/gateway/service/jvms/mongo/JvmInfoMongoStorageHandler.java	Fri Aug 04 11:07:45 2017 +0200
+++ b/services/jvms/src/main/java/com/redhat/thermostat/gateway/service/jvms/mongo/JvmInfoMongoStorageHandler.java	Fri Aug 04 11:15:28 2017 +0200
@@ -47,7 +47,6 @@
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -62,8 +61,8 @@
 import com.mongodb.util.JSON;
 import com.redhat.thermostat.gateway.common.mongodb.filters.MongoRequestFilters;
 import com.redhat.thermostat.gateway.common.mongodb.filters.MongoSortFilters;
+import com.redhat.thermostat.gateway.common.mongodb.response.ArgumentRunnable;
 import com.redhat.thermostat.gateway.common.mongodb.response.MongoResponseBuilder;
-import com.redhat.thermostat.gateway.common.util.ArgumentRunnable;
 
 public class JvmInfoMongoStorageHandler  {
 
@@ -73,6 +72,7 @@
     public void updateTimestamps(MongoCollection<Document> collection, String body, String systemId, Long timeStamp) {
         final Bson filter;
         if (body != null && body.length() > 0) {
+            @SuppressWarnings("unchecked")
             List<String> jvms = (List<String>) JSON.parse(body);
             List<Bson> jvmFilters = new ArrayList<>();
             for (String id : jvms) {