airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/7] airavata git commit: moving registry code from API server to registry server
Date Tue, 09 Aug 2016 21:24:38 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 0e14f97fd -> 25ffe3434


http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/client/RegistryServiceClientFactory.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/client/RegistryServiceClientFactory.java
b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/client/RegistryServiceClientFactory.java
new file mode 100644
index 0000000..b98ef96
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/client/RegistryServiceClientFactory.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.airavata.registry.api.client;
+
+import org.apache.airavata.registry.api.RegistryService;
+import org.apache.airavata.registry.api.exception.RegistryServiceException;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSocket;
+import org.apache.thrift.transport.TTransport;
+import org.apache.thrift.transport.TTransportException;
+
+public class RegistryServiceClientFactory {
+
+    public static RegistryService.Client createRegistryClient(String serverHost, int serverPort)
 throws RegistryServiceException {
+        try {
+            TTransport transport = new TSocket(serverHost, serverPort);
+            transport.open();
+            TProtocol protocol = new TBinaryProtocol(transport);
+            return new RegistryService.Client(protocol);
+        } catch (TTransportException e) {
+        	throw new RegistryServiceException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/exception/RegistryServiceException.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/exception/RegistryServiceException.java
b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/exception/RegistryServiceException.java
index 8a40fe3..b7ed6b0 100644
--- a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/exception/RegistryServiceException.java
+++ b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/exception/RegistryServiceException.java
@@ -50,7 +50,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-08")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-09")
 public class RegistryServiceException extends TException implements org.apache.thrift.TBase<RegistryServiceException,
RegistryServiceException._Fields>, java.io.Serializable, Cloneable, Comparable<RegistryServiceException>
{
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RegistryServiceException");
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/thrift-interface-descriptions/component-cpis/registry-api.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/component-cpis/registry-api.thrift b/thrift-interface-descriptions/component-cpis/registry-api.thrift
index 825b30a..10a16a3 100644
--- a/thrift-interface-descriptions/component-cpis/registry-api.thrift
+++ b/thrift-interface-descriptions/component-cpis/registry-api.thrift
@@ -293,9 +293,10 @@ service RegistryService {
         list<workspace_model.Project> searchProjects(
                                     1: required string gatewayId,
                                     2: required string userName,
-                                    3: map<experiment_model.ProjectSearchFields, string>
filters,
-                                    4: required i32 limit,
-                                    5: required i32 offset)
+                                    3: required list<string> accessibleProjIds,
+                                    4: map<experiment_model.ProjectSearchFields, string>
filters,
+                                    5: required i32 limit,
+                                    6: required i32 offset)
                         throws (1: registry_api_errors.RegistryServiceException rse)
 
 
@@ -326,9 +327,10 @@ service RegistryService {
 
             list<experiment_model.ExperimentSummaryModel> searchExperiments(1: required
string gatewayId,
                                     2: required string userName,
-                                    3: map<experiment_model.ExperimentSearchFields, string>
filters,
-                                    4: required i32 limit,
-                                    5: required i32 offset)
+                                    3: required list<string> accessibleExpIds,
+                                    4: map<experiment_model.ExperimentSearchFields, string>
filters,
+                                    5: required i32 limit,
+                                    6: required i32 offset)
                         throws (1: registry_api_errors.RegistryServiceException rse)
 
             /**


Mime
View raw message