airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata git commit: setting domainid from domain name
Date Mon, 07 Aug 2017 19:18:03 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 0d9d15280 -> 92efa1b86


setting domainid from domain name


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/92efa1b8
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/92efa1b8
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/92efa1b8

Branch: refs/heads/develop
Commit: 92efa1b86fd135f4bfbdbb6b500f46490654e890
Parents: 0d9d152
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Mon Aug 7 15:17:58 2017 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Mon Aug 7 15:17:58 2017 -0400

----------------------------------------------------------------------
 .../server/SharingRegistryServerHandler.java    |  1 +
 .../airavata/sharing/registry/CipresTest.java   | 31 +++++++++++++++-----
 2 files changed, 25 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/92efa1b8/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
index c1fb86a..eea12a3 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
@@ -51,6 +51,7 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac
     @Override
     public String createDomain(Domain domain) throws SharingRegistryException, DuplicateEntryException,
TException {
         try{
+            domain.setDomainId(domain.getName());
             if((new DomainRepository()).get(domain.domainId) != null)
                 throw new DuplicateEntryException("There exist domain with given domain id");
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/92efa1b8/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/CipresTest.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/CipresTest.java
b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/CipresTest.java
index c33413b..cd6e3ff 100644
--- a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/CipresTest.java
+++ b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/CipresTest.java
@@ -19,12 +19,14 @@
  */
 package org.apache.airavata.sharing.registry;
 
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.sharing.registry.models.*;
 import org.apache.airavata.sharing.registry.service.cpi.SharingRegistryService;
 import org.apache.thrift.TException;
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.protocol.TProtocol;
-import org.apache.thrift.transport.TSocket;
+import org.apache.thrift.transport.TSSLTransportFactory;
 import org.apache.thrift.transport.TTransport;
 import org.apache.thrift.transport.TTransportException;
 
@@ -32,19 +34,34 @@ import java.util.ArrayList;
 import java.util.Arrays;
 
 public class CipresTest {
-    public static void main(String[] args) throws InterruptedException {
+    public static void main(String[] args) throws InterruptedException, TException, ApplicationSettingsException
{
         System.out.println("Hello World!");
         //should use the correct host name and port here
         String serverHost = "wb-airavata.scigap.org";
 
         int serverPort = 7878;
         TTransport transport = null;
-
+        TProtocol protocol = null;
         try {
-            transport = new TSocket(serverHost, serverPort);
-            transport.open();
-            TProtocol protocol = new TBinaryProtocol(transport);
-            SharingRegistryService.Client sharingServiceClient = new SharingRegistryService.Client(protocol);
+
+            SharingRegistryService.Client sharingServiceClient;
+
+            //Non Secure Client
+//            transport = new TSocket(serverHost, serverPort);
+//            transport.open();
+//            protocol = new TBinaryProtocol(transport);
+//            sharingServiceClient= new SharingRegistryService.Client(protocol);
+
+            //TLS enabled client
+            TSSLTransportFactory.TSSLTransportParameters params =
+                    new TSSLTransportFactory.TSSLTransportParameters();
+            params.setKeyStore(ServerSettings.getKeyStorePath(), ServerSettings.getKeyStorePassword());
+            params.setTrustStore(ServerSettings.getTrustStorePath(), ServerSettings.getTrustStorePassword());
+            transport = TSSLTransportFactory.getClientSocket(serverHost, serverPort, 10000,
params);
+            protocol = new TBinaryProtocol(transport);
+            sharingServiceClient = new SharingRegistryService.Client(protocol);
+
+
             try {
                 sharingServiceClient.deleteDomain("test-domain");
             } catch (SharingRegistryException sre1) {


Mime
View raw message