Revert cloud sign-up response behavior 25/20225/2
authorJee Hyeok Kim <jihyeok13.kim@samsung.com>
Mon, 22 May 2017 08:22:57 +0000 (17:22 +0900)
committerJee Hyeok Kim <jihyeok13.kim@samsung.com>
Mon, 22 May 2017 08:34:39 +0000 (08:34 +0000)
1. Revert cloud behavior not to disconnect client
   after cloud sends sign-up response to client.

Change-Id: I367dfe4ebe16567ada67ae2f7aac8b8a4c0f5db2
Signed-off-by: Jee Hyeok Kim <jihyeok13.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20225
Reviewed-by: Uze Choi <uzchoi@samsung.com>
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/DeviceServerSystem.java

index 88ccf47..4bbde23 100644 (file)
@@ -67,8 +67,8 @@ import io.netty.channel.ChannelPromise;
 
 public class DeviceServerSystem extends ServerSystem {
 
-    private Cbor<HashMap<String, Object>>                 mCbor     = new Cbor<HashMap<String, Object>>();
-    private HashMap<ChannelHandlerContext, CoapSignaling> mCsmMap   = new HashMap<>();
+    private Cbor<HashMap<String, Object>>                 mCbor   = new Cbor<HashMap<String, Object>>();
+    private HashMap<ChannelHandlerContext, CoapSignaling> mCsmMap = new HashMap<>();
 
     /**
      *
@@ -179,14 +179,15 @@ public class DeviceServerSystem extends ServerSystem {
                         switch (coapRequest.getObserve()) {
                             case SUBSCRIBE:
                                 coapDevice.addObserveRequest(
-                                        Bytes.bytesToLong(coapRequest.getToken()),
+                                        Bytes.bytesToLong(
+                                                coapRequest.getToken()),
                                         coapRequest);
                                 coapDevice.addObserveChannel(targetChannel);
                                 break;
                             case UNSUBSCRIBE:
                                 coapDevice.removeObserveChannel(targetChannel);
-                                coapDevice.removeObserveRequest(
-                                        Bytes.bytesToLong(coapRequest.getToken()));
+                                coapDevice.removeObserveRequest(Bytes
+                                        .bytesToLong(coapRequest.getToken()));
                                 break;
                             default:
                                 break;
@@ -291,10 +292,11 @@ public class DeviceServerSystem extends ServerSystem {
             StringBuffer uriPath = new StringBuffer();
             uriPath.append("/" + Constants.PREFIX_OIC);
             uriPath.append("/" + Constants.DEVICE_PRESENCE_URI);
-            ConnectorPool.getConnection("rd").sendRequest(MessageBuilder.createRequest(
-                    RequestMethod.POST, uriPath.toString(), null,
-                    ContentFormat.APPLICATION_CBOR,
-                    cbor.encodingPayloadToCbor(payload)), null);
+            ConnectorPool.getConnection("rd")
+                    .sendRequest(MessageBuilder.createRequest(
+                            RequestMethod.POST, uriPath.toString(), null,
+                            ContentFormat.APPLICATION_CBOR,
+                            cbor.encodingPayloadToCbor(payload)), null);
         }
     }
 
@@ -334,11 +336,10 @@ public class DeviceServerSystem extends ServerSystem {
                 }
 
                 switch (urlPath) {
-
-                    case OICConstants.ACCOUNT_FULL_URI:
-                        ctx.writeAndFlush(msg);
-                        ctx.close();
-                        return;
+                    /*
+                     * case OICConstants.ACCOUNT_FULL_URI:
+                     * ctx.writeAndFlush(msg); ctx.close(); return;
+                     */
 
                     case OICConstants.ACCOUNT_SESSION_FULL_URI:
                         HashMap<String, Object> payloadData = mCbor