cloud server crl 1.2.0+RC3 1.2.0-RC3 sandbox/pcoval/1.2.0+RC3
authorOleksandr Dmytrenko <o.dmytrenko@samsung.com>
Fri, 30 Sep 2016 08:34:01 +0000 (11:34 +0300)
committerRandeep Singh <randeep.s@samsung.com>
Fri, 30 Sep 2016 09:35:54 +0000 (09:35 +0000)
Change-Id: Ic920258819ae8ebcc14592279c07b2069a6525ff
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12635
Reviewed-by: dongik Lee <dongik.lee@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
cloud/account/src/main/java/org/iotivity/cloud/accountserver/AccountServer.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/CloudInterfaceServer.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/account/Crl.java [new file with mode: 0644]

index d7a8164..a282d13 100644 (file)
@@ -31,6 +31,7 @@ import org.iotivity.cloud.accountserver.resources.acl.group.GroupResource;
 import org.iotivity.cloud.accountserver.resources.acl.id.AclResource;
 import org.iotivity.cloud.accountserver.resources.acl.invite.InviteResource;
 import org.iotivity.cloud.accountserver.resources.credprov.cert.CertificateResource;
+import org.iotivity.cloud.accountserver.resources.credprov.crl.CrlResource;
 import org.iotivity.cloud.base.ServerSystem;
 import org.iotivity.cloud.base.server.CoapServer;
 import org.iotivity.cloud.util.Log;
@@ -66,10 +67,14 @@ public class AccountServer {
 
         serverSystem.addResource(new CertificateResource());
 
+        serverSystem.addResource(new CrlResource());
+
+        serverSystem.addResource(new AclResource());
+
         serverSystem.addResource(new InviteResource());
 
-        serverSystem.addServer(new CoapServer(new InetSocketAddress(Integer
-                .parseInt(args[0]))));
+        serverSystem.addServer(new CoapServer(
+                new InetSocketAddress(Integer.parseInt(args[0]))));
 
         boolean tlsMode = Integer.parseInt(args[1]) == 1;
 
index e4395fd..f948771 100755 (executable)
@@ -35,6 +35,7 @@ import org.iotivity.cloud.ciserver.resources.proxy.account.Acl;
 import org.iotivity.cloud.ciserver.resources.proxy.account.AclGroup;
 import org.iotivity.cloud.ciserver.resources.proxy.account.AclInvite;
 import org.iotivity.cloud.ciserver.resources.proxy.account.Certificate;
+import org.iotivity.cloud.ciserver.resources.proxy.account.Crl;
 import org.iotivity.cloud.ciserver.resources.proxy.mq.MessageQueue;
 import org.iotivity.cloud.ciserver.resources.proxy.rd.DevicePresence;
 import org.iotivity.cloud.ciserver.resources.proxy.rd.ResourceDirectory;
@@ -42,12 +43,6 @@ import org.iotivity.cloud.ciserver.resources.proxy.rd.ResourceFind;
 import org.iotivity.cloud.ciserver.resources.proxy.rd.ResourcePresence;
 import org.iotivity.cloud.util.Log;
 
-/**
- *
- * This class is in charge of running of cloud interface server
- *
- */
-
 public class CloudInterfaceServer {
 
     public static void main(String[] args) throws Exception {
@@ -86,7 +81,7 @@ public class CloudInterfaceServer {
         AclGroup aclGroupHandler = new AclGroup();
         Certificate certHandler = new Certificate();
         AclInvite aclInviteHandler = new AclInvite();
-
+       Crl crlHandler = new Crl();
         CoapDevicePool devicePool = deviceServer.getDevicePool();
 
         deviceServer.addResource(acHandler);
@@ -111,6 +106,8 @@ public class CloudInterfaceServer {
 
         deviceServer.addResource(aclInviteHandler);
 
+       deviceServer.addResource(crlHandler);
+
         KeepAliveResource resKeepAlive = new KeepAliveResource(
                 new int[] { 1, 2, 4, 8 });
 
diff --git a/cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/account/Crl.java b/cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/proxy/account/Crl.java
new file mode 100644 (file)
index 0000000..0f679b8
--- /dev/null
@@ -0,0 +1,30 @@
+package org.iotivity.cloud.ciserver.resources.proxy.account;
+
+import java.util.Arrays;
+
+import org.iotivity.cloud.base.connector.ConnectorPool;
+import org.iotivity.cloud.base.device.Device;
+import org.iotivity.cloud.base.device.IRequestChannel;
+import org.iotivity.cloud.base.exception.ServerException;
+import org.iotivity.cloud.base.protocols.IRequest;
+import org.iotivity.cloud.base.resource.Resource;
+import org.iotivity.cloud.ciserver.Constants;
+
+public class Crl extends Resource {
+
+    private IRequestChannel mAuthServer = null;
+
+    public Crl() {
+        super(Arrays.asList(Constants.PREFIX_OIC,
+                Constants.CREDPROV_URI, Constants.REQ_CRL));
+
+        mAuthServer = ConnectorPool.getConnection("account");
+    }
+
+    @Override
+    public void onDefaultRequestReceived(Device srcDevice, IRequest request)
+            throws ServerException {
+        // Token exchange is done by CoapClient
+        mAuthServer.sendRequest(request, srcDevice);
+    }
+}
\ No newline at end of file