remove prefix .well-known uri & change from 'ocf' to 'oic' uri 81/10581/5
authoreunok.shin <eunok.shin@samsung.com>
Thu, 18 Aug 2016 05:43:49 +0000 (14:43 +0900)
committerJee Hyeok Kim <jihyeok13.kim@samsung.com>
Tue, 23 Aug 2016 09:05:34 +0000 (09:05 +0000)
Change-Id: I23cdfc7b86dd9576b96fe14841a2d7257b8fb29f
Signed-off-by: eunok.shin <eunok.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10581
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jee Hyeok Kim <jihyeok13.kim@samsung.com>
47 files changed:
cloud/account/src/main/java/org/iotivity/cloud/accountserver/Constants.java
cloud/account/src/main/java/org/iotivity/cloud/accountserver/resources/account/AccountResource.java
cloud/account/src/main/java/org/iotivity/cloud/accountserver/resources/account/session/SessionResource.java
cloud/account/src/main/java/org/iotivity/cloud/accountserver/resources/account/tokenrefresh/TokenRefreshResource.java
cloud/account/src/main/java/org/iotivity/cloud/accountserver/resources/acl/group/GroupResource.java
cloud/account/src/main/java/org/iotivity/cloud/accountserver/resources/acl/invite/InviteResource.java
cloud/account/src/main/java/org/iotivity/cloud/accountserver/resources/certificate/CertificateResource.java
cloud/account/src/test/java/org/iotivity/cloud/accountserver/resources/account/AccountResourceTest.java
cloud/account/src/test/java/org/iotivity/cloud/accountserver/resources/account/session/SessionResourceTest.java
cloud/account/src/test/java/org/iotivity/cloud/accountserver/resources/account/tokenrefresh/TokenRefreshResourceTest.java
cloud/account/src/test/java/org/iotivity/cloud/accountserver/resources/acl/group/GroupResourceTest.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/Constants.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/DeviceServerSystem.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/account/Account.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/account/AccountSession.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/account/Acl.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/account/AclGroup.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/account/AclInvite.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/account/Certificate.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/mq/MessageQueue.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/rd/DevicePresence.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/rd/ResourceDirectory.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/rd/ResourceFind.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/rd/ResourcePresence.java
cloud/interface/src/test/java/org/iotivity/cloud/ciserver/DeviceServerSystemTest.java
cloud/interface/src/test/java/org/iotivity/cloud/ciserver/resources/proxy/account/AccountSessionTest.java
cloud/interface/src/test/java/org/iotivity/cloud/ciserver/resources/proxy/account/AccountTest.java
cloud/interface/src/test/java/org/iotivity/cloud/ciserver/resources/proxy/account/AclGroupTest.java
cloud/interface/src/test/java/org/iotivity/cloud/ciserver/resources/proxy/account/AclInviteTest.java
cloud/interface/src/test/java/org/iotivity/cloud/ciserver/resources/proxy/account/AclTest.java
cloud/interface/src/test/java/org/iotivity/cloud/ciserver/resources/proxy/account/CertificateTest.java
cloud/interface/src/test/java/org/iotivity/cloud/ciserver/resources/proxy/mq/MessageQueueTest.java
cloud/interface/src/test/java/org/iotivity/cloud/ciserver/resources/proxy/rd/DevicePresenceTest.java
cloud/interface/src/test/java/org/iotivity/cloud/ciserver/resources/proxy/rd/ResourceDirectoryTest.java
cloud/interface/src/test/java/org/iotivity/cloud/ciserver/resources/proxy/rd/ResourceFindTest.java
cloud/interface/src/test/java/org/iotivity/cloud/ciserver/resources/proxy/rd/ResourcePresenceTest.java
cloud/messagequeue/src/main/java/org/iotivity/cloud/mqserver/Constants.java
cloud/messagequeue/src/main/java/org/iotivity/cloud/mqserver/resources/MQBrokerResource.java
cloud/messagequeue/src/test/java/org/iotivity/cloud/mqserver/resources/MQBrokerResourceTest.java
cloud/resourcedirectory/src/main/java/org/iotivity/cloud/rdserver/Constants.java
cloud/resourcedirectory/src/main/java/org/iotivity/cloud/rdserver/resources/presence/device/DevicePresenceResource.java
cloud/resourcedirectory/src/test/java/org/iotivity/cloud/testrdserver/RDServerTestUtils.java
cloud/stack/src/main/java/org/iotivity/cloud/base/OCFConstants.java [deleted file]
cloud/stack/src/main/java/org/iotivity/cloud/base/OICConstants.java [new file with mode: 0755]
cloud/stack/src/main/java/org/iotivity/cloud/base/connector/CoapClient.java
cloud/stack/src/main/java/org/iotivity/cloud/base/connector/CoapConnector.java
cloud/stack/src/main/java/org/iotivity/cloud/base/server/Server.java

index f53de46..791fea1 100755 (executable)
@@ -21,9 +21,9 @@
  */
 package org.iotivity.cloud.accountserver;
 
-import org.iotivity.cloud.base.OCFConstants;
+import org.iotivity.cloud.base.OICConstants;
 
-public class Constants extends OCFConstants {
+public class Constants extends OICConstants {
 
     // Database name
 
index 12d80d5..43545c3 100644 (file)
@@ -51,8 +51,7 @@ public class AccountResource extends Resource {
     private AccountManager                mAsManager = new AccountManager();
 
     public AccountResource() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.ACCOUNT_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.ACCOUNT_URI));
 
     }
 
index 1e57ec7..4266114 100644 (file)
@@ -44,8 +44,8 @@ public class SessionResource extends Resource {
     private AccountManager                mAsManager = new AccountManager();
 
     public SessionResource() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.ACCOUNT_URI, Constants.SESSION_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.ACCOUNT_URI,
+                Constants.SESSION_URI));
     }
 
     @Override
index ecfe389..ae75708 100644 (file)
@@ -45,8 +45,8 @@ public class TokenRefreshResource extends Resource {
     private AccountManager                mAsManager = new AccountManager();
 
     public TokenRefreshResource() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.ACCOUNT_URI, Constants.TOKEN_REFRESH_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.ACCOUNT_URI,
+                Constants.TOKEN_REFRESH_URI));
     }
 
     @Override
index 9014676..f5b8538 100644 (file)
@@ -46,8 +46,8 @@ public class GroupResource extends Resource {
     private static GroupManager           mGrManager = new GroupManager();
 
     public GroupResource() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.ACL_URI, Constants.GROUP_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.ACL_URI,
+                Constants.GROUP_URI));
     }
 
     public static GroupManager getInstance() {
index c5bc4b5..6336f50 100644 (file)
@@ -46,8 +46,8 @@ public class InviteResource extends Resource {
     private Cbor<HashMap<String, Object>> mCbor          = new Cbor<>();
 
     public InviteResource() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.ACL_URI, Constants.INVITE_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.ACL_URI,
+                Constants.INVITE_URI));
     }
 
     @Override
@@ -67,8 +67,8 @@ public class InviteResource extends Resource {
                 response = handleDeleteRequest(request);
                 break;
             default:
-                throw new BadRequestException(request.getMethod()
-                        + " request type is not supported");
+                throw new BadRequestException(
+                        request.getMethod() + " request type is not supported");
         }
 
         srcDevice.sendResponse(response);
@@ -106,8 +106,8 @@ public class InviteResource extends Resource {
     private IResponse handlePostRequest(IRequest request)
             throws ServerException {
 
-        HashMap<String, Object> payload = mCbor.parsePayloadFromCbor(
-                request.getPayload(), HashMap.class);
+        HashMap<String, Object> payload = mCbor
+                .parsePayloadFromCbor(request.getPayload(), HashMap.class);
 
         checkPayloadException(
                 Arrays.asList(Constants.REQ_UUID_ID, Constants.REQ_INVITE),
index 6430fd1..3e390c1 100644 (file)
 package org.iotivity.cloud.accountserver.resources.certificate;
 
 import java.security.PublicKey;
-import java.time.Instant;
-import java.time.LocalDateTime;
-import java.time.ZoneOffset;
-import java.time.format.DateTimeFormatter;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
 import org.iotivity.cloud.accountserver.Constants;
-
 import org.iotivity.cloud.accountserver.x509.cert.CSRParser;
-import org.iotivity.cloud.accountserver.x509.cert.CertificateIssuerConfig;
 import org.iotivity.cloud.accountserver.x509.cert.CertificateBuilder;
+import org.iotivity.cloud.accountserver.x509.cert.CertificateIssuerConfig;
 import org.iotivity.cloud.accountserver.x509.cert.CertificatePrivateKeyPair;
 import org.iotivity.cloud.base.device.Device;
 import org.iotivity.cloud.base.exception.ServerException;
@@ -50,13 +45,13 @@ import org.iotivity.cloud.util.Cbor;
 
 public class CertificateResource extends Resource {
     /* resource uri for certificate issuer */
-    private Cbor<HashMap<String, Object>> mCbor = new Cbor<>();
-    private CertificateManager mCertificateManager = new CertificateManager();
-    private static String DEVICE_OU = "OCF Device";
+    private Cbor<HashMap<String, Object>> mCbor               = new Cbor<>();
+    private CertificateManager            mCertificateManager = new CertificateManager();
+    private static String                 DEVICE_OU           = "OCF Device";
 
     public CertificateResource() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.CREDPROV_URI, Constants.CERT_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.CREDPROV_URI,
+                Constants.CERT_URI));
     }
 
     @Override
@@ -101,13 +96,16 @@ public class CertificateResource extends Resource {
                 throw new BadRequestException("Bad CSR");
             }
 
-            CertificateIssuerConfig ciConfig = CertificateIssuerConfig.getInstance();
+            CertificateIssuerConfig ciConfig = CertificateIssuerConfig
+                    .getInstance();
 
             Date notBefore = ciConfig.getNotBeforeDate();
             Date notAfter = ciConfig.getNotAfterDate();
 
-            CertificateBuilder certBuilder = new CertificateBuilder(parser.getCommonName(), pubKey,
-                    notBefore, notAfter, ciConfig.getNextSerialNumber(), ciConfig.getRootCertificate());
+            CertificateBuilder certBuilder = new CertificateBuilder(
+                    parser.getCommonName(), pubKey, notBefore, notAfter,
+                    ciConfig.getNextSerialNumber(),
+                    ciConfig.getRootCertificate());
 
             certBuilder.setSubjectC(parser.getCountry());
 
@@ -119,17 +117,21 @@ public class CertificateResource extends Resource {
 
             try {
                 devCert = certBuilder.build();
-                //  System.out.println("============================== DEV CERT ===========================");
-                //  System.out.println();
-                //  System.out.println(devCert.getCertificate().toString());
-                //  System.out.println("===================================================================");
+                // System.out.println("============================== DEV CERT
+                // ===========================");
+                // System.out.println();
+                // System.out.println(devCert.getCertificate().toString());
+                // System.out.println("===================================================================");
 
                 if (payloadData.containsKey(Constants.REQ_DEVICE_ID)) {
-                    mCertificateManager.addDeviceId((String) payloadData.get(Constants.RESP_DEVICE_ID));
+                    mCertificateManager.addDeviceId(
+                            (String) payloadData.get(Constants.RESP_DEVICE_ID));
                 }
 
-                responsePayload = mCertificateManager.createPayload(devCert.getCertificate().getEncoded(),
-                        ciConfig.getRootCertificate().getCertificate().getEncoded());
+                responsePayload = mCertificateManager.createPayload(
+                        devCert.getCertificate().getEncoded(),
+                        ciConfig.getRootCertificate().getCertificate()
+                                .getEncoded());
 
             } catch (Exception e) {
                 throw new BadRequestException("Certificate generation error");
@@ -139,7 +141,6 @@ public class CertificateResource extends Resource {
             throw new BadRequestException("CSR is null");
         }
 
-
         return MessageBuilder.createResponse(request, ResponseStatus.CONTENT,
                 ContentFormat.APPLICATION_CBOR,
                 mCbor.encodingPayloadToCbor(responsePayload));
index 7aae29e..d5382f7 100644 (file)
@@ -56,8 +56,8 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 public class AccountResourceTest {
-    private static final String            REGISTER_URI              = "/.well-known/ocf/account";
-    private static final String            GROUP_URI                 = "/.well-known/ocf/acl/group";
+    private static final String            REGISTER_URI              = Constants.ACCOUNT_FULL_URI;
+    private static final String            GROUP_URI                 = Constants.GROUP_FULL_URI;
     private static final String            DEVICE_ID                 = "B371C481-38E6-4D47-8320-7688D8A5B58C";
     private String                         mAuthProvider             = "Github";
     private String                         mAuthCode                 = "c2820e39232088dca7d4";
index a4049e8..ace8a22 100644 (file)
@@ -54,8 +54,8 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 public class SessionResourceTest {
-    private static final String            DEFAULT_AUTH_LOGIN        = "/.well-known/ocf/account/session";
-    private static final String            DEFAULT_AUTH_LOGOUT       = "/.well-known/ocf/account/session";
+    private static final String            DEFAULT_AUTH_LOGIN        = Constants.ACCOUNT_SESSION_FULL_URI;
+    private static final String            DEFAULT_AUTH_LOGOUT       = Constants.ACCOUNT_SESSION_FULL_URI;
     private static final String            DEVICE_ID                 = "d0001";
     private static final String            ACCESS_TOKEN              = "5f5536c896da7dd437316585b86ef9dd03441c40";
     private static final String            REFRESH_TOKEN             = "rt0001";
index f0b04f6..aaee6b5 100644 (file)
@@ -28,7 +28,7 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 public class TokenRefreshResourceTest {
-    private static final String            REFRESH_TOKEN_URI         = "/.well-known/ocf/account/tokenrefresh";
+    private static final String            REFRESH_TOKEN_URI         = Constants.ACCOUNT_TOKENREFRESH_FULL_URI;
     private static final String            DEVICE_ID                 = "B371C481-38E6-4D47-8320-7688D8A5B58C";
     private String                         mAuthProvider             = "Samsung";
     private String                         mRefreshToken             = "rt0001";
index a16ea7e..70b4e93 100644 (file)
@@ -52,7 +52,7 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 public class GroupResourceTest {
-    private static final String           GROUP_URI         = "/.well-known/ocf/acl/group";
+    private static final String           GROUP_URI         = Constants.GROUP_FULL_URI;
     private final String                  mUserUuid         = "bc38f243-aab5-44d3-8eb9-4a54ebbaf359";
     private String                        mGroupId          = null;
     final CountDownLatch                  mLatch            = new CountDownLatch(
index d34c2da..4e0b584 100644 (file)
@@ -21,9 +21,9 @@
  */
 package org.iotivity.cloud.ciserver;
 
-import org.iotivity.cloud.base.OCFConstants;
+import org.iotivity.cloud.base.OICConstants;
 
-public class Constants extends OCFConstants {
+public class Constants extends OICConstants {
 
     public static final int    MIN_TO_LIVE         = 10;
 
index e1f08aa..20d7684 100644 (file)
@@ -23,7 +23,7 @@ package org.iotivity.cloud.ciserver;
 
 import java.util.HashMap;
 
-import org.iotivity.cloud.base.OCFConstants;
+import org.iotivity.cloud.base.OICConstants;
 import org.iotivity.cloud.base.ServerSystem;
 import org.iotivity.cloud.base.connector.ConnectorPool;
 import org.iotivity.cloud.base.device.CoapDevice;
@@ -143,8 +143,7 @@ public class DeviceServerSystem extends ServerSystem {
             payload.put(Constants.REQ_DEVICE_ID, deviceId);
             payload.put(Constants.PRESENCE_STATE, state);
             StringBuffer uriPath = new StringBuffer();
-            uriPath.append("/" + Constants.PREFIX_WELL_KNOWN);
-            uriPath.append("/" + Constants.PREFIX_OCF);
+            uriPath.append("/" + Constants.PREFIX_OIC);
             uriPath.append("/" + Constants.DEVICE_PRESENCE_URI);
             RDServer.sendRequest(MessageBuilder.createRequest(
                     RequestMethod.POST, uriPath.toString(), null,
@@ -180,7 +179,7 @@ public class DeviceServerSystem extends ServerSystem {
 
                 switch (response.getUriPath()) {
 
-                    case OCFConstants.ACCOUNT_SESSION_FULL_URI:
+                    case OICConstants.ACCOUNT_SESSION_FULL_URI:
 
                         if (response.getStatus() != ResponseStatus.CHANGED) {
                             throw new UnAuthorizedException();
@@ -232,8 +231,8 @@ public class DeviceServerSystem extends ServerSystem {
 
                 switch (request.getUriPath()) {
                     // Check whether request is about account
-                    case OCFConstants.ACCOUNT_FULL_URI:
-                    case OCFConstants.ACCOUNT_TOKENREFRESH_FULL_URI:
+                    case OICConstants.ACCOUNT_FULL_URI:
+                    case OICConstants.ACCOUNT_TOKENREFRESH_FULL_URI:
 
                         if (ctx.channel().attr(keyDevice).get() == null) {
                             // Create device first and pass to upperlayer
@@ -243,7 +242,7 @@ public class DeviceServerSystem extends ServerSystem {
 
                         break;
 
-                    case OCFConstants.ACCOUNT_SESSION_FULL_URI:
+                    case OICConstants.ACCOUNT_SESSION_FULL_URI:
 
                         authPayload = mCbor.parsePayloadFromCbor(
                                 request.getPayload(), HashMap.class);
@@ -263,7 +262,7 @@ public class DeviceServerSystem extends ServerSystem {
 
                         break;
 
-                    case OCFConstants.KEEP_ALIVE_FULL_URI:
+                    case OICConstants.KEEP_ALIVE_FULL_URI:
                         // TODO: Pass ping request to upper layer
                         break;
 
index dd651ee..497d139 100644 (file)
@@ -37,8 +37,7 @@ public class Account extends Resource {
     IRequestChannel mAuthServer = null;
 
     public Account() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.ACCOUNT_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.ACCOUNT_URI));
 
         mAuthServer = ConnectorPool.getConnection("account");
     }
index 74aeaf6..c46d609 100644 (file)
@@ -40,8 +40,8 @@ public class AccountSession extends Resource {
     private Cbor<HashMap<String, Object>> mCbor       = new Cbor<>();
 
     public AccountSession() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.ACCOUNT_URI, Constants.SESSION_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.ACCOUNT_URI,
+                Constants.SESSION_URI));
 
         mAuthServer = ConnectorPool.getConnection("account");
     }
index dd2b743..6adccec 100644 (file)
@@ -35,8 +35,7 @@ public class Acl extends Resource {
     IRequestChannel mAuthServer = null;
 
     public Acl() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.ACL_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.ACL_URI));
 
         mAuthServer = ConnectorPool.getConnection("account");
     }
index 6168556..ad3e344 100644 (file)
@@ -42,8 +42,8 @@ public class AclGroup extends Resource {
     private Cbor<HashMap<String, Object>> mCbor       = new Cbor<>();
 
     public AclGroup() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.ACL_URI, Constants.GROUP_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.ACL_URI,
+                Constants.GROUP_URI));
 
         mAuthServer = ConnectorPool.getConnection("account");
     }
index 46c28f5..9f0437d 100644 (file)
@@ -40,8 +40,8 @@ public class AclInvite extends Resource {
     IRequestChannel mAuthServer = null;
 
     public AclInvite() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.ACL_URI, Constants.INVITE_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.ACL_URI,
+                Constants.INVITE_URI));
 
         mAuthServer = ConnectorPool.getConnection("account");
 
index 6808c67..8556694 100644 (file)
@@ -35,8 +35,8 @@ public class Certificate extends Resource {
     IRequestChannel mAuthServer = null;
 
     public Certificate() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.CREDPROV_URI, Constants.CERT_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.CREDPROV_URI,
+                Constants.CERT_URI));
         mAuthServer = ConnectorPool.getConnection("account");
     }
 
index 00747ae..687585b 100644 (file)
@@ -35,8 +35,7 @@ public class MessageQueue extends Resource {
     IRequestChannel mPSServer = null;
 
     public MessageQueue() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.MQ_BROKER_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.MQ_BROKER_URI));
 
         mPSServer = ConnectorPool.getConnection("mq");
     }
index 8f0fed7..d5fb060 100644 (file)
@@ -45,7 +45,7 @@ public class DevicePresence extends Resource {
     private Cbor<HashMap<String, Object>> mCbor     = new Cbor<>();
 
     public DevicePresence() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
+        super(Arrays.asList(Constants.PREFIX_OIC,
                 Constants.DEVICE_PRESENCE_URI));
 
         mASServer = ConnectorPool.getConnection("account");
@@ -145,8 +145,7 @@ public class DevicePresence extends Resource {
         uriQuery.append(Constants.REQ_MEMBER_ID + "=" + srcDevice.getUserId());
 
         StringBuffer uriPath = new StringBuffer();
-        uriPath.append(Constants.PREFIX_WELL_KNOWN + "/");
-        uriPath.append(Constants.PREFIX_OCF + "/");
+        uriPath.append(Constants.PREFIX_OIC + "/");
         uriPath.append(Constants.ACL_URI + "/");
         uriPath.append(Constants.GROUP_URI + "/");
         uriPath.append(srcDevice.getUserId());
index 6b2f493..b151e1f 100644 (file)
@@ -85,8 +85,7 @@ public class ResourceDirectory extends Resource {
             throws ServerException {
 
         StringBuffer uriPath = new StringBuffer();
-        uriPath.append(Constants.PREFIX_WELL_KNOWN + "/");
-        uriPath.append(Constants.PREFIX_OCF + "/");
+        uriPath.append(Constants.PREFIX_OIC + "/");
         uriPath.append(Constants.ACL_URI + "/");
         uriPath.append(Constants.GROUP_URI + "/");
         uriPath.append(srcDevice.getUserId());
index 635a1b0..091713a 100644 (file)
@@ -144,8 +144,7 @@ public class ResourceFind extends Resource {
         uriQuery.append(Constants.REQ_MEMBER_ID + "=" + srcDevice.getUserId());
 
         StringBuffer uriPath = new StringBuffer();
-        uriPath.append(Constants.PREFIX_WELL_KNOWN + "/");
-        uriPath.append(Constants.PREFIX_OCF + "/");
+        uriPath.append(Constants.PREFIX_OIC + "/");
         uriPath.append(Constants.ACL_URI + "/");
         uriPath.append(Constants.GROUP_URI + "/");
         uriPath.append(srcDevice.getUserId());
index e87da65..ddf7a54 100644 (file)
@@ -144,8 +144,7 @@ public class ResourcePresence extends Resource {
         uriQuery.append(Constants.REQ_MEMBER_ID + "=" + srcDevice.getUserId());
 
         StringBuffer uriPath = new StringBuffer();
-        uriPath.append(Constants.PREFIX_WELL_KNOWN + "/");
-        uriPath.append(Constants.PREFIX_OCF + "/");
+        uriPath.append(Constants.PREFIX_OIC + "/");
         uriPath.append(Constants.ACL_URI + "/");
         uriPath.append(Constants.GROUP_URI + "/");
         uriPath.append(srcDevice.getUserId());
index 21cf5ea..484e172 100644 (file)
@@ -8,7 +8,7 @@ import static org.mockito.Mockito.mock;
 import java.util.HashMap;
 import java.util.concurrent.CountDownLatch;
 
-import org.iotivity.cloud.base.OCFConstants;
+import org.iotivity.cloud.base.OICConstants;
 import org.iotivity.cloud.base.device.CoapDevice;
 import org.iotivity.cloud.base.device.Device;
 import org.iotivity.cloud.base.device.IRequestChannel;
@@ -190,10 +190,7 @@ public class DeviceServerSystemTest {
                     throws Throwable {
                 Object[] args = invocation.getArguments();
                 CoapRequest req = (CoapRequest) args[0];
-                assertEquals(req.getUriPath(),
-                        "/" + OCFConstants.PREFIX_WELL_KNOWN + "/"
-                                + OCFConstants.PREFIX_OCF + "/"
-                                + OCFConstants.ACCOUNT_URI);
+                assertEquals(req.getUriPath(), Constants.ACCOUNT_FULL_URI);
                 assertTrue(cbor
                         .parsePayloadFromCbor(req.getPayload(), HashMap.class)
                         .containsKey("di"));
@@ -206,10 +203,8 @@ public class DeviceServerSystemTest {
         payloadData.put("di", "sampleDevice");
 
         IRequest request = MessageBuilder.createRequest(RequestMethod.POST,
-                "/" + OCFConstants.PREFIX_WELL_KNOWN + "/"
-                        + OCFConstants.PREFIX_OCF + "/"
-                        + OCFConstants.ACCOUNT_URI,
-                null, ContentFormat.APPLICATION_CBOR,
+                Constants.ACCOUNT_FULL_URI, null,
+                ContentFormat.APPLICATION_CBOR,
                 cbor.encodingPayloadToCbor(payloadData));
         coapAuthHandler.channelRead(ctx, request);
     }
@@ -232,8 +227,8 @@ public class DeviceServerSystemTest {
                     throws Throwable {
                 Object[] args = invocation.getArguments();
                 CoapRequest req = (CoapRequest) args[0];
-                assertEquals(req.getUriPath(), "/" + OCFConstants.PREFIX_OIC
-                        + "/" + OCFConstants.KEEP_ALIVE_URI);
+                assertEquals(req.getUriPath(), "/" + OICConstants.PREFIX_OIC
+                        + "/" + OICConstants.KEEP_ALIVE_URI);
 
                 latch.countDown();
                 return null;
@@ -242,8 +237,8 @@ public class DeviceServerSystemTest {
 
         IRequest request = MessageBuilder
                 .createRequest(RequestMethod.POST,
-                        "/" + OCFConstants.PREFIX_OIC + "/"
-                                + OCFConstants.KEEP_ALIVE_URI,
+                        "/" + OICConstants.PREFIX_OIC + "/"
+                                + OICConstants.KEEP_ALIVE_URI,
                         null, null, null);
         coapAuthHandler.channelRead(ctx, request);
     }
index 25c5435..a86b560 100644 (file)
@@ -17,6 +17,7 @@ import org.iotivity.cloud.base.protocols.MessageBuilder;
 import org.iotivity.cloud.base.protocols.coap.CoapRequest;
 import org.iotivity.cloud.base.protocols.enums.ContentFormat;
 import org.iotivity.cloud.base.protocols.enums.RequestMethod;
+import org.iotivity.cloud.ciserver.Constants;
 import org.iotivity.cloud.ciserver.DeviceServerSystem;
 import org.iotivity.cloud.util.Cbor;
 import org.junit.Before;
@@ -30,7 +31,7 @@ import org.mockito.stubbing.Answer;
 
 public class AccountSessionTest {
     private String             di                 = "B371C481-38E6-4D47-8320-7688D8A5B58C";
-    public static final String SESSION_URI        = "/.well-known/ocf/account/session";
+    public static final String SESSION_URI        = Constants.ACCOUNT_SESSION_FULL_URI;
     private CoapDevice         mockDevice         = mock(CoapDevice.class);
     IResponse                  res                = null;
     IRequest                   req                = null;
index 279a98f..193898e 100644 (file)
@@ -17,6 +17,7 @@ import org.iotivity.cloud.base.protocols.MessageBuilder;
 import org.iotivity.cloud.base.protocols.coap.CoapRequest;
 import org.iotivity.cloud.base.protocols.enums.ContentFormat;
 import org.iotivity.cloud.base.protocols.enums.RequestMethod;
+import org.iotivity.cloud.ciserver.Constants;
 import org.iotivity.cloud.ciserver.DeviceServerSystem;
 import org.iotivity.cloud.util.Cbor;
 import org.junit.Before;
@@ -30,7 +31,7 @@ import org.mockito.stubbing.Answer;
 
 public class AccountTest {
     private String             di                 = "B371C481-38E6-4D47-8320-7688D8A5B58C";
-    public static final String ACCOUNT_URI        = "/.well-known/ocf/account";
+    public static final String ACCOUNT_URI        = Constants.ACCOUNT_FULL_URI;
     private String             authProvider       = "github";
     private String             authCode           = "f6b55d8d8a27e0d32ab8";
     String                     userId             = "testuser";
index 06071ea..47fd821 100644 (file)
@@ -9,7 +9,6 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.concurrent.CountDownLatch;
 
-import org.iotivity.cloud.base.OCFConstants;
 import org.iotivity.cloud.base.connector.ConnectorPool;
 import org.iotivity.cloud.base.device.CoapDevice;
 import org.iotivity.cloud.base.device.IRequestChannel;
@@ -18,6 +17,7 @@ import org.iotivity.cloud.base.protocols.MessageBuilder;
 import org.iotivity.cloud.base.protocols.coap.CoapRequest;
 import org.iotivity.cloud.base.protocols.enums.ContentFormat;
 import org.iotivity.cloud.base.protocols.enums.RequestMethod;
+import org.iotivity.cloud.ciserver.Constants;
 import org.iotivity.cloud.ciserver.DeviceServerSystem;
 import org.iotivity.cloud.util.Cbor;
 import org.junit.Before;
@@ -30,9 +30,8 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 public class AclGroupTest {
-    private static final String TEST_RESOURCE_GROUP_URI = "/"
-            + OCFConstants.PREFIX_WELL_KNOWN + "/" + OCFConstants.PREFIX_OCF
-            + "/" + OCFConstants.ACL_URI + "/" + OCFConstants.GROUP_URI;
+    private static final String TEST_RESOURCE_GROUP_URI = Constants.GROUP_FULL_URI;
+
     private CoapDevice          mockDevice              = mock(
             CoapDevice.class);
     IRequest                    req                     = null;
index 5fe9c32..34eb0e2 100644 (file)
@@ -10,7 +10,6 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.concurrent.CountDownLatch;
 
-import org.iotivity.cloud.base.OCFConstants;
 import org.iotivity.cloud.base.connector.ConnectorPool;
 import org.iotivity.cloud.base.device.CoapDevice;
 import org.iotivity.cloud.base.device.IRequestChannel;
@@ -19,6 +18,7 @@ import org.iotivity.cloud.base.protocols.MessageBuilder;
 import org.iotivity.cloud.base.protocols.coap.CoapRequest;
 import org.iotivity.cloud.base.protocols.enums.ContentFormat;
 import org.iotivity.cloud.base.protocols.enums.RequestMethod;
+import org.iotivity.cloud.ciserver.Constants;
 import org.iotivity.cloud.ciserver.DeviceServerSystem;
 import org.iotivity.cloud.util.Cbor;
 import org.junit.Before;
@@ -31,9 +31,8 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 public class AclInviteTest {
-    private static final String TEST_RESOURCE_INVITE_URI = "/"
-            + OCFConstants.PREFIX_WELL_KNOWN + "/" + OCFConstants.PREFIX_OCF
-            + "/" + OCFConstants.ACL_URI + "/" + OCFConstants.INVITE_URI;
+    private static final String TEST_RESOURCE_INVITE_URI = Constants.INVITE_FULL_URI;
+
     private CoapDevice          mockDevice               = mock(
             CoapDevice.class);
     IRequest                    req                      = null;
index 8e57795..20cf362 100644 (file)
@@ -7,7 +7,7 @@ import static org.mockito.Mockito.mock;
 
 import java.util.concurrent.CountDownLatch;
 
-import org.iotivity.cloud.base.OCFConstants;
+import org.iotivity.cloud.base.OICConstants;
 import org.iotivity.cloud.base.connector.ConnectorPool;
 import org.iotivity.cloud.base.device.CoapDevice;
 import org.iotivity.cloud.base.device.IRequestChannel;
@@ -27,8 +27,7 @@ import org.mockito.stubbing.Answer;
 
 public class AclTest {
     private static final String TEST_RESOURCE_ACI_URI = "/"
-            + OCFConstants.PREFIX_WELL_KNOWN + "/" + OCFConstants.PREFIX_OCF
-            + "/" + OCFConstants.ACL_URI;
+            + OICConstants.PREFIX_OIC + "/" + OICConstants.ACL_URI;
     private CoapDevice          mockDevice            = mock(CoapDevice.class);
     IRequest                    req                   = null;
     ConnectorPool               connectorPool         = null;
index 81c5f86..f0045ff 100644 (file)
@@ -7,7 +7,7 @@ import static org.mockito.Mockito.mock;
 
 import java.util.concurrent.CountDownLatch;
 
-import org.iotivity.cloud.base.OCFConstants;
+import org.iotivity.cloud.base.OICConstants;
 import org.iotivity.cloud.base.connector.ConnectorPool;
 import org.iotivity.cloud.base.device.CoapDevice;
 import org.iotivity.cloud.base.device.IRequestChannel;
@@ -27,8 +27,8 @@ import org.mockito.stubbing.Answer;
 
 public class CertificateTest {
     private static final String TEST_RESOURCE_CERTI_URI = "/"
-            + OCFConstants.PREFIX_WELL_KNOWN + "/" + OCFConstants.PREFIX_OCF
-            + "/" + OCFConstants.CREDPROV_URI + "/" + OCFConstants.CERT_URI;
+            + OICConstants.PREFIX_OIC + "/" + OICConstants.CREDPROV_URI + "/"
+            + OICConstants.CERT_URI;
     private CoapDevice          mockDevice              = mock(
             CoapDevice.class);
     IRequest                    req                     = null;
index b2f0f85..e70303f 100644 (file)
@@ -16,6 +16,7 @@ import org.iotivity.cloud.base.protocols.MessageBuilder;
 import org.iotivity.cloud.base.protocols.coap.CoapRequest;
 import org.iotivity.cloud.base.protocols.enums.ContentFormat;
 import org.iotivity.cloud.base.protocols.enums.RequestMethod;
+import org.iotivity.cloud.ciserver.Constants;
 import org.iotivity.cloud.ciserver.DeviceServerSystem;
 import org.iotivity.cloud.util.Cbor;
 import org.junit.Before;
@@ -28,7 +29,7 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 public class MessageQueueTest {
-    private static final String TEST_MQ_BROKER_URI = "/.well-known/ocf/ps/";
+    private static final String TEST_MQ_BROKER_URI = Constants.MQ_BROKER_FULL_URI;
     String                      userId             = "testuser";
     private CoapDevice          mockDevice         = null;
     IResponse                   res                = null;
index 758e61d..9e8f3bc 100644 (file)
@@ -22,6 +22,7 @@ import org.iotivity.cloud.base.protocols.enums.ContentFormat;
 import org.iotivity.cloud.base.protocols.enums.Observe;
 import org.iotivity.cloud.base.protocols.enums.RequestMethod;
 import org.iotivity.cloud.base.protocols.enums.ResponseStatus;
+import org.iotivity.cloud.ciserver.Constants;
 import org.iotivity.cloud.ciserver.DeviceServerSystem;
 import org.iotivity.cloud.util.Cbor;
 import org.junit.Before;
@@ -34,9 +35,9 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 public class DevicePresenceTest {
-    public static final String DEVICE_PRS_REQ_URI = "/.well-known/ocf/prs";
+    public static final String DEVICE_PRS_REQ_URI = Constants.DEVICE_PRESENCE_FULL_URI;
     public static final String DEVICE_LIST_KEY    = "devices";
-    public static final String RES_PRS_URI        = "/oic/ad";
+    public static final String RES_PRS_URI        = Constants.RESOURCE_PRESENCE_FULL_URI;
     private String             di                 = "B371C481-38E6-4D47-8320-7688D8A5B58C";
     String                     userId             = "testuser";
     private CoapDevice         mockDevice         = mock(CoapDevice.class);
@@ -125,7 +126,7 @@ public class DevicePresenceTest {
         HashMap<String, List<String>> queryMap = req.getUriQueryMap();
         assertTrue(queryMap.containsKey("mid"));
         assertTrue(req.getMethod().equals(RequestMethod.GET));
-        assertEquals(req.getUriPath(), "/.well-known/ocf/acl/group/null");
+        assertEquals(req.getUriPath(), Constants.GROUP_FULL_URI + "/null");
     }
 
     // @InjectMocks for testPresenceDeregisterSpecificDeviceOnRequestReceived
@@ -159,7 +160,7 @@ public class DevicePresenceTest {
         assertTrue(req.getMethod().equals(RequestMethod.GET));
         HashMap<String, List<String>> queryMap = req.getUriQueryMap();
         assertTrue(queryMap.containsKey("mid"));
-        assertEquals(req.getUriPath(), "/.well-known/ocf/acl/group/null");
+        assertEquals(req.getUriPath(), Constants.GROUP_FULL_URI + "/null");
     }
 
     public IRequest makePresenceEntireDevice() {
@@ -205,7 +206,7 @@ public class DevicePresenceTest {
         midList.add("u0001");
         responsePayload.put("midlist", midList);
         IRequest requestFromCitoAs = MessageBuilder.createRequest(
-                RequestMethod.GET, "/.well-known/ocf/acl/group/g0001",
+                RequestMethod.GET, Constants.GROUP_FULL_URI + "/g0001",
                 "mid=null");
         IResponse response = MessageBuilder.createResponse(requestFromCitoAs,
                 ResponseStatus.CONTENT, ContentFormat.APPLICATION_CBOR,
index a7db303..d2ae9ab 100644 (file)
@@ -9,7 +9,6 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.concurrent.CountDownLatch;
 
-import org.iotivity.cloud.base.OCFConstants;
 import org.iotivity.cloud.base.connector.ConnectorPool;
 import org.iotivity.cloud.base.device.CoapDevice;
 import org.iotivity.cloud.base.device.IRequestChannel;
@@ -33,11 +32,10 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 public class ResourceDirectoryTest {
-    private static final String TEST_RD_URI        = OCFConstants.PREFIX_OIC
-            + "/" + OCFConstants.RD_URI;
-    public static final String  DEVICE_PRS_REQ_URI = "/.well-known/ocf/prs";
+    private static final String TEST_RD_URI        = Constants.RD_FULL_URI;
+    public static final String  DEVICE_PRS_REQ_URI = Constants.DEVICE_PRESENCE_FULL_URI;
     public static final String  DEVICE_LIST_KEY    = "devices";
-    public static final String  RES_PRS_URI        = "/oic/ad";
+    public static final String  RES_PRS_URI        = Constants.RESOURCE_PRESENCE_FULL_URI;
     // private DeviceServerSystem deviceServerSystem = new DeviceServerSystem();
     private String              di                 = "B371C481-38E6-4D47-8320-7688D8A5B58C";
     String                      userId             = "testuser";
@@ -85,10 +83,7 @@ public class ResourceDirectoryTest {
         IRequest request = makeResourcePublishRequest();
         deviceServerSystem.onRequestReceived(mockDevice, request);
         assertTrue(latch.await(1L, SECONDS));
-        assertTrue(req.getUriPath()
-                .contains(Constants.PREFIX_WELL_KNOWN + "/"
-                        + Constants.PREFIX_OCF + "/" + Constants.ACL_URI + "/"
-                        + Constants.GROUP_URI + "/"));
+        assertTrue(req.getUriPath().contains(Constants.GROUP_FULL_URI + "/"));
     }
 
     IRequest                                rdPublishRequest      = makeResourcePublishRequest();
index 7fb9cf2..acdf9a4 100644 (file)
@@ -11,7 +11,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
 
-import org.iotivity.cloud.base.OCFConstants;
 import org.iotivity.cloud.base.connector.ConnectorPool;
 import org.iotivity.cloud.base.device.CoapDevice;
 import org.iotivity.cloud.base.device.IRequestChannel;
@@ -24,6 +23,7 @@ import org.iotivity.cloud.base.protocols.coap.CoapResponse;
 import org.iotivity.cloud.base.protocols.enums.ContentFormat;
 import org.iotivity.cloud.base.protocols.enums.RequestMethod;
 import org.iotivity.cloud.base.protocols.enums.ResponseStatus;
+import org.iotivity.cloud.ciserver.Constants;
 import org.iotivity.cloud.ciserver.DeviceServerSystem;
 import org.iotivity.cloud.util.Cbor;
 import org.junit.Before;
@@ -36,8 +36,7 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 public class ResourceFindTest {
-    private static final String TEST_RESOURCE_FIND_URI = "/"
-            + OCFConstants.PREFIX_OIC + "/" + OCFConstants.WELL_KNOWN_URI;
+    private static final String TEST_RESOURCE_FIND_URI = Constants.WELL_KNOWN_FULL_URI;
     private String              di                     = "B371C481-38E6-4D47-8320-7688D8A5B58C";
     private CoapDevice          mockDevice             = mock(CoapDevice.class);
     IResponse                   res                    = null;
@@ -167,7 +166,7 @@ public class ResourceFindTest {
         HashMap<String, List<String>> queryMap = req.getUriQueryMap();
         assertTrue(latch.await(1L, SECONDS));
         assertTrue(queryMap.containsKey("mid"));
-        assertEquals(req.getUriPath(), "/.well-known/ocf/acl/group/null");
+        assertEquals(req.getUriPath(), Constants.GROUP_FULL_URI + "/null");
     }
 
     @Test
@@ -183,7 +182,7 @@ public class ResourceFindTest {
         // which includes device ID and the accesstoken
         assertTrue(latch.await(1L, SECONDS));
         assertTrue(queryMap.containsKey("mid"));
-        assertEquals(req.getUriPath(), "/.well-known/ocf/acl/group/null");
+        assertEquals(req.getUriPath(), Constants.GROUP_FULL_URI + "/null");
     }
 
     private IResponse responseFromAccountServer() {
index d7f2ff9..9072d42 100644 (file)
@@ -20,6 +20,7 @@ import org.iotivity.cloud.base.protocols.coap.CoapRequest;
 import org.iotivity.cloud.base.protocols.enums.ContentFormat;
 import org.iotivity.cloud.base.protocols.enums.RequestMethod;
 import org.iotivity.cloud.base.protocols.enums.ResponseStatus;
+import org.iotivity.cloud.ciserver.Constants;
 import org.iotivity.cloud.ciserver.DeviceServerSystem;
 import org.iotivity.cloud.util.Cbor;
 import org.junit.Before;
@@ -32,9 +33,9 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 public class ResourcePresenceTest {
-    public static final String DEVICE_PRS_REQ_URI = "/.well-known/ocf/prs";
+    public static final String DEVICE_PRS_REQ_URI = Constants.DEVICE_PRESENCE_FULL_URI;
     public static final String DEVICE_LIST_KEY    = "devices";
-    public static final String RES_PRS_URI        = "/oic/ad";
+    public static final String RES_PRS_URI        = Constants.RESOURCE_PRESENCE_FULL_URI;
     private String             di                 = "B371C481-38E6-4D47-8320-7688D8A5B58C";
     private CoapDevice         mockDevice         = mock(CoapDevice.class);
     IResponse                  res                = null;
@@ -86,7 +87,7 @@ public class ResourcePresenceTest {
         // which includes the accesstoken and the di
         assertTrue(latch.await(1L, SECONDS));
         assertTrue(queryMap.containsKey("mid"));
-        assertEquals(req.getUriPath(), "/.well-known/ocf/acl/group/null");
+        assertEquals(req.getUriPath(), Constants.GROUP_FULL_URI + "/null");
     }
 
     @Test
@@ -100,7 +101,7 @@ public class ResourcePresenceTest {
         HashMap<String, List<String>> queryMap = req.getUriQueryMap();
         assertTrue(latch.await(1L, SECONDS));
         assertTrue(queryMap.containsKey("mid"));
-        assertEquals(req.getUriPath(), "/.well-known/ocf/acl/group/null");
+        assertEquals(req.getUriPath(), Constants.GROUP_FULL_URI + "/null");
     }
 
     IRequest                               requestEntireDevices = MessageBuilder
index dba812c..2961ac2 100644 (file)
@@ -21,9 +21,9 @@
  */
 package org.iotivity.cloud.mqserver;
 
-import org.iotivity.cloud.base.OCFConstants;
+import org.iotivity.cloud.base.OICConstants;
 
-public class Constants extends OCFConstants {
+public class Constants extends OICConstants {
 
     public static final String MQ_TOPICLIST            = "topiclist";
     public static final String MQ_MESSAGE              = "message";
index 84aae72..5b67c3f 100644 (file)
@@ -48,8 +48,7 @@ public class MQBrokerResource extends Resource {
     private TopicManager mTopicManager = new TopicManager();
 
     public MQBrokerResource() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
-                Constants.MQ_BROKER_URI));
+        super(Arrays.asList(Constants.PREFIX_OIC, Constants.MQ_BROKER_URI));
     }
 
     public void setKafkaInformation(String zookeeper, String broker) {
index 19e5a5b..6a3f102 100644 (file)
@@ -48,6 +48,7 @@ import org.iotivity.cloud.base.protocols.enums.ContentFormat;
 import org.iotivity.cloud.base.protocols.enums.Observe;
 import org.iotivity.cloud.base.protocols.enums.RequestMethod;
 import org.iotivity.cloud.base.protocols.enums.ResponseStatus;
+import org.iotivity.cloud.mqserver.Constants;
 import org.iotivity.cloud.util.Cbor;
 import org.junit.Before;
 import org.junit.Test;
@@ -56,7 +57,7 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
 public class MQBrokerResourceTest {
-    private final String     MQ_BROKER_URI     = "/.well-known/ocf/ps";
+    private final String     MQ_BROKER_URI     = Constants.MQ_BROKER_FULL_URI;
 
     private MQBrokerResource mMqBrokerResource = null;
     private String           mTopicPrefix      = null;
@@ -105,7 +106,8 @@ public class MQBrokerResourceTest {
 
     @Test
     // test subtopic create
-    public void testSubTopicCreationOnDefaultRequestReceived() throws Exception {
+    public void testSubTopicCreationOnDefaultRequestReceived()
+            throws Exception {
         System.out
                 .println("\t--------------SubTopic Creation Test------------");
         String mainTopic = mTopicPrefix + "Main";
@@ -230,8 +232,8 @@ public class MQBrokerResourceTest {
     // test notify
     public void testTopicSubscribeNofityOnDefaultRequestReceived()
             throws Exception {
-        System.out
-                .println("\t--------------Topic Publish Notify Test------------");
+        System.out.println(
+                "\t--------------Topic Publish Notify Test------------");
         CoapDevice mockSubscriber = mock(CoapDevice.class);
         CountDownLatch latchSubscriber = new CountDownLatch(2);
         AtomicBoolean countTrue = new AtomicBoolean();
@@ -263,8 +265,8 @@ public class MQBrokerResourceTest {
         PublishTopic(mMockDevice, topic);
         // verity if subscriber receives two responses
         assertTrue(latchSubscriber.await(2L, SECONDS));
-        verify(mockSubscriber, timeout(5000).times(2)).sendResponse(
-                Mockito.anyObject());
+        verify(mockSubscriber, timeout(5000).times(2))
+                .sendResponse(Mockito.anyObject());
     }
 
     @Test
@@ -289,9 +291,9 @@ public class MQBrokerResourceTest {
         ArrayList<String> topicList = payloadData.get("topiclist");
         System.out.println("\ttopicList : " + topicList);
         assertTrue(methodCheck);
-        assertTrue(topicList.contains("/.well-known/ocf/ps/" + topic));
-        assertTrue(topicList.contains("/.well-known/ocf/ps/" + topic + "/"
-                + subTopic));
+        assertTrue(topicList.contains(MQ_BROKER_URI + "/" + topic));
+        assertTrue(topicList
+                .contains(MQ_BROKER_URI + "/" + topic + "/" + subTopic));
     }
 
     @Test
@@ -314,8 +316,8 @@ public class MQBrokerResourceTest {
     @Test(expected = NotFoundException.class)
     public void testNotCreatedTopicDeleteOnDefaultRequestReceived()
             throws Exception {
-        System.out
-                .println("\t--------------Not Created Topic Delete Test------------");
+        System.out.println(
+                "\t--------------Not Created Topic Delete Test------------");
         String topic = mTopicPrefix + "NotCreatedTopicDeleteTest";
 
         DeleteTopic(mMockDevice, topic);
@@ -324,8 +326,8 @@ public class MQBrokerResourceTest {
     @Test(expected = NotFoundException.class)
     public void testNotCreatedSubtopicDeleteOnDefaultRequestReceived()
             throws Exception {
-        System.out
-                .println("\t--------------Not Created Subtopic Delete Test------------");
+        System.out.println(
+                "\t--------------Not Created Subtopic Delete Test------------");
         String topic = mTopicPrefix + "Maintopic";
 
         CreateTopic(mMockDevice, topic);
@@ -339,8 +341,8 @@ public class MQBrokerResourceTest {
     // duplicate topic creation
     public void testDuplicatedTopicCreateOnDefaultRequestReceived()
             throws Exception {
-        System.out
-                .println("\t--------------Duplicated Topic Creation Test------------");
+        System.out.println(
+                "\t--------------Duplicated Topic Creation Test------------");
         String topic = mTopicPrefix + "DuplicateTest";
         // create topic
         CreateTopic(mMockDevice, topic);
@@ -352,8 +354,8 @@ public class MQBrokerResourceTest {
     // duplicate subtopic creation
     public void testDuplicatedSubtopicCreateOnDefaultRequestReceived()
             throws Exception {
-        System.out
-                .println("\t--------------Duplicated Subtopic Creation Test------------");
+        System.out.println(
+                "\t--------------Duplicated Subtopic Creation Test------------");
 
         String topic = mTopicPrefix + "DuplicateTest2";
 
@@ -372,8 +374,8 @@ public class MQBrokerResourceTest {
     // publish not created topic
     public void testNotCreatedTopicPublishOnDefaultRequestReceived()
             throws Exception {
-        System.out
-                .println("\t--------------Not Created Topic Publish Test------------");
+        System.out.println(
+                "\t--------------Not Created Topic Publish Test------------");
         String topic = mTopicPrefix + "NotCreatedTopicTest";
         // publish not created topic
         PublishTopic(mMockDevice, topic);
@@ -383,8 +385,8 @@ public class MQBrokerResourceTest {
     // subscribe not created topic
     public void testNotCreatedTopicSubscribeOnDefaultRequestReceived()
             throws Exception {
-        System.out
-                .println("\t--------------Not Created Topic Subscribe Test------------");
+        System.out.println(
+                "\t--------------Not Created Topic Subscribe Test------------");
         String topic = mTopicPrefix + "NotCreatedTopicSubscribeTest";
         SubscribeTopic(mMockDevice, topic, Observe.SUBSCRIBE);
     }
@@ -393,16 +395,16 @@ public class MQBrokerResourceTest {
     // unsubscribe not created topic
     public void testNotCreatedTopicUnSubscribeOnDefaultRequestReceived()
             throws Exception {
-        System.out
-                .println("\t--------------Not Created Topic Unsubscribe Test------------");
+        System.out.println(
+                "\t--------------Not Created Topic Unsubscribe Test------------");
         String topic = mTopicPrefix + "NotCreatedTopicUnSubscribeTest";
         SubscribeTopic(mMockDevice, topic, Observe.UNSUBSCRIBE);
     }
 
     @Test(expected = PreconditionFailedException.class)
     public void testTopicPublishWithoutMessage() throws Exception {
-        System.out
-                .println("\t--------------Topic Publish Without Message Test------------");
+        System.out.println(
+                "\t--------------Topic Publish Without Message Test------------");
         String topic = mTopicPrefix + "ForPubWithoutMessage";
 
         // topic creation
@@ -420,8 +422,8 @@ public class MQBrokerResourceTest {
     // create subtopic under not created maintopic
     public void testSubTopicCreateUnderNotCreatedTopicOnDefaultRequestReceived()
             throws Exception {
-        System.out
-                .println("\t--------------Create Subtopic under Not Created Maintopic  ------------");
+        System.out.println(
+                "\t--------------Create Subtopic under Not Created Maintopic  ------------");
         String mainTopic = mTopicPrefix + "NotCreatedMain";
         String subTopic = mTopicPrefix + "NotCreatedSub";
         // create sub topic
@@ -432,8 +434,8 @@ public class MQBrokerResourceTest {
     // create topic which has 'core.light' rt
     public void testTopicCreationWithRtOnDefaultRequestReceived()
             throws Exception {
-        System.out
-                .println("\t--------------Topic Creation with RT Test------------");
+        System.out.println(
+                "\t--------------Topic Creation with RT Test------------");
         String topicName = mTopicPrefix + "RtTest";
         String rt = "rt=core.light";
         CreateTopicWithRt(mMockDevice, topicName, rt);
@@ -445,8 +447,8 @@ public class MQBrokerResourceTest {
     // create topic which has 'core.light' rt
     public void testSubtopicCreationWithRtOnDefaultRequestReceived()
             throws Exception {
-        System.out
-                .println("\t--------------Subtopic Creation with RT Test------------");
+        System.out.println(
+                "\t--------------Subtopic Creation with RT Test------------");
         String topicName = mTopicPrefix + "RtTest2";
         String rt = "rt=core.light";
 
@@ -464,8 +466,8 @@ public class MQBrokerResourceTest {
     // test discover request with rt
     public void testDiscoverTopicWithRtOnDefaultRequestReceived()
             throws Exception {
-        System.out
-                .println("\t--------------Topic Discover with Rt Test------------");
+        System.out.println(
+                "\t--------------Topic Discover with Rt Test------------");
         String topicName = mTopicPrefix + "DiscoverRtTest";
         String topicNameWithoutRt = mTopicPrefix + "DiscoverRtTestWithoutRt";
         String rt = "rt=core.light";
@@ -485,9 +487,9 @@ public class MQBrokerResourceTest {
         ArrayList<String> topicList = payloadData.get("topiclist");
         System.out.println("\ttopicList : " + topicList);
         assertTrue(methodCheck(mResponse, ResponseStatus.CONTENT));
-        assertTrue(topicList.contains("/.well-known/ocf/ps/" + topicName));
-        assertFalse(topicList.contains("/.well-known/ocf/ps/"
-                + topicNameWithoutRt));
+        assertTrue(topicList.contains(MQ_BROKER_URI + "/" + topicName));
+        assertFalse(
+                topicList.contains(MQ_BROKER_URI + "/" + topicNameWithoutRt));
     }
 
     private IRequest PublishTopicRequest(String topicName) {
@@ -507,12 +509,13 @@ public class MQBrokerResourceTest {
 
     private IRequest CreateTopicRequest(String topicName) {
         IRequest request = null;
-        request = MessageBuilder.createRequest(RequestMethod.PUT, MQ_BROKER_URI
-                + "/" + topicName, null);
+        request = MessageBuilder.createRequest(RequestMethod.PUT,
+                MQ_BROKER_URI + "/" + topicName, null);
         return request;
     }
 
-    private IRequest CreateSubTopicRequest(String topicName, String subTopicName) {
+    private IRequest CreateSubTopicRequest(String topicName,
+            String subTopicName) {
         IRequest request = null;
         String uri = MQ_BROKER_URI + "/" + topicName + "/" + subTopicName;
         request = MessageBuilder.createRequest(RequestMethod.PUT, uri, null);
@@ -521,8 +524,8 @@ public class MQBrokerResourceTest {
 
     private IRequest CreateTopicWithRtRequest(String topicName, String type) {
         IRequest request = null;
-        request = MessageBuilder.createRequest(RequestMethod.PUT, MQ_BROKER_URI
-                + "/" + topicName, type);
+        request = MessageBuilder.createRequest(RequestMethod.PUT,
+                MQ_BROKER_URI + "/" + topicName, type);
         return request;
     }
 
@@ -542,15 +545,15 @@ public class MQBrokerResourceTest {
 
     private IRequest DiscoverTopicRequest() {
         IRequest request = null;
-        request = MessageBuilder.createRequest(RequestMethod.GET,
-                MQ_BROKER_URI, null);
+        request = MessageBuilder.createRequest(RequestMethod.GET, MQ_BROKER_URI,
+                null);
         return request;
     }
 
     private IRequest DiscoverTopicWithRtRequest(String rt) {
         IRequest request = null;
-        request = MessageBuilder.createRequest(RequestMethod.GET,
-                MQ_BROKER_URI, rt);
+        request = MessageBuilder.createRequest(RequestMethod.GET, MQ_BROKER_URI,
+                rt);
         return request;
     }
 
@@ -647,8 +650,8 @@ public class MQBrokerResourceTest {
 
     private boolean hashmapCheck(IResponse response, String propertyName) {
         Cbor<HashMap<String, Object>> mCbor = new Cbor<>();
-        HashMap<String, Object> payloadData = mCbor.parsePayloadFromCbor(
-                response.getPayload(), HashMap.class);
+        HashMap<String, Object> payloadData = mCbor
+                .parsePayloadFromCbor(response.getPayload(), HashMap.class);
         if (payloadData.get(propertyName) != null)
             return true;
         else
index b32e718..04e4673 100644 (file)
@@ -24,9 +24,9 @@ package org.iotivity.cloud.rdserver;
 import java.util.Arrays;
 import java.util.List;
 
-import org.iotivity.cloud.base.OCFConstants;
+import org.iotivity.cloud.base.OICConstants;
 
-public class Constants extends OCFConstants {
+public class Constants extends OICConstants {
 
     public static final String       RD_DB_NAME              = "RD_DB";
     public static final String       RD_TABLE                = "RD_TABLE";
index eab6bf8..6a085be 100644 (file)
@@ -62,7 +62,7 @@ public class DevicePresenceResource extends Resource {
     private HashMap<String, List<String>>                        mSubscribedDevices = null;
 
     public DevicePresenceResource() {
-        super(Arrays.asList(Constants.PREFIX_WELL_KNOWN, Constants.PREFIX_OCF,
+        super(Arrays.asList(Constants.PREFIX_OIC,
                 Constants.DEVICE_PRESENCE_URI));
 
         mDeviceSubscriber = new HashMap<>();
index 0565f81..7859888 100644 (file)
@@ -2,6 +2,7 @@ package org.iotivity.cloud.testrdserver;
 
 import java.util.ArrayList;
 import java.util.HashMap;
+
 import org.iotivity.cloud.base.protocols.IRequest;
 import org.iotivity.cloud.base.protocols.MessageBuilder;
 import org.iotivity.cloud.base.protocols.enums.ContentFormat;
@@ -12,10 +13,10 @@ import org.iotivity.cloud.util.Cbor;
 
 public class RDServerTestUtils {
     public static final String DI                 = "98f7483c-5a31-4161-ba7e-9c13e0d";
-    public static final String RD_REQ_URI         = "/oic/rd";
-    public static final String DISCOVERY_REQ_URI  = "/oic/res";
-    public static final String DEVICE_PRS_REQ_URI = "/.well-known/ocf/prs";
-    public static final String RES_PRS_URI        = "/oic/ad";
+    public static final String RD_REQ_URI         = Constants.RD_FULL_URI;
+    public static final String DISCOVERY_REQ_URI  = Constants.WELL_KNOWN_FULL_URI;
+    public static final String DEVICE_PRS_REQ_URI = Constants.DEVICE_PRESENCE_FULL_URI;
+    public static final String RES_PRS_URI        = Constants.RESOURCE_PRESENCE_FULL_URI;
 
     public static IRequest makePublishRequest() throws Exception {
         HashMap<Object, Object> payload = new HashMap<>();
diff --git a/cloud/stack/src/main/java/org/iotivity/cloud/base/OCFConstants.java b/cloud/stack/src/main/java/org/iotivity/cloud/base/OCFConstants.java
deleted file mode 100755 (executable)
index 282a35f..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * //******************************************************************
- * //
- * // Copyright 2016 Samsung Electronics All Rights Reserved.
- * //
- * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- * //
- * // Licensed under the Apache License, Version 2.0 (the "License");
- * // you may not use this file except in compliance with the License.
- * // You may obtain a copy of the License at
- * //
- * //      http://www.apache.org/licenses/LICENSE-2.0
- * //
- * // Unless required by applicable law or agreed to in writing, software
- * // distributed under the License is distributed on an "AS IS" BASIS,
- * // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * // See the License for the specific language governing permissions and
- * // limitations under the License.
- * //
- * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- */
-package org.iotivity.cloud.base;
-
-public class OCFConstants {
-    /* resource Interface for keep-alive */
-    public static final String DEFAULT_INTERFACE   = "oic.if.baseline";
-
-    public static final String LINK_INTERFACE      = "oic.if.ll";
-
-    public static final String PREFIX_WELL_KNOWN   = ".well-known";
-
-    public static final String PREFIX_OCF          = "ocf";
-
-    public static final String PREFIX_OIC          = "oic";
-
-    public static final String RS_INTERFACE        = "if";
-
-    /* resource url for account */
-    public static final String ACCOUNT_URI         = "account";
-
-    public static final String SESSION_URI         = "session";
-
-    public static final String DEVICE_URI          = "device";
-
-    public static final String TOKEN_REFRESH_URI   = "tokenrefresh";
-
-    /* resource url for acl */
-    public static final String CREDPROV_URI        = "credprov";
-
-    public static final String CERT_URI            = "cert";
-
-    /* resource url for acl */
-    public static final String ACL_URI             = "acl";
-
-    public static final String GROUP_URI           = "group";
-
-    public static final String VERIFY_URI          = "verify";
-
-    public static final String ID_URI              = "id";
-
-    public static final String INVITE_URI          = "invite";
-
-    /* resource uri to publish, update, delete resource info */
-    public static final String RD_URI              = "rd";
-
-    /* resource uri for keep-alive */
-    public static final String KEEP_ALIVE_URI      = "ping";
-
-    /* resource uri to discover resource info */
-    public static final String WELL_KNOWN_URI      = "res";
-
-    /* resource uri for resource presence */
-    public static final String RES_PRESENCE_URI    = "ad";
-
-    /* resource uri for device presence */
-    public static final String DEVICE_PRESENCE_URI = "prs";
-
-    /* resource uri for message queue */
-    public static final String MQ_BROKER_URI       = "ps";
-
-    /* file path for tls communication - Modify filePath to yours */
-    public static final String ROOT_CERT_FILE      = "./rootca.crt";
-
-    public static final String CLOUD_CERT_FILE     = "./iotivitycloud.crt";
-
-    public static final String CLOUD_KEY_FILE      = "./iotivitycloud.key";
-
-    /* cloud uuid */
-    public static final String CLOUD_UUID          = "2a6085d1-815d-4277-baba-4e4e4df91308";
-
-    public static final String ACCOUNT_FULL_URI              = "/"
-            + PREFIX_WELL_KNOWN + "/" + OCFConstants.PREFIX_OCF + "/"
-            + OCFConstants.ACCOUNT_URI;
-
-    public static final String ACCOUNT_SESSION_FULL_URI      = "/"
-            + PREFIX_WELL_KNOWN + "/" + OCFConstants.PREFIX_OCF + "/"
-            + OCFConstants.ACCOUNT_URI + "/" + OCFConstants.SESSION_URI;
-
-    public static final String ACCOUNT_TOKENREFRESH_FULL_URI = "/"
-            + PREFIX_WELL_KNOWN + "/" + OCFConstants.PREFIX_OCF + "/"
-            + OCFConstants.ACCOUNT_URI + "/" + OCFConstants.TOKEN_REFRESH_URI;
-
-    public static final String KEEP_ALIVE_FULL_URI           = "/" + PREFIX_OIC
-            + "/" + OCFConstants.KEEP_ALIVE_URI;
-}
diff --git a/cloud/stack/src/main/java/org/iotivity/cloud/base/OICConstants.java b/cloud/stack/src/main/java/org/iotivity/cloud/base/OICConstants.java
new file mode 100755 (executable)
index 0000000..59b8938
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * //******************************************************************
+ * //
+ * // Copyright 2016 Samsung Electronics All Rights Reserved.
+ * //
+ * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+ * //
+ * // Licensed under the Apache License, Version 2.0 (the "License");
+ * // you may not use this file except in compliance with the License.
+ * // You may obtain a copy of the License at
+ * //
+ * //      http://www.apache.org/licenses/LICENSE-2.0
+ * //
+ * // Unless required by applicable law or agreed to in writing, software
+ * // distributed under the License is distributed on an "AS IS" BASIS,
+ * // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * // See the License for the specific language governing permissions and
+ * // limitations under the License.
+ * //
+ * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+ */
+package org.iotivity.cloud.base;
+
+public class OICConstants {
+    /* resource Interface for keep-alive */
+    public static final String DEFAULT_INTERFACE             = "oic.if.baseline";
+
+    public static final String LINK_INTERFACE                = "oic.if.ll";
+
+    public static final String PREFIX_OIC                    = "oic";
+
+    public static final String RS_INTERFACE                  = "if";
+
+    /* resource url for account */
+    public static final String ACCOUNT_URI                   = "account";
+
+    public static final String SESSION_URI                   = "session";
+
+    public static final String DEVICE_URI                    = "device";
+
+    public static final String TOKEN_REFRESH_URI             = "tokenrefresh";
+
+    /* resource url for acl */
+    public static final String CREDPROV_URI                  = "credprov";
+
+    public static final String CERT_URI                      = "cert";
+
+    /* resource url for acl */
+    public static final String ACL_URI                       = "acl";
+
+    public static final String GROUP_URI                     = "group";
+
+    public static final String VERIFY_URI                    = "verify";
+
+    public static final String ID_URI                        = "id";
+
+    public static final String INVITE_URI                    = "invite";
+
+    /* resource uri to publish, update, delete resource info */
+    public static final String RD_URI                        = "rd";
+
+    /* resource uri for keep-alive */
+    public static final String KEEP_ALIVE_URI                = "ping";
+
+    /* resource uri to discover resource info */
+    public static final String WELL_KNOWN_URI                = "res";
+
+    /* resource uri for resource presence */
+    public static final String RES_PRESENCE_URI              = "ad";
+
+    /* resource uri for device presence */
+    public static final String DEVICE_PRESENCE_URI           = "prs";
+
+    /* resource uri for message queue */
+    public static final String MQ_BROKER_URI                 = "ps";
+
+    /* file path for tls communication - Modify filePath to yours */
+    public static final String ROOT_CERT_FILE                = "./rootca.crt";
+
+    public static final String CLOUD_CERT_FILE               = "./iotivitycloud.crt";
+
+    public static final String CLOUD_KEY_FILE                = "./iotivitycloud.key";
+
+    /* cloud uuid */
+    public static final String CLOUD_UUID                    = "2a6085d1-815d-4277-baba-4e4e4df91308";
+
+    public static final String ACCOUNT_FULL_URI              = "/"
+            + OICConstants.PREFIX_OIC + "/" + OICConstants.ACCOUNT_URI;
+
+    public static final String ACCOUNT_SESSION_FULL_URI      = "/"
+            + OICConstants.PREFIX_OIC + "/" + OICConstants.ACCOUNT_URI + "/"
+            + OICConstants.SESSION_URI;
+
+    public static final String ACCOUNT_TOKENREFRESH_FULL_URI = "/"
+            + OICConstants.PREFIX_OIC + "/" + OICConstants.ACCOUNT_URI + "/"
+            + OICConstants.TOKEN_REFRESH_URI;
+
+    public static final String GROUP_FULL_URI                = "/"
+            + OICConstants.PREFIX_OIC + "/" + OICConstants.ACL_URI + "/"
+            + OICConstants.GROUP_URI;
+
+    public static final String INVITE_FULL_URI               = "/"
+            + OICConstants.PREFIX_OIC + "/" + OICConstants.ACL_URI + "/"
+            + OICConstants.INVITE_URI;
+
+    public static final String KEEP_ALIVE_FULL_URI           = "/" + PREFIX_OIC
+            + "/" + OICConstants.KEEP_ALIVE_URI;
+
+    public static final String MQ_BROKER_FULL_URI            = "/"
+            + OICConstants.PREFIX_OIC + "/" + OICConstants.MQ_BROKER_URI;
+
+    public static final String RD_FULL_URI                   = "/"
+            + OICConstants.PREFIX_OIC + "/" + OICConstants.RD_URI;
+
+    public static final String WELL_KNOWN_FULL_URI           = "/"
+            + OICConstants.PREFIX_OIC + "/" + OICConstants.WELL_KNOWN_URI;
+
+    public static final String RESOURCE_PRESENCE_FULL_URI    = "/"
+            + OICConstants.PREFIX_OIC + "/" + OICConstants.RES_PRESENCE_URI;
+
+    public static final String DEVICE_PRESENCE_FULL_URI      = "/"
+            + OICConstants.PREFIX_OIC + "/" + OICConstants.DEVICE_PRESENCE_URI;
+}
index 7b1d49e..6feb5cb 100644 (file)
@@ -23,6 +23,7 @@ package org.iotivity.cloud.base.connector;
 
 import java.util.HashMap;
 
+import org.iotivity.cloud.base.OICConstants;
 import org.iotivity.cloud.base.device.IRequestChannel;
 import org.iotivity.cloud.base.device.IResponseEventHandler;
 import org.iotivity.cloud.base.exception.ClientException;
@@ -90,7 +91,8 @@ public class CoapClient implements IRequestChannel, IResponseEventHandler {
                 default:
                     // We create temp token
                     // TODO: temporal handling
-                    if (request.getUriPath().equals("/oic/ad")) {
+                    if (request.getUriPath()
+                            .equals(OICConstants.RESOURCE_PRESENCE_FULL_URI)) {
                         mSubscription.put(Bytes.bytesToLong(token), newToken);
                         observe = Observe.SUBSCRIBE;
                     }
index bba5344..1efeb46 100644 (file)
@@ -29,7 +29,7 @@ import java.util.List;
 
 import javax.net.ssl.SSLException;
 
-import org.iotivity.cloud.base.OCFConstants;
+import org.iotivity.cloud.base.OICConstants;
 import org.iotivity.cloud.base.protocols.coap.CoapDecoder;
 import org.iotivity.cloud.base.protocols.coap.CoapEncoder;
 import org.iotivity.cloud.base.protocols.coap.CoapLogHandler;
@@ -146,7 +146,7 @@ public class CoapConnector {
         if (tlsMode == true) {
             initializer.setTlsMode(true);
             initializer.setInetSocketAddress(inetSocketAddress);
-            initializer.setRootCertFilePath(OCFConstants.ROOT_CERT_FILE);
+            initializer.setRootCertFilePath(OICConstants.ROOT_CERT_FILE);
         }
 
         initializer.addHandler(new CoapPacketHandler());
index d8d3844..0f920eb 100644 (file)
@@ -29,7 +29,7 @@ import java.util.List;
 
 import javax.net.ssl.SSLException;
 
-import org.iotivity.cloud.base.OCFConstants;
+import org.iotivity.cloud.base.OICConstants;
 import org.iotivity.cloud.util.Log;
 
 import io.netty.bootstrap.ServerBootstrap;
@@ -96,9 +96,9 @@ public abstract class Server {
 
             if (tlsMode == true) {
 
-                File serverCert = new File(OCFConstants.CLOUD_CERT_FILE);
+                File serverCert = new File(OICConstants.CLOUD_CERT_FILE);
 
-                File serverKey = new File(OCFConstants.CLOUD_KEY_FILE);
+                File serverKey = new File(OICConstants.CLOUD_KEY_FILE);
 
                 mSslContext = SslContextBuilder.forServer(serverCert, serverKey)
                         .build();