[IOT-1533] fixed KeepAlive resource for receiving PUT, POST Message
authorJung Seungho <shonest.jung@samsung.com>
Mon, 31 Oct 2016 00:58:36 +0000 (09:58 +0900)
committerJee Hyeok Kim <jihyeok13.kim@samsung.com>
Mon, 16 Jan 2017 11:29:00 +0000 (11:29 +0000)
Change-Id: Ie52fe040cd11319a34219efc942a2e102663ecba
Signed-off-by: Jung Seungho <shonest.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13847
Reviewed-by: Hyuna Jo <hyuna0213.jo@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jee Hyeok Kim <jihyeok13.kim@samsung.com>
(cherry picked from commit 40f1a0f47e270d611fc8349276a87daba8ec4a60)
Reviewed-on: https://gerrit.iotivity.org/gerrit/14553
Reviewed-by: Uze Choi <uzchoi@samsung.com>
(cherry picked from commit 7c1dd4e9bbdb5f0b6c39bec9f51515bd22aa379a)
Reviewed-on: https://gerrit.iotivity.org/gerrit/15301

cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/KeepAliveResource.java

index 5432f9a..8e89806 100644 (file)
@@ -67,11 +67,12 @@ public class KeepAliveResource extends Resource {
 
         switch (request.getMethod()) {
             case GET:
-                response = handleGetPingConfig(request);
+                response = handlePingConfig(request);
                 break;
 
             case PUT:
-                response = handlePutPingConfig(srcDevice, request);
+            case POST:
+                response = handlePingConfig(srcDevice, request);
                 break;
 
             default:
@@ -96,7 +97,7 @@ public class KeepAliveResource extends Resource {
      * @param request
      *            ChannelHandlerContext of request message
      */
-    private IResponse handleGetPingConfig(IRequest request) {
+    private IResponse handlePingConfig(IRequest request) {
 
         HashMap<String, int[]> payloadData = new HashMap<>();
         payloadData.put(Constants.REQ_PING_ARRAY, mIntervals);
@@ -106,7 +107,7 @@ public class KeepAliveResource extends Resource {
                 mCbor.encodingPayloadToCbor(payloadData));
     }
 
-    private IResponse handlePutPingConfig(Device srcDevice, IRequest request) {
+    private IResponse handlePingConfig(Device srcDevice, IRequest request) {
 
         HashMap<String, Object> payloadData = mCbor
                 .parsePayloadFromCbor(request.getPayload(), HashMap.class);