ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivasilin...@apache.org
Subject [35/39] incubator-ignite git commit: #ignite-964: GridJettyRestHandler code style.
Date Wed, 01 Jul 2015 10:14:11 GMT
#ignite-964: GridJettyRestHandler code style.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/990e5ece
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/990e5ece
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/990e5ece

Branch: refs/heads/ignite-964
Commit: 990e5ecee7e78ce0c6f0e3f6a0c5b839f8eb5ff2
Parents: bb412c4
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Wed Jul 1 12:46:35 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Wed Jul 1 12:46:35 2015 +0300

----------------------------------------------------------------------
 .../http/jetty/GridJettyRestHandler.java        | 95 +++++++++++++-------
 1 file changed, 61 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/990e5ece/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
----------------------------------------------------------------------
diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
index 55fe156..11059f3 100644
--- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
+++ b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
@@ -315,11 +315,14 @@ public class GridJettyRestHandler extends AbstractHandler {
         }
     }
 
+    /**
+     * @param cmd Rest command.
+     * @param cmdRes Rest response.
+     */
     private void createResponse(GridRestCommand cmd, GridRestResponse cmdRes) {
         if (cmd == CACHE_GET_ALL) {
-            if (cmdRes.getResponse() == null) {
+            if (cmdRes.getResponse() == null)
                 return;
-            }
 
             Map o = (Map)cmdRes.getResponse();
 
@@ -332,37 +335,6 @@ public class GridJettyRestHandler extends AbstractHandler {
         }
     }
 
-    public static class RestEntry {
-        private Object key;
-        private Object value;
-        public RestEntry(Object key, Object value) {
-            if (key instanceof JSONCacheObject)
-                this.key = ((JSONCacheObject)key).getFields();
-            else
-                this.key = key;
-
-            if (value instanceof JSONCacheObject)
-                this.value = ((JSONCacheObject)value).getFields();
-            else
-                this.value = value;
-        }
-        public Object getKey() {
-            return key;
-        }
-
-        public void setKey(Object key) {
-            this.key = key;
-        }
-
-        public Object getValue() {
-            return value;
-        }
-
-        public void setValue(Object value) {
-            this.value = value;
-        }
-    }
-
     /**
      * Creates REST request.
      *
@@ -804,7 +776,7 @@ public class GridJettyRestHandler extends AbstractHandler {
     private JSONObject parseRequest(HttpServletRequest req) throws IgniteCheckedException{
         StringBuilder builder = new StringBuilder();
 
-        Scanner reader = null;
+        Scanner reader;
 
         try {
             reader = new Scanner(req.getReader());
@@ -818,4 +790,59 @@ public class GridJettyRestHandler extends AbstractHandler {
 
         return JSONObject.fromObject(builder.toString());
     }
+
+    /**
+     * Rest entry.
+     */
+    public static class RestEntry {
+        /** Key. */
+        private Object key;
+
+        /** Value. */
+        private Object value;
+
+        /**
+         * @param key Key.
+         * @param val Value.
+         */
+        public RestEntry(Object key, Object val) {
+            if (key instanceof JSONCacheObject)
+                this.key = ((JSONCacheObject)key).getFields();
+            else
+                this.key = key;
+
+            if (val instanceof JSONCacheObject)
+                this.value = ((JSONCacheObject)val).getFields();
+            else
+                this.value = val;
+        }
+
+        /**
+         * @return Key.
+         */
+        public Object getKey() {
+            return key;
+        }
+
+        /**
+         * @param key Key.
+         */
+        public void setKey(Object key) {
+            this.key = key;
+        }
+
+        /**
+         * @return Value.
+         */
+        public Object getValue() {
+            return value;
+        }
+
+        /**
+         * @param val Value.
+         */
+        public void setValue(Object val) {
+            this.value = val;
+        }
+    }
 }


Mime
View raw message