You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/08/09 21:24:38 UTC
[1/7] airavata git commit: moving registry code from API server to
registry server
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)
/**
[3/7] airavata git commit: moving registry code from API server to
registry server
Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
index 7e2eb29..948f9ba 100644
--- a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
@@ -20,6 +20,7 @@
*/
package org.apache.airavata.registry.api.service.handler;
+import org.apache.airavata.common.utils.AiravataUtils;
import org.apache.airavata.model.WorkflowModel;
import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
@@ -35,36 +36,47 @@ import org.apache.airavata.model.data.movement.DMType;
import org.apache.airavata.model.data.movement.*;
import org.apache.airavata.model.data.replica.DataProductModel;
import org.apache.airavata.model.data.replica.DataReplicaLocationModel;
-import org.apache.airavata.model.error.AiravataClientException;
-import org.apache.airavata.model.error.AiravataSystemException;
-import org.apache.airavata.model.error.ExperimentNotFoundException;
-import org.apache.airavata.model.error.InvalidRequestException;
+import org.apache.airavata.model.error.*;
import org.apache.airavata.model.experiment.*;
import org.apache.airavata.model.job.JobModel;
+import org.apache.airavata.model.process.ProcessModel;
import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel;
+import org.apache.airavata.model.status.ExperimentState;
import org.apache.airavata.model.status.ExperimentStatus;
import org.apache.airavata.model.status.JobStatus;
+import org.apache.airavata.model.task.TaskModel;
import org.apache.airavata.model.workspace.Gateway;
import org.apache.airavata.model.workspace.Notification;
import org.apache.airavata.model.workspace.Project;
import org.apache.airavata.registry.api.RegistryService;
import org.apache.airavata.registry.api.exception.RegistryServiceException;
+import org.apache.airavata.registry.api.registry_apiConstants;
+import org.apache.airavata.registry.core.app.catalog.resources.*;
+import org.apache.airavata.registry.core.app.catalog.util.AppCatalogThriftConversion;
+import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
+import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
+import org.apache.airavata.registry.cpi.*;
+import org.apache.airavata.registry.cpi.utils.Constants;
import org.apache.thrift.TException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
public class RegistryServerHandler implements RegistryService.Iface {
private final static Logger logger = LoggerFactory.getLogger(RegistryServerHandler.class);
+ private ExperimentCatalog experimentCatalog;
+ private AppCatalog appCatalog;
+ private ReplicaCatalog dataCatalog;
+ private WorkflowCatalog workflowCatalog;
+
/**
* Fetch Apache Registry API version
*/
@Override
public String getAPIVersion() throws RegistryServiceException, TException {
- return null;
+ return registry_apiConstants.REGISTRY_API_VERSION;
}
/**
@@ -76,7 +88,14 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean isUserExists(String gatewayId, String userName) throws RegistryServiceException, TException {
- return false;
+ try {
+ return ExpCatResourceUtils.isUserExist(userName, gatewayId);
+ } catch (RegistryException e) {
+ logger.error("Error while verifying user", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while verifying user. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -88,7 +107,14 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<String> getAllUsersInGateway(String gatewayId) throws RegistryServiceException, TException {
- return null;
+ try {
+ return ExpCatResourceUtils.getAllUsersInGateway(gatewayId);
+ } catch (RegistryException e) {
+ logger.error("Error while retrieving users", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving users. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -100,7 +126,23 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public Gateway getGateway(String gatewayId) throws RegistryServiceException, TException {
- return null;
+ try {
+ experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
+ if (!experimentCatalog.isExist(ExperimentCatalogModelType.GATEWAY, gatewayId)){
+ logger.error("Gateway does not exist in the system. Please provide a valid gateway ID...");
+ AiravataSystemException exception = new AiravataSystemException();
+ exception.setMessage("Gateway does not exist in the system. Please provide a valid gateway ID...");
+ throw exception;
+ }
+ Gateway gateway = (Gateway) experimentCatalog.get(ExperimentCatalogModelType.GATEWAY, gatewayId);
+ logger.debug("Airavata retrieved gateway with gateway id : " + gateway.getGatewayId());
+ return gateway;
+ } catch (RegistryException e) {
+ logger.error("Error while getting the gateway", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while getting the gateway. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -112,7 +154,23 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteGateway(String gatewayId) throws RegistryServiceException, TException {
- return false;
+ try {
+ experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
+ if (!experimentCatalog.isExist(ExperimentCatalogModelType.GATEWAY, gatewayId)){
+ logger.error("Gateway does not exist in the system. Please provide a valid gateway ID...");
+ AiravataSystemException exception = new AiravataSystemException();
+ exception.setMessage("Gateway does not exist in the system. Please provide a valid gateway ID...");
+ throw exception;
+ }
+ experimentCatalog.remove(ExperimentCatalogModelType.GATEWAY, gatewayId);
+ logger.debug("Airavata deleted gateway with gateway id : " + gatewayId);
+ return true;
+ } catch (RegistryException e) {
+ logger.error("Error while deleting the gateway", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while deleting the gateway. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -120,7 +178,21 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<Gateway> getAllGateways() throws RegistryServiceException, TException {
- return null;
+ try {
+ List<Gateway> gateways = new ArrayList<Gateway>();
+ experimentCatalog = RegistryFactory.getDefaultExpCatalog();
+ List<Object> list = experimentCatalog.get(ExperimentCatalogModelType.GATEWAY, null, null);
+ for (Object gateway : list){
+ gateways.add((Gateway)gateway);
+ }
+ logger.debug("Airavata retrieved all available gateways...");
+ return gateways;
+ } catch (RegistryException e) {
+ logger.error("Error while getting all the gateways", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while getting all the gateways. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -132,22 +204,59 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean isGatewayExist(String gatewayId) throws RegistryServiceException, TException {
- return false;
+ try {
+ experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
+ return experimentCatalog.isExist(ExperimentCatalogModelType.GATEWAY, gatewayId);
+ } catch (RegistryException e) {
+ logger.error("Error while getting gateway", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while getting gateway. More info : " + e.getMessage());
+ throw exception;
+ }
}
@Override
public boolean deleteNotification(String gatewayId, String notificationId) throws RegistryServiceException, TException {
- return false;
+ try {
+ experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
+ experimentCatalog.remove(ExperimentCatalogModelType.NOTIFICATION, notificationId);
+ return true;
+ } catch (RegistryException e) {
+ logger.error("Error while deleting notification", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while deleting notification. More info : " + e.getMessage());
+ throw exception;
+ }
}
@Override
public Notification getNotification(String gatewayId, String notificationId) throws RegistryServiceException, TException {
- return null;
+ try {
+ experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
+ return (Notification)experimentCatalog.get(ExperimentCatalogModelType.NOTIFICATION, notificationId);
+ } catch (RegistryException e) {
+ logger.error("Error while retrieving notification", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retreiving notification. More info : " + e.getMessage());
+ throw exception;
+ }
}
@Override
public List<Notification> getAllNotifications(String gatewayId) throws RegistryServiceException, TException {
- return null;
+ try {
+ experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
+ List<Object> objectList = experimentCatalog.get(ExperimentCatalogModelType.NOTIFICATION, null, gatewayId);
+ List<Notification> notifications = new ArrayList<>();
+ for(Object o : objectList)
+ notifications.add((Notification) o);
+ return notifications;
+ } catch (RegistryException e) {
+ logger.error("Error while getting all notifications", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while getting all notifications. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -160,7 +269,24 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public Project getProject(String projectId) throws RegistryServiceException, TException {
- return null;
+ try {
+ experimentCatalog = RegistryFactory.getDefaultExpCatalog();
+ if (!experimentCatalog.isExist(ExperimentCatalogModelType.PROJECT, projectId)){
+ logger.error("Project does not exist in the system. Please provide a valid project ID...");
+ ProjectNotFoundException exception = new ProjectNotFoundException();
+ exception.setMessage("Project does not exist in the system. Please provide a valid project ID...");
+ throw exception;
+ }
+ logger.debug("Airavata retrieved project with project Id : " + projectId );
+
+ Project project = (Project) experimentCatalog.get(ExperimentCatalogModelType.PROJECT, projectId);
+ return project;
+ } catch (RegistryException e) {
+ logger.error("Error while retrieving the project", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving the project. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -175,7 +301,24 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteProject(String projectId) throws RegistryServiceException, TException {
- return false;
+ try {
+ experimentCatalog = RegistryFactory.getDefaultExpCatalog();
+ if (!experimentCatalog.isExist(ExperimentCatalogModelType.PROJECT, projectId)) {
+ logger.error("Project does not exist in the system. Please provide a valid project ID...");
+ ProjectNotFoundException exception = new ProjectNotFoundException();
+ exception.setMessage("Project does not exist in the system. Please provide a valid project ID...");
+ throw exception;
+ }
+
+ experimentCatalog.remove(ExperimentCatalogModelType.PROJECT, projectId);
+ logger.debug("Airavata deleted project with project Id : " + projectId );
+ return true;
+ } catch (RegistryException e) {
+ logger.error("Error while removing the project", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while removing the project. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -189,7 +332,44 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<Project> getUserProjects(String gatewayId, String userName, int limit, int offset) throws RegistryServiceException, TException {
- return null;
+ if (!validateString(userName)){
+ logger.error("Username cannot be empty. Please provide a valid user..");
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Username cannot be empty. Please provide a valid user..");
+ throw exception;
+ }
+ if (!isGatewayExistInternal(gatewayId)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ List<Project> projects = new ArrayList<Project>();
+ try {
+ if (!ExpCatResourceUtils.isUserExist(userName, gatewayId)){
+ logger.error("User does not exist in the system. Please provide a valid user..");
+ AiravataSystemException exception = new AiravataSystemException();
+ exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage("User does not exist in the system. Please provide a valid user..");
+ throw exception;
+ }
+ experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
+ Map<String, String> filters = new HashMap<String, String>();
+ filters.put(Constants.FieldConstants.ProjectConstants.OWNER, userName);
+ filters.put(Constants.FieldConstants.ProjectConstants.GATEWAY_ID, gatewayId);
+ List<Object> list = experimentCatalog.search(ExperimentCatalogModelType.PROJECT, filters, limit, offset,
+ Constants.FieldConstants.ProjectConstants.CREATION_TIME, ResultOrderType.DESC);
+ if (list != null && !list.isEmpty()){
+ for (Object o : list){
+ projects.add((Project) o);
+ }
+ }
+ logger.debug("Airavata retrieved projects for user : " + userName + " and gateway id : " + gatewayId );
+ return projects;
+ } catch (RegistryException e) {
+ logger.error("Error while retrieving projects", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving projects. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -202,7 +382,25 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public ExperimentStatistics getExperimentStatistics(String gatewayId, long fromTime, long toTime) throws RegistryServiceException, TException {
- return null;
+ if (!isGatewayExistInternal(gatewayId)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ }
+ try {
+ Map<String, String> filters = new HashMap();
+ filters.put(Constants.FieldConstants.ExperimentConstants.GATEWAY_ID, gatewayId);
+ filters.put(Constants.FieldConstants.ExperimentConstants.FROM_DATE, fromTime+"");
+ filters.put(Constants.FieldConstants.ExperimentConstants.TO_DATE, toTime+"");
+
+ List<Object> results = experimentCatalog.search(ExperimentCatalogModelType.EXPERIMENT_STATISTICS, filters);
+ logger.debug("Airavata retrieved experiments for gateway id : " + gatewayId + " between : " + AiravataUtils.getTime(fromTime) + " and " + AiravataUtils.getTime(toTime));
+ return (ExperimentStatistics) results.get(0);
+ }catch (Exception e) {
+ logger.error("Error while retrieving experiments", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving experiments. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -215,7 +413,38 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<ExperimentModel> getExperimentsInProject(String projectId, int limit, int offset) throws RegistryServiceException, TException {
- return null;
+ if (!validateString(projectId)){
+ logger.error("Project id cannot be empty. Please provide a valid project ID...");
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Project id cannot be empty. Please provide a valid project ID...");
+ throw exception;
+ }
+ try {
+ experimentCatalog = RegistryFactory.getDefaultExpCatalog();
+ if (!experimentCatalog.isExist(ExperimentCatalogModelType.PROJECT, projectId)){
+ logger.error("Project does not exist in the system. Please provide a valid project ID...");
+ ProjectNotFoundException exception = new ProjectNotFoundException();
+ exception.setMessage("Project does not exist in the system. Please provide a valid project ID...");
+ throw exception;
+ }
+
+ List<ExperimentModel> experiments = new ArrayList<ExperimentModel>();
+ List<Object> list = experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT,
+ Constants.FieldConstants.ExperimentConstants.PROJECT_ID, projectId, limit, offset,
+ Constants.FieldConstants.ExperimentConstants.CREATION_TIME, ResultOrderType.DESC);
+ if (list != null && !list.isEmpty()) {
+ for (Object o : list) {
+ experiments.add((ExperimentModel) o);
+ }
+ }
+ logger.debug("Airavata retrieved experiments for project : " + projectId);
+ return experiments;
+ } catch (Exception e) {
+ logger.error("Error while retrieving the experiments", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving the experiments. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -229,7 +458,43 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<ExperimentModel> getUserExperiments(String gatewayId, String userName, int limit, int offset) throws RegistryServiceException, TException {
- return null;
+ if (!validateString(userName)){
+ logger.error("Username cannot be empty. Please provide a valid user..");
+ AiravataSystemException exception = new AiravataSystemException();
+ exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage("Username cannot be empty. Please provide a valid user..");
+ throw exception;
+ }
+ if (!isGatewayExistInternal(gatewayId)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ }
+ try {
+ if (!ExpCatResourceUtils.isUserExist(userName, gatewayId)){
+ logger.error("User does not exist in the system. Please provide a valid user..");
+ AiravataSystemException exception = new AiravataSystemException();
+ exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage("User does not exist in the system. Please provide a valid user..");
+ throw exception;
+ }
+ List<ExperimentModel> experiments = new ArrayList<ExperimentModel>();
+ experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
+ List<Object> list = experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT,
+ Constants.FieldConstants.ExperimentConstants.USER_NAME, userName, limit, offset,
+ Constants.FieldConstants.ExperimentConstants.CREATION_TIME, ResultOrderType.DESC);
+ if (list != null && !list.isEmpty()){
+ for (Object o : list){
+ experiments.add((ExperimentModel)o);
+ }
+ }
+ logger.debug("Airavata retrieved experiments for user : " + userName);
+ return experiments;
+ } catch (Exception e) {
+ logger.error("Error while retrieving the experiments", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving the experiments. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -241,7 +506,26 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteExperiment(String experimentId) throws RegistryServiceException, TException {
- return false;
+ try {
+ experimentCatalog = RegistryFactory.getDefaultExpCatalog();
+ if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, experimentId)){
+ throw new ExperimentNotFoundException("Requested experiment id " + experimentId + " does not exist in the system..");
+ }
+ ExperimentModel experimentModel = (ExperimentModel) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT, experimentId);
+
+ if(!(experimentModel.getExperimentStatus().getState() == ExperimentState.CREATED)){
+ logger.error("Error while deleting the experiment");
+ throw new ExperimentCatalogException("Experiment is not in CREATED state. Hence cannot deleted. ID:"+ experimentId);
+ }
+ experimentCatalog.remove(ExperimentCatalogModelType.EXPERIMENT, experimentId);
+ logger.debug("Airavata removed experiment with experiment id : " + experimentId);
+ return true;
+ } catch (Exception e) {
+ logger.error("Error while deleting the experiment", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while deleting the experiment. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -284,7 +568,8 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public ExperimentModel getExperiment(String airavataExperimentId) throws RegistryServiceException, TException {
- return null;
+ ExperimentModel experimentModel = getExperimentInternal(airavataExperimentId);
+ return experimentModel;
}
/**
@@ -314,7 +599,46 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public ExperimentModel getDetailedExperimentTree(String airavataExperimentId) throws RegistryServiceException, TException {
- return null;
+ try {
+ ExperimentModel experimentModel = getExperimentInternal(airavataExperimentId);
+ experimentCatalog = RegistryFactory.getDefaultExpCatalog();
+ List<Object> processObjects = experimentCatalog.get(ExperimentCatalogModelType.PROCESS,
+ Constants.FieldConstants.ExperimentConstants.EXPERIMENT_ID, experimentModel.getExperimentId());
+ List<ProcessModel> processList = new ArrayList<>();
+ if(processObjects != null){
+ processObjects.stream().forEach(p -> {
+ //Process already has the task object
+ ((ProcessModel)p).getTasks().stream().forEach(t->{
+ try {
+ List<Object> jobObjects = experimentCatalog.get(ExperimentCatalogModelType.JOB,
+ Constants.FieldConstants.JobConstants.TASK_ID, ((TaskModel)t).getTaskId());
+ List<JobModel> jobList = new ArrayList<JobModel>();
+ if(jobObjects != null){
+ jobObjects.stream().forEach(j -> jobList.add((JobModel)j));
+ Collections.sort(jobList, new Comparator<JobModel>() {
+ @Override
+ public int compare(JobModel o1, JobModel o2) {
+ return (int) (o1.getCreationTime() - o2.getCreationTime());
+ }
+ });
+ t.setJobs(jobList);
+ }
+ } catch (RegistryException e) {
+ logger.error(e.getMessage(), e);
+ }
+ });
+ processList.add((ProcessModel)p);
+ });
+ experimentModel.setProcesses(processList);
+ }
+ logger.debug("Airavata retrieved detailed experiment with experiment id : " + airavataExperimentId);
+ return experimentModel;
+ } catch (Exception e) {
+ logger.error("Error while retrieving the experiment", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving the experiment. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -328,7 +652,9 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public ExperimentStatus getExperimentStatus(String airavataExperimentId) throws RegistryServiceException, TException {
- return null;
+ ExperimentStatus experimentStatus = getExperimentStatusInternal(airavataExperimentId);
+ logger.debug("Airavata retrieved experiment status for experiment id : " + airavataExperimentId);
+ return experimentStatus;
}
/**
@@ -341,7 +667,20 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<OutputDataObjectType> getExperimentOutputs(String airavataExperimentId) throws RegistryServiceException, TException {
- return null;
+ try {
+ experimentCatalog = RegistryFactory.getDefaultExpCatalog();
+ if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
+ logger.error(airavataExperimentId, "Get experiment outputs failed, experiment {} doesn't exit.", airavataExperimentId);
+ throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
+ }
+ logger.debug("Airavata retrieved experiment outputs for experiment id : " + airavataExperimentId);
+ return (List<OutputDataObjectType>) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT_OUTPUT, airavataExperimentId);
+ } catch (Exception e) {
+ logger.error(airavataExperimentId, "Error while retrieving the experiment outputs", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving the experiment outputs. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -366,7 +705,45 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public Map<String, JobStatus> getJobStatuses(String airavataExperimentId) throws RegistryServiceException, TException {
- return null;
+ try {
+ experimentCatalog = RegistryFactory.getDefaultExpCatalog();
+ if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
+ logger.error(airavataExperimentId, "Error while retrieving job details, experiment {} doesn't exist.", airavataExperimentId);
+ throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
+ }
+ List<Object> processModels = experimentCatalog.get(ExperimentCatalogModelType.PROCESS, Constants.FieldConstants.ProcessConstants.EXPERIMENT_ID, airavataExperimentId);
+ Map<String, JobStatus> jobStatus = new HashMap<String, JobStatus>();
+ if (processModels != null && !processModels.isEmpty()){
+ for (Object process : processModels) {
+ ProcessModel processModel = (ProcessModel) process;
+ List<TaskModel> tasks = processModel.getTasks();
+ if (tasks != null && !tasks.isEmpty()){
+ for (TaskModel task : tasks){
+ String taskId = task.getTaskId();
+ List<Object> jobs = experimentCatalog.get(ExperimentCatalogModelType.JOB, Constants.FieldConstants.JobConstants.TASK_ID, taskId);
+ if (jobs != null && !jobs.isEmpty()){
+ for (Object jobObject : jobs) {
+ JobModel jobModel = (JobModel) jobObject;
+ String jobID = jobModel.getJobId();
+ JobStatus status = jobModel.getJobStatus();
+ if (status != null){
+ jobStatus.put(jobID, status);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ logger.debug("Airavata retrieved job statuses for experiment with experiment id : " + airavataExperimentId);
+ return jobStatus;
+ } catch (Exception e) {
+ logger.error(airavataExperimentId, "Error while retrieving the job statuses", e);
+ AiravataSystemException exception = new AiravataSystemException();
+ exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage("Error while retrieving the job statuses. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -378,7 +755,37 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<JobModel> getJobDetails(String airavataExperimentId) throws RegistryServiceException, TException {
- return null;
+ try {
+ experimentCatalog = RegistryFactory.getDefaultExpCatalog();
+ if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
+ logger.error(airavataExperimentId, "Error while retrieving job details, experiment {} doesn't exist.", airavataExperimentId);
+ throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
+ }
+ List<Object> processModels = experimentCatalog.get(ExperimentCatalogModelType.PROCESS, Constants.FieldConstants.ProcessConstants.EXPERIMENT_ID, airavataExperimentId);
+ List<JobModel> jobList = new ArrayList<>();
+ if (processModels != null && !processModels.isEmpty()){
+ for (Object process : processModels) {
+ ProcessModel processModel = (ProcessModel) process;
+ List<TaskModel> tasks = processModel.getTasks();
+ if (tasks != null && !tasks.isEmpty()){
+ for (TaskModel taskModel : tasks){
+ String taskId = taskModel.getTaskId();
+ List<Object> jobs = experimentCatalog.get(ExperimentCatalogModelType.JOB, Constants.FieldConstants.JobConstants.TASK_ID, taskId);
+ for (Object jobObject : jobs) {
+ jobList.add ((JobModel)jobObject);
+ }
+ }
+ }
+ }
+ }
+ logger.debug("Airavata retrieved job models for experiment with experiment id : " + airavataExperimentId);
+ return jobList;
+ } catch (Exception e) {
+ logger.error(airavataExperimentId, "Error while retrieving the job details", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving the job details. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -390,7 +797,17 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public ApplicationModule getApplicationModule(String appModuleId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ ApplicationModule module = appCatalog.getApplicationInterface().getApplicationModule(appModuleId);
+ logger.debug("Airavata retrieved application module with module id : " + appModuleId);
+ return module;
+ } catch (AppCatalogException e) {
+ logger.error(appModuleId, "Error while retrieving application module...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving the adding application module. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -402,7 +819,21 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<ApplicationModule> getAllAppModules(String gatewayId) throws RegistryServiceException, TException {
- return null;
+ if (!isGatewayExistInternal(gatewayId)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ List<ApplicationModule> moduleList = appCatalog.getApplicationInterface().getAllApplicationModules(gatewayId);
+ logger.debug("Airavata retrieved modules for gateway id : " + gatewayId);
+ return moduleList;
+ } catch (AppCatalogException e) {
+ logger.error("Error while retrieving all application modules...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving all application modules. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -414,7 +845,16 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteApplicationModule(String appModuleId) throws RegistryServiceException, TException {
- return false;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ logger.debug("Airavata deleted application module with module id : " + appModuleId);
+ return appCatalog.getApplicationInterface().removeApplicationModule(appModuleId);
+ } catch (AppCatalogException e) {
+ logger.error(appModuleId, "Error while deleting application module...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while deleting the application module. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -426,7 +866,17 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public ApplicationDeploymentDescription getApplicationDeployment(String appDeploymentId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ ApplicationDeploymentDescription deployement = appCatalog.getApplicationDeployment().getApplicationDeployement(appDeploymentId);
+ logger.debug("Airavata registered application deployment for deployment id : " + appDeploymentId);
+ return deployement;
+ } catch (AppCatalogException e) {
+ logger.error(appDeploymentId, "Error while retrieving application deployment...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving application deployment. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -438,7 +888,17 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteApplicationDeployment(String appDeploymentId) throws RegistryServiceException, TException {
- return false;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ appCatalog.getApplicationDeployment().removeAppDeployment(appDeploymentId);
+ logger.debug("Airavata removed application deployment with deployment id : " + appDeploymentId);
+ return true;
+ } catch (AppCatalogException e) {
+ logger.error(appDeploymentId, "Error while deleting application deployment...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while deleting application deployment. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -451,7 +911,21 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<ApplicationDeploymentDescription> getAllApplicationDeployments(String gatewayId) throws RegistryServiceException, TException {
- return null;
+ if (!isGatewayExistInternal(gatewayId)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ List<ApplicationDeploymentDescription> deployements = appCatalog.getApplicationDeployment().getAllApplicationDeployements(gatewayId);
+ logger.debug("Airavata retrieved application deployments for gateway id : " + gatewayId);
+ return deployements;
+ } catch (AppCatalogException e) {
+ logger.error("Error while retrieving application deployments...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving application deployments. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -463,7 +937,23 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<String> getAppModuleDeployedResources(String appModuleId) throws RegistryServiceException, TException {
- return null;
+ try {
+ List<String> appDeployments = new ArrayList<String>();
+ appCatalog = RegistryFactory.getAppCatalog();
+ Map<String, String> filters = new HashMap<String, String>();
+ filters.put(AppCatAbstractResource.ApplicationDeploymentConstants.APP_MODULE_ID, appModuleId);
+ List<ApplicationDeploymentDescription> applicationDeployments = appCatalog.getApplicationDeployment().getApplicationDeployements(filters);
+ for (ApplicationDeploymentDescription description : applicationDeployments){
+ appDeployments.add(description.getAppDeploymentId());
+ }
+ logger.debug("Airavata retrieved application deployments for module id : " + appModuleId);
+ return appDeployments;
+ } catch (AppCatalogException e) {
+ logger.error(appModuleId, "Error while retrieving application deployments...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving application deployment. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -475,7 +965,17 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public ApplicationInterfaceDescription getApplicationInterface(String appInterfaceId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ ApplicationInterfaceDescription interfaceDescription = appCatalog.getApplicationInterface().getApplicationInterface(appInterfaceId);
+ logger.debug("Airavata retrieved application interface with interface id : " + appInterfaceId);
+ return interfaceDescription;
+ } catch (AppCatalogException e) {
+ logger.error(appInterfaceId, "Error while retrieving application interface...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving application interface. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -487,7 +987,17 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteApplicationInterface(String appInterfaceId) throws RegistryServiceException, TException {
- return false;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ boolean removeApplicationInterface = appCatalog.getApplicationInterface().removeApplicationInterface(appInterfaceId);
+ logger.debug("Airavata removed application interface with interface id : " + appInterfaceId);
+ return removeApplicationInterface;
+ } catch (AppCatalogException e) {
+ logger.error(appInterfaceId, "Error while deleting application interface...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while deleting application interface. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -499,7 +1009,27 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public Map<String, String> getAllApplicationInterfaceNames(String gatewayId) throws RegistryServiceException, TException {
- return null;
+ if (!isGatewayExistInternal(gatewayId)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ List<ApplicationInterfaceDescription> allApplicationInterfaces = appCatalog.getApplicationInterface().getAllApplicationInterfaces(gatewayId);
+ Map<String, String> allApplicationInterfacesMap = new HashMap<String, String>();
+ if (allApplicationInterfaces != null && !allApplicationInterfaces.isEmpty()){
+ for (ApplicationInterfaceDescription interfaceDescription : allApplicationInterfaces){
+ allApplicationInterfacesMap.put(interfaceDescription.getApplicationInterfaceId(), interfaceDescription.getApplicationName());
+ }
+ }
+ logger.debug("Airavata retrieved application interfaces for gateway id : " + gatewayId);
+ return allApplicationInterfacesMap;
+ } catch (AppCatalogException e) {
+ logger.error("Error while retrieving application interfaces...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving application interfaces. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -511,7 +1041,21 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<ApplicationInterfaceDescription> getAllApplicationInterfaces(String gatewayId) throws RegistryServiceException, TException {
- return null;
+ if (!isGatewayExistInternal(gatewayId)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ List<ApplicationInterfaceDescription> interfaces = appCatalog.getApplicationInterface().getAllApplicationInterfaces(gatewayId);
+ logger.debug("Airavata retrieved application interfaces for gateway id : " + gatewayId);
+ return interfaces;
+ } catch (AppCatalogException e) {
+ logger.error("Error while retrieving application interfaces...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving application interfaces. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -523,7 +1067,17 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<InputDataObjectType> getApplicationInputs(String appInterfaceId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ List<InputDataObjectType> applicationInputs = appCatalog.getApplicationInterface().getApplicationInputs(appInterfaceId);
+ logger.debug("Airavata retrieved application inputs for application interface id : " + appInterfaceId);
+ return applicationInputs;
+ } catch (AppCatalogException e) {
+ logger.error(appInterfaceId, "Error while retrieving application inputs...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving application inputs. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -535,7 +1089,9 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<OutputDataObjectType> getApplicationOutputs(String appInterfaceId) throws RegistryServiceException, TException {
- return null;
+ List<OutputDataObjectType> list = getApplicationOutputsInternal(appInterfaceId);
+ logger.debug("Airavata retrieved application outputs for app interface id : " + appInterfaceId);
+ return list;
}
/**
@@ -548,7 +1104,36 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public Map<String, String> getAvailableAppInterfaceComputeResources(String appInterfaceId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ ApplicationDeployment applicationDeployment = appCatalog.getApplicationDeployment();
+ Map<String, String> allComputeResources = appCatalog.getComputeResource().getAvailableComputeResourceIdList();
+ Map<String, String> availableComputeResources = new HashMap<String, String>();
+ ApplicationInterfaceDescription applicationInterface =
+ appCatalog.getApplicationInterface().getApplicationInterface(appInterfaceId);
+ HashMap<String, String> filters = new HashMap<String,String>();
+ List<String> applicationModules = applicationInterface.getApplicationModules();
+ if (applicationModules != null && !applicationModules.isEmpty()){
+ for (String moduleId : applicationModules) {
+ filters.put(AppCatAbstractResource.ApplicationDeploymentConstants.APP_MODULE_ID, moduleId);
+ List<ApplicationDeploymentDescription> applicationDeployments =
+ applicationDeployment.getApplicationDeployements(filters);
+ for (ApplicationDeploymentDescription deploymentDescription : applicationDeployments) {
+ if (allComputeResources.get(deploymentDescription.getComputeHostId()) != null){
+ availableComputeResources.put(deploymentDescription.getComputeHostId(),
+ allComputeResources.get(deploymentDescription.getComputeHostId()));
+ }
+ }
+ }
+ }
+ logger.debug("Airavata retrieved available compute resources for application interface id : " + appInterfaceId);
+ return availableComputeResources;
+ } catch (AppCatalogException e) {
+ logger.error(appInterfaceId, "Error while saving compute resource...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while saving compute resource. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -560,7 +1145,17 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public ComputeResourceDescription getComputeResource(String computeResourceId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ ComputeResourceDescription computeResource = appCatalog.getComputeResource().getComputeResource(computeResourceId);
+ logger.debug("Airavata retrieved compute resource with compute resource Id : " + computeResourceId);
+ return computeResource;
+ } catch (AppCatalogException e) {
+ logger.error(computeResourceId, "Error while retrieving compute resource...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving compute resource. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -571,7 +1166,17 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public Map<String, String> getAllComputeResourceNames() throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ Map<String, String> computeResourceIdList = appCatalog.getComputeResource().getAllComputeResourceIdList();
+ logger.debug("Airavata retrieved all the available compute resources...");
+ return computeResourceIdList;
+ } catch (AppCatalogException e) {
+ logger.error("Error while retrieving compute resource...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving compute resource. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -583,7 +1188,17 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteComputeResource(String computeResourceId) throws RegistryServiceException, TException {
- return false;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ appCatalog.getComputeResource().removeComputeResource(computeResourceId);
+ logger.debug("Airavata deleted compute resource with compute resource Id : " + computeResourceId);
+ return true;
+ } catch (AppCatalogException e) {
+ logger.error(computeResourceId, "Error while deleting compute resource...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while deleting compute resource. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -595,7 +1210,17 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public StorageResourceDescription getStorageResource(String storageResourceId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ StorageResourceDescription storageResource = appCatalog.getStorageResource().getStorageResource(storageResourceId);
+ logger.debug("Airavata retrieved storage resource with storage resource Id : " + storageResourceId);
+ return storageResource;
+ } catch (AppCatalogException e) {
+ logger.error(storageResourceId, "Error while retrieving storage resource...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving storage resource. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -606,7 +1231,17 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public Map<String, String> getAllStorageResourceNames() throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ Map<String, String> resourceIdList = appCatalog.getStorageResource().getAllStorageResourceIdList();
+ logger.debug("Airavata retrieved storage resources list...");
+ return resourceIdList;
+ } catch (AppCatalogException e) {
+ logger.error("Error while retrieving storage resource...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving storage resource. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -618,7 +1253,17 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteStorageResource(String storageResourceId) throws RegistryServiceException, TException {
- return false;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ appCatalog.getStorageResource().removeStorageResource(storageResourceId);
+ logger.debug("Airavata deleted storage resource with storage resource Id : " + storageResourceId);
+ return true;
+ } catch (AppCatalogException e) {
+ logger.error(storageResourceId, "Error while deleting storage resource...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while deleting storage resource. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -628,7 +1273,18 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public LOCALSubmission getLocalJobSubmission(String jobSubmissionId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ LOCALSubmission localJobSubmission = appCatalog.getComputeResource().getLocalJobSubmission(jobSubmissionId);
+ logger.debug("Airavata retrieved local job submission for job submission interface id: " + jobSubmissionId);
+ return localJobSubmission;
+ } catch (AppCatalogException e) {
+ String errorMsg = "Error while retrieving local job submission interface to resource compute resource...";
+ logger.error(jobSubmissionId, errorMsg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(errorMsg + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -638,7 +1294,18 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public SSHJobSubmission getSSHJobSubmission(String jobSubmissionId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ SSHJobSubmission sshJobSubmission = appCatalog.getComputeResource().getSSHJobSubmission(jobSubmissionId);
+ logger.debug("Airavata retrieved SSH job submission for job submission interface id: " + jobSubmissionId);
+ return sshJobSubmission;
+ } catch (AppCatalogException e) {
+ String errorMsg = "Error while retrieving SSH job submission interface to resource compute resource...";
+ logger.error(jobSubmissionId, errorMsg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(errorMsg + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -655,7 +1322,18 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public UnicoreJobSubmission getUnicoreJobSubmission(String jobSubmissionId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ UnicoreJobSubmission unicoreJobSubmission = appCatalog.getComputeResource().getUNICOREJobSubmission(jobSubmissionId);
+ logger.debug("Airavata retrieved UNICORE job submission for job submission interface id: " + jobSubmissionId);
+ return unicoreJobSubmission;
+ } catch (AppCatalogException e) {
+ String errorMsg = "Error while retrieving Unicore job submission interface to resource compute resource...";
+ logger.error(jobSubmissionId, errorMsg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(errorMsg + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -670,7 +1348,18 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public CloudJobSubmission getCloudJobSubmission(String jobSubmissionId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ CloudJobSubmission cloudJobSubmission = appCatalog.getComputeResource().getCloudJobSubmission(jobSubmissionId);
+ logger.debug("Airavata retrieved cloud job submission for job submission interface id: " + jobSubmissionId);
+ return cloudJobSubmission;
+ } catch (AppCatalogException e) {
+ String errorMsg = "Error while retrieving Cloud job submission interface to resource compute resource...";
+ logger.error(jobSubmissionId, errorMsg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(errorMsg + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -681,7 +1370,18 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public LOCALDataMovement getLocalDataMovement(String dataMovementId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ LOCALDataMovement localDataMovement = appCatalog.getComputeResource().getLocalDataMovement(dataMovementId);
+ logger.debug("Airavata retrieved local data movement with data movement id: " + dataMovementId);
+ return localDataMovement;
+ } catch (AppCatalogException e) {
+ String errorMsg = "Error while retrieving local data movement interface to resource compute resource...";
+ logger.error(dataMovementId, errorMsg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(errorMsg + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -692,7 +1392,18 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public SCPDataMovement getSCPDataMovement(String dataMovementId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ SCPDataMovement scpDataMovement = appCatalog.getComputeResource().getSCPDataMovement(dataMovementId);
+ logger.debug("Airavata retrieved SCP data movement with data movement id: " + dataMovementId);
+ return scpDataMovement;
+ } catch (AppCatalogException e) {
+ String errorMsg = "Error while retrieving SCP data movement interface to resource compute resource...";
+ logger.error(dataMovementId, errorMsg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(errorMsg + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -703,7 +1414,18 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public UnicoreDataMovement getUnicoreDataMovement(String dataMovementId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ UnicoreDataMovement unicoreDataMovement = appCatalog.getComputeResource().getUNICOREDataMovement(dataMovementId);
+ logger.debug("Airavata retrieved UNICORE data movement with data movement id: " + dataMovementId);
+ return unicoreDataMovement;
+ } catch (AppCatalogException e) {
+ String errorMsg = "Error while retrieving UNICORE data movement interface...";
+ logger.error(dataMovementId, errorMsg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(errorMsg + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -714,7 +1436,18 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public GridFTPDataMovement getGridFTPDataMovement(String dataMovementId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ GridFTPDataMovement gridFTPDataMovement = appCatalog.getComputeResource().getGridFTPDataMovement(dataMovementId);
+ logger.debug("Airavata retrieved GRIDFTP data movement with data movement id: " + dataMovementId);
+ return gridFTPDataMovement;
+ } catch (AppCatalogException e) {
+ String errorMsg = "Error while retrieving GridFTP data movement interface to resource compute resource...";
+ logger.error(dataMovementId, errorMsg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(errorMsg + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -777,17 +1510,44 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteJobSubmissionInterface(String computeResourceId, String jobSubmissionInterfaceId) throws RegistryServiceException, TException {
- return false;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ appCatalog.getComputeResource().removeJobSubmissionInterface(computeResourceId, jobSubmissionInterfaceId);
+ logger.debug("Airavata deleted job submission interface with interface id : " + jobSubmissionInterfaceId);
+ return true;
+ } catch (AppCatalogException e) {
+ logger.error(jobSubmissionInterfaceId, "Error while deleting job submission interface...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while deleting job submission interface. More info : " + e.getMessage());
+ throw exception;
+ }
}
@Override
public ResourceJobManager getResourceJobManager(String resourceJobManagerId) throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ return appCatalog.getComputeResource().getResourceJobManager(resourceJobManagerId);
+ } catch (AppCatalogException e) {
+ logger.error(resourceJobManagerId, "Error while retrieving resource job manager...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving resource job manager. More info : " + e.getMessage());
+ throw exception;
+ }
}
@Override
public boolean deleteResourceJobManager(String resourceJobManagerId) throws RegistryServiceException, TException {
- return false;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ appCatalog.getComputeResource().deleteResourceJobManager(resourceJobManagerId);
+ return true;
+ } catch (AppCatalogException e) {
+ logger.error(resourceJobManagerId, "Error while deleting resource job manager...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while deleting resource job manager. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -800,7 +1560,16 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteBatchQueue(String computeResourceId, String queueName) throws RegistryServiceException, TException {
- return false;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ appCatalog.getComputeResource().removeBatchQueue(computeResourceId, queueName);
+ return true;
+ } catch (AppCatalogException e) {
+ logger.error(computeResourceId, "Error while deleting batch queue...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while deleting batch queue. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -812,7 +1581,22 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public GatewayResourceProfile getGatewayResourceProfile(String gatewayID) throws RegistryServiceException, TException {
- return null;
+ try {
+ if (!isGatewayExistInternal(gatewayID)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ }
+ appCatalog = RegistryFactory.getAppCatalog();
+ GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
+ GatewayResourceProfile gatewayResourceProfile = gatewayProfile.getGatewayProfile(gatewayID);
+ logger.debug("Airavata retrieved gateway profile with gateway id : " + gatewayID);
+ return gatewayResourceProfile;
+ } catch (AppCatalogException e) {
+ logger.error(gatewayID, "Error while retrieving gateway resource profile...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while retrieving gateway resource profile. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -824,7 +1608,22 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteGatewayResourceProfile(String gatewayID) throws RegistryServiceException, TException {
- return false;
+ try {
+ if (!isGatewayExistInternal(gatewayID)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ appCatalog = RegistryFactory.getAppCatalog();
+ GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
+ gatewayProfile.removeGatewayResourceProfile(gatewayID);
+ logger.debug("Airavata deleted gateway profile with gateway id : " + gatewayID);
+ return true;
+ } catch (AppCatalogException e) {
+ logger.error(gatewayID, "Error while removing gateway resource profile...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while removing gateway resource profile. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -837,7 +1636,35 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public ComputeResourcePreference getGatewayComputeResourcePreference(String gatewayID, String computeResourceId) throws RegistryServiceException, TException {
- return null;
+ try {
+ if (!isGatewayExistInternal(gatewayID)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ appCatalog = RegistryFactory.getAppCatalog();
+ GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
+ ComputeResource computeResource = appCatalog.getComputeResource();
+ if (!gatewayProfile.isGatewayResourceProfileExists(gatewayID)){
+ logger.error(gatewayID, "Given gateway profile does not exist in the system. Please provide a valid gateway id...");
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Given gateway profile does not exist in the system. Please provide a valid gateway id...");
+ throw exception;
+ }
+ if (!computeResource.isComputeResourceExists(computeResourceId)){
+ logger.error(computeResourceId, "Given compute resource does not exist in the system. Please provide a valid compute resource id...");
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Given compute resource does not exist in the system. Please provide a valid compute resource id...");
+ throw exception;
+ }
+ ComputeResourcePreference computeResourcePreference = gatewayProfile.getComputeResourcePreference(gatewayID, computeResourceId);
+ logger.debug("Airavata retrieved gateway compute resource preference with gateway id : " + gatewayID + " and for compute resoruce id : " + computeResourceId );
+ return computeResourcePreference;
+ } catch (AppCatalogException e) {
+ logger.error(gatewayID, "Error while reading gateway compute resource preference...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while reading gateway compute resource preference. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -849,8 +1676,30 @@ public class RegistryServerHandler implements RegistryService.Iface {
* Returns the StoragePreference object.
*/
@Override
- public StoragePreference getGatewayStoragePreference(String gatewayID, String storageResourceId) throws RegistryServiceException, TException {
- return null;
+ public StoragePreference getGatewayStoragePreference(String gatewayID, String storageId) throws RegistryServiceException, TException {
+ try {
+ if (!isGatewayExistInternal(gatewayID)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ appCatalog = RegistryFactory.getAppCatalog();
+ GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
+ if (!gatewayProfile.isGatewayResourceProfileExists(gatewayID)){
+ logger.error(gatewayID, "Given gateway profile does not exist in the system. Please provide a valid gateway id...");
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Given gateway profile does not exist in the system. Please provide a valid gateway id...");
+ throw exception;
+ }
+
+ StoragePreference storagePreference = gatewayProfile.getStoragePreference(gatewayID, storageId);
+ logger.debug("Airavata retrieved storage resource preference with gateway id : " + gatewayID + " and for storage resource id : " + storageId);
+ return storagePreference;
+ } catch (AppCatalogException e) {
+ logger.error(gatewayID, "Error while reading gateway data storage preference...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while reading gateway data storage preference. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -862,7 +1711,20 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<ComputeResourcePreference> getAllGatewayComputeResourcePreferences(String gatewayID) throws RegistryServiceException, TException {
- return null;
+ try {
+ if (!isGatewayExistInternal(gatewayID)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ appCatalog = RegistryFactory.getAppCatalog();
+ GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
+ return gatewayProfile.getGatewayProfile(gatewayID).getComputeResourcePreferences();
+ } catch (AppCatalogException e) {
+ logger.error(gatewayID, "Error while reading gateway compute resource preferences...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while reading gateway compute resource preferences. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -874,7 +1736,20 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<StoragePreference> getAllGatewayStoragePreferences(String gatewayID) throws RegistryServiceException, TException {
- return null;
+ try {
+ if (!isGatewayExistInternal(gatewayID)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ appCatalog = RegistryFactory.getAppCatalog();
+ GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
+ return gatewayProfile.getGatewayProfile(gatewayID).getStoragePreferences();
+ } catch (AppCatalogException e) {
+ logger.error(gatewayID, "Error while reading gateway data storage preferences...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while reading gateway data storage preferences. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -885,7 +1760,15 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<GatewayResourceProfile> getAllGatewayResourceProfiles() throws RegistryServiceException, TException {
- return null;
+ try {
+ appCatalog = RegistryFactory.getAppCatalog();
+ GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
+ return gatewayProfile.getAllGatewayProfiles();
+ } catch (AppCatalogException e) {
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while reading retrieving all gateway profiles. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -898,7 +1781,20 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteGatewayComputeResourcePreference(String gatewayID, String computeResourceId) throws RegistryServiceException, TException {
- return false;
+ try {
+ if (!isGatewayExistInternal(gatewayID)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ appCatalog = RegistryFactory.getAppCatalog();
+ GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
+ return gatewayProfile.removeComputeResourcePreferenceFromGateway(gatewayID, computeResourceId);
+ } catch (AppCatalogException e) {
+ logger.error(gatewayID, "Error while reading gateway compute resource preference...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while updating gateway compute resource preference. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -911,7 +1807,20 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public boolean deleteGatewayStoragePreference(String gatewayID, String storageId) throws RegistryServiceException, TException {
- return false;
+ try {
+ if (!isGatewayExistInternal(gatewayID)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ appCatalog = RegistryFactory.getAppCatalog();
+ GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
+ return gatewayProfile.removeDataStoragePreferenceFromGateway(gatewayID, storageId);
+ } catch (AppCatalogException e) {
+ logger.error(gatewayID, "Error while reading gateway data storage preference...", e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage("Error while updating gateway data storage preference. More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -922,7 +1831,19 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public List<String> getAllWorkflows(String gatewayId) throws RegistryServiceException, TException {
- return null;
+ if (!isGatewayExistInternal(gatewayId)){
+ logger.error("Gateway does not exist.Please provide a valid gateway id...");
+ throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
+ }
+ try {
+ return getWorkflowCatalog().getAllWorkflows(gatewayId);
+ } catch (WorkflowCatalogException e) {
+ String msg = "Error in retrieving all workflow template Ids.";
+ logger.error(msg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
}
/**
@@ -932,42 +1853,114 @@ public class RegistryServerHandler implements RegistryService.Iface {
*/
@Override
public WorkflowModel getWorkflow(String workflowTemplateId) throws RegistryServiceException, TException {
- return null;
+ try {
+ return getWorkflowCatalog().getWorkflow(workflowTemplateId);
+ } catch (WorkflowCatalogException e) {
+ String msg = "Error in retrieving the workflow "+workflowTemplateId+".";
+ logger.error(msg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
}
@Override
public void deleteWorkflow(String workflowTemplateId) throws RegistryServiceException, TException {
-
+ try {
+ getWorkflowCatalog().deleteWorkflow(workflowTemplateId);
+ } catch (WorkflowCatalogException e) {
+ String msg = "Error in deleting the workflow "+workflowTemplateId+".";
+ logger.error(msg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
}
@Override
public String getWorkflowTemplateId(String workflowName) throws RegistryServiceException, TException {
- return null;
+ try {
+ return getWorkflowCatalog().getWorkflowTemplateId(workflowName);
+ } catch (WorkflowCatalogException e) {
+ String msg = "Error in retrieving the workflow template id for "+workflowName+".";
+ logger.error(msg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
}
@Override
public boolean isWorkflowExistWithName(String workflowName) throws RegistryServiceException, TException {
- return false;
+ try {
+ return getWorkflowCatalog().isWorkflowExistWithName(workflowName);
+ } catch (WorkflowCatalogException e) {
+ String msg = "Error in veriying the workflow for workflow name "+workflowName+".";
+ logger.error(msg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
}
@Override
- public DataProductModel getDataProduct(String dataProductUri) throws RegistryServiceException, TException {
- return null;
+ public DataProductModel getDataProduct(String productUri) throws RegistryServiceException, TException {
+ try {
+ dataCatalog = RegistryFactory.getReplicaCatalog();
+ DataProductModel dataProductModel = dataCatalog.getDataProduct(productUri);
+ return dataProductModel;
+ } catch (RegistryException e) {
+ String msg = "Error in retreiving the data product "+productUri+".";
+ logger.error(msg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
}
@Override
public DataProductModel getParentDataProduct(String productUri) throws RegistryServiceException, TException {
- return null;
+ try {
+ dataCatalog = RegistryFactory.getReplicaCatalog();
+ DataProductModel dataProductModel = dataCatalog.getParentDataProduct(productUri);
+ return dataProductModel;
+ } catch (RegistryException e) {
+ String msg = "Error in retreiving the parent data product for "+ productUri+".";
+ logger.error(msg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
}
@Override
public List<DataProductModel> getChildDataProducts(String productUri) throws RegistryServiceException, TException {
- return null;
+ try {
+ dataCatalog = RegistryFactory.getReplicaCatalog();
+ List<DataProductModel> dataProductModels = dataCatalog.getChildDataProducts(productUri);
+ return dataProductModels;
+ } catch (RegistryException e) {
+ String msg = "Error in retreiving the child products for "+productUri+".";
+ logger.error(msg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
}
@Override
public String registerReplicaLocation(DataReplicaLocationModel replicaLocationModel) throws RegistryServiceException, TException {
- return null;
+ try {
+ dataCatalog = RegistryFactory.getReplicaCatalog();
+ String replicaId = dataCatalog.registerReplicaLocation(replicaLocationModel);
+ return replicaId;
+ } catch (RegistryException e) {
+ String msg = "Error in retreiving the replica "+replicaLocationModel.getReplicaName()+".";
+ logger.error(msg, e);
+ RegistryServiceException exception = new RegistryServiceException();
+ exception.setMessage(msg+" More info : " + e.getMessage());
+ throw exception;
+ }
<TRUNCATED>
[6/7] airavata git commit: moving registry code from API server to
registry server
Posted by sc...@apache.org.
moving registry code from API server to registry server
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/c01d7a14
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/c01d7a14
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/c01d7a14
Branch: refs/heads/develop
Commit: c01d7a1472674beb80229f00116b642f85334e6b
Parents: 388d90a
Author: scnakandala <su...@gmail.com>
Authored: Tue Aug 9 17:24:13 2016 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Tue Aug 9 17:24:13 2016 -0400
----------------------------------------------------------------------
airavata-api/airavata-api-server/pom.xml | 5 +
.../server/handler/AiravataServerHandler.java | 1657 +++----------
.../handler/AiravataServerHandlerTest.java | 295 ---
.../common/utils/ApplicationSettings.java | 22 +-
.../store/cpi/CredentialStoreService.java | 2 +-
.../store/datamodel/CertificateCredential.java | 2 +-
.../store/datamodel/CommunityUser.java | 2 +-
.../store/datamodel/PasswordCredential.java | 27 +-
.../store/datamodel/SSHCredential.java | 2 +-
.../exception/CredentialStoreException.java | 2 +-
.../apache/airavata/gfac/cpi/GfacService.java | 2 +-
.../orchestrator/cpi/OrchestratorService.java | 2 +-
.../service/handler/RegistryServerHandler.java | 2260 ++++++++++++++++--
.../airavata/registry/api/RegistryService.java | 1440 ++++++-----
.../client/RegistryServiceClientFactory.java | 44 +
.../api/exception/RegistryServiceException.java | 2 +-
.../component-cpis/registry-api.thrift | 14 +-
17 files changed, 3404 insertions(+), 2376 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/airavata-api/airavata-api-server/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/pom.xml b/airavata-api/airavata-api-server/pom.xml
index e4009b0..2108ce0 100644
--- a/airavata-api/airavata-api-server/pom.xml
+++ b/airavata-api/airavata-api-server/pom.xml
@@ -53,6 +53,11 @@
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
+ <artifactId>registry-api-stubs</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
<artifactId>airavata-registry-cpi</artifactId>
<version>${project.version}</version>
</dependency>
[7/7] airavata git commit: Merge remote-tracking branch
'origin/develop' into develop
Posted by sc...@apache.org.
Merge remote-tracking branch 'origin/develop' into develop
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/25ffe343
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/25ffe343
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/25ffe343
Branch: refs/heads/develop
Commit: 25ffe3434241ef76adc08ee95c4e9ff253f60573
Parents: c01d7a1 0e14f97
Author: scnakandala <su...@gmail.com>
Authored: Tue Aug 9 17:24:34 2016 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Tue Aug 9 17:24:34 2016 -0400
----------------------------------------------------------------------
.../core/app/catalog/util/AppCatalogThriftConversion.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[5/7] airavata git commit: moving registry code from API server to
registry server
Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 47d9fb6..21e2cb8 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -67,38 +67,34 @@ import org.apache.airavata.model.group.ResourceType;
import org.apache.airavata.model.job.JobModel;
import org.apache.airavata.model.messaging.event.ExperimentStatusChangeEvent;
import org.apache.airavata.model.messaging.event.MessageType;
-import org.apache.airavata.model.process.ProcessModel;
import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel;
import org.apache.airavata.model.security.AuthzToken;
import org.apache.airavata.model.status.ExperimentState;
import org.apache.airavata.model.status.ExperimentStatus;
import org.apache.airavata.model.status.JobStatus;
-import org.apache.airavata.model.task.TaskModel;
import org.apache.airavata.model.workspace.Gateway;
import org.apache.airavata.model.workspace.Notification;
import org.apache.airavata.model.workspace.Project;
import org.apache.airavata.orchestrator.client.OrchestratorClientFactory;
import org.apache.airavata.orchestrator.cpi.OrchestratorService;
import org.apache.airavata.orchestrator.cpi.OrchestratorService.Client;
-import org.apache.airavata.registry.core.app.catalog.resources.*;
-import org.apache.airavata.registry.core.app.catalog.util.AppCatalogThriftConversion;
-import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
+import org.apache.airavata.registry.api.RegistryService;
+import org.apache.airavata.registry.api.client.RegistryServiceClientFactory;
+import org.apache.airavata.registry.api.exception.RegistryServiceException;
import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
import org.apache.airavata.registry.cpi.*;
-import org.apache.airavata.registry.cpi.utils.Constants;
import org.apache.thrift.TException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
public class AiravataServerHandler implements Airavata.Iface {
private static final Logger logger = LoggerFactory.getLogger(AiravataServerHandler.class);
- private ExperimentCatalog experimentCatalog;
- private AppCatalog appCatalog;
private Publisher publisher;
- private ReplicaCatalog dataCatalog;
- private WorkflowCatalog workflowCatalog;
private CredentialStoreService.Client csClient;
public AiravataServerHandler() {
@@ -134,8 +130,8 @@ public class AiravataServerHandler implements Airavata.Iface {
public boolean isUserExists(AuthzToken authzToken, String gatewayId, String userName) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- return ExpCatResourceUtils.isUserExist(userName, gatewayId);
- } catch (RegistryException e) {
+ return getRegistryServiceClient().isUserExists(userName, gatewayId);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while verifying user", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -148,32 +144,14 @@ public class AiravataServerHandler implements Airavata.Iface {
@SecurityCheck
public String addGateway(AuthzToken authzToken, Gateway gateway) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- appCatalog = RegistryFactory.getAppCatalog();
- if (!validateString(gateway.getGatewayId())){
- logger.error("Gateway id cannot be empty...");
- throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- }
- String gatewayId = (String) experimentCatalog.add(ExpCatParentDataType.GATEWAY, gateway, gateway.getGatewayId());
- GatewayResourceProfile gatewayResourceProfile = new GatewayResourceProfile();
- gatewayResourceProfile.setGatewayID(gatewayId);
- appCatalog.getGatewayProfile().addGatewayResourceProfile(gatewayResourceProfile);
- logger.debug("Airavata added gateway with gateway id : " + gateway.getGatewayId());
- return gatewayId;
- } catch (RegistryException e) {
+ return getRegistryServiceClient().addGateway(gateway);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while adding gateway", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
exception.setMessage("Error while adding gateway. More info : " + e.getMessage());
throw exception;
- } catch (AppCatalogException e) {
- logger.error("Error while adding gateway profile", e);
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Error while adding gateway profile. More info : " + e.getMessage());
- throw exception;
}
}
@@ -189,8 +167,8 @@ public class AiravataServerHandler implements Airavata.Iface {
public List<String> getAllUsersInGateway(AuthzToken authzToken, String gatewayId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- return ExpCatResourceUtils.getAllUsersInGateway(gatewayId);
- } catch (RegistryException e) {
+ return getRegistryServiceClient().getAllUsersInGateway(gatewayId);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while retrieving users", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -205,17 +183,8 @@ public class AiravataServerHandler implements Airavata.Iface {
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.GATEWAY, gatewayId)){
- logger.error("Gateway does not exist in the system. Please provide a valid gateway ID...");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setMessage("Gateway does not exist in the system. Please provide a valid gateway ID...");
- throw exception;
- }
- experimentCatalog.update(ExperimentCatalogModelType.GATEWAY, updatedGateway, gatewayId);
- logger.debug("Airavata update gateway with gateway id : " + gatewayId);
- return true;
- } catch (RegistryException e) {
+ return getRegistryServiceClient().updateGateway(gatewayId, updatedGateway);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while updating the gateway", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -230,17 +199,8 @@ public class AiravataServerHandler implements Airavata.Iface {
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.GATEWAY, gatewayId)){
- logger.error("Gateway does not exist in the system. Please provide a valid gateway ID...");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setMessage("Gateway does not exist in the system. Please provide a valid gateway ID...");
- throw exception;
- }
- Gateway gateway = (Gateway) experimentCatalog.get(ExperimentCatalogModelType.GATEWAY, gatewayId);
- logger.debug("Airavata retrieved gateway with gateway id : " + gateway.getGatewayId());
- return gateway;
- } catch (RegistryException e) {
+ return getRegistryServiceClient().getGateway(gatewayId);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while getting the gateway", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -254,17 +214,8 @@ public class AiravataServerHandler implements Airavata.Iface {
public boolean deleteGateway(AuthzToken authzToken, String gatewayId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.GATEWAY, gatewayId)){
- logger.error("Gateway does not exist in the system. Please provide a valid gateway ID...");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setMessage("Gateway does not exist in the system. Please provide a valid gateway ID...");
- throw exception;
- }
- experimentCatalog.remove(ExperimentCatalogModelType.GATEWAY, gatewayId);
- logger.debug("Airavata deleted gateway with gateway id : " + gatewayId);
- return true;
- } catch (RegistryException e) {
+ return getRegistryServiceClient().deleteGateway(gatewayId);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while deleting the gateway", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -278,15 +229,8 @@ public class AiravataServerHandler implements Airavata.Iface {
public List<Gateway> getAllGateways(AuthzToken authzToken) throws InvalidRequestException, AiravataClientException,
AiravataSystemException, AuthorizationException, TException {
try {
- List<Gateway> gateways = new ArrayList<Gateway>();
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- List<Object> list = experimentCatalog.get(ExperimentCatalogModelType.GATEWAY, null, null);
- for (Object gateway : list){
- gateways.add((Gateway)gateway);
- }
- logger.debug("Airavata retrieved all available gateways...");
- return gateways;
- } catch (RegistryException e) {
+ return getRegistryServiceClient().getAllGateways();
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while getting all the gateways", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -301,9 +245,8 @@ public class AiravataServerHandler implements Airavata.Iface {
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- return experimentCatalog.isExist(ExperimentCatalogModelType.GATEWAY, gatewayId);
- } catch (RegistryException e) {
+ return getRegistryServiceClient().isGatewayExist(gatewayId);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while getting gateway", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -324,9 +267,8 @@ public class AiravataServerHandler implements Airavata.Iface {
public String createNotification(AuthzToken authzToken, Notification notification) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getExperimentCatalog(notification.getGatewayId());
- return (String) experimentCatalog.add(ExpCatParentDataType.NOTIFICATION, notification, notification.getGatewayId());
- } catch (RegistryException e) {
+ return getRegistryServiceClient().createNotification(notification);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while creating notification", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -340,10 +282,8 @@ public class AiravataServerHandler implements Airavata.Iface {
public boolean updateNotification(AuthzToken authzToken, Notification notification) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getExperimentCatalog(notification.getGatewayId());
- experimentCatalog.update(ExperimentCatalogModelType.NOTIFICATION, notification, notification.getGatewayId());
- return true;
- } catch (RegistryException e) {
+ return getRegistryServiceClient().updateNotification(notification);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while updating notification", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -357,10 +297,8 @@ public class AiravataServerHandler implements Airavata.Iface {
public boolean deleteNotification(AuthzToken authzToken, String gatewayId, String notificationId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- experimentCatalog.remove(ExperimentCatalogModelType.NOTIFICATION, notificationId);
- return true;
- } catch (RegistryException e) {
+ return getRegistryServiceClient().deleteNotification(gatewayId, notificationId);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while deleting notification", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -374,9 +312,8 @@ public class AiravataServerHandler implements Airavata.Iface {
public Notification getNotification(AuthzToken authzToken, String gatewayId, String notificationId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- return (Notification)experimentCatalog.get(ExperimentCatalogModelType.NOTIFICATION, notificationId);
- } catch (RegistryException e) {
+ return getRegistryServiceClient().getNotification(gatewayId, notificationId);
+ } catch (RegistryServiceException | ApplicationSettingsException e) {
logger.error("Error while retrieving notification", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -390,13 +327,8 @@ public class AiravataServerHandler implements Airavata.Iface {
public List<Notification> getAllNotifications(AuthzToken authzToken, String gatewayId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- List<Object> objectList = experimentCatalog.get(ExperimentCatalogModelType.NOTIFICATION, null, gatewayId);
- List<Notification> notifications = new ArrayList<>();
- for(Object o : objectList)
- notifications.add((Notification) o);
- return notifications;
- } catch (RegistryException e) {
+ return getRegistryServiceClient().getAllNotifications(gatewayId);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while getting all notifications", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -405,21 +337,6 @@ public class AiravataServerHandler implements Airavata.Iface {
}
}
- /*Following method wraps the logic of isGatewayExist method and this is to be called by any other method of the API as needed.*/
- private boolean isGatewayExistInternal(String gatewayId) throws InvalidRequestException, AiravataClientException,
- AiravataSystemException, AuthorizationException, TException{
- try {
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- return experimentCatalog.isExist(ExperimentCatalogModelType.GATEWAY, gatewayId);
- } catch (RegistryException e) {
- logger.error("Error while getting gateway", e);
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Error while getting gateway. More info : " + e.getMessage());
- throw exception;
- }
- }
-
@Override
@SecurityCheck
public String generateAndRegisterSSHKeys(AuthzToken authzToken, String gatewayId, String userName) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
@@ -585,20 +502,7 @@ public class AiravataServerHandler implements Airavata.Iface {
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- if (!validateString(project.getName()) || !validateString(project.getOwner())){
- logger.error("Project name and owner cannot be empty...");
- throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- }
- if (!validateString(gatewayId)){
- logger.error("Gateway ID cannot be empty...");
- throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- }
- if (!isGatewayExistInternal(gatewayId)){
- logger.error("Gateway does not exist.Please provide a valid gateway id...");
- throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- }
- String projectId = (String) experimentCatalog.add(ExpCatParentDataType.PROJECT, project, gatewayId);
+ String projectId = getRegistryServiceClient().createProject(gatewayId, project);
GroupManagerCPI groupManager = GroupManagerFactory.getGroupManager();
Resource projResource = new Resource(projectId, org.apache.airavata.grouper.resource.ResourceType.PROJECT);
projResource.setOwnerId(project.getOwner() + "@" + project.getGatewayId());
@@ -620,24 +524,9 @@ public class AiravataServerHandler implements Airavata.Iface {
@SecurityCheck
public void updateProject(AuthzToken authzToken, String projectId, Project updatedProject) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, ProjectNotFoundException, AuthorizationException, TException {
-
- if (!validateString(projectId) || !validateString(projectId)){
- logger.error("Project id cannot be empty...");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Project id cannot be empty...");
- throw exception;
- }
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.PROJECT, projectId)){
- logger.error("Project does not exist in the system. Please provide a valid project ID...");
- ProjectNotFoundException exception = new ProjectNotFoundException();
- exception.setMessage("Project does not exist in the system. Please provide a valid project ID...");
- throw exception;
- }
-
- Project existingProject = (Project) experimentCatalog.get(ExperimentCatalogModelType.PROJECT, projectId);
+ RegistryService.Client regClient = getRegistryServiceClient();
+ Project existingProject = regClient.getProject(projectId);
if(!authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.USER_NAME).equals(existingProject.getOwner())
|| !authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.GATEWAY_ID).equals(existingProject.getGatewayId())){
try {
@@ -650,34 +539,24 @@ public class AiravataServerHandler implements Airavata.Iface {
throw new AuthorizationException("User does not have permission to access this resource");
}
}
-
- experimentCatalog.update(ExperimentCatalogModelType.PROJECT, updatedProject, projectId);
+ regClient.updateProject(projectId, updatedProject);
logger.debug("Airavata updated project with project Id : " + projectId );
- } catch (RegistryException e) {
+ } catch (RegistryServiceException | ApplicationSettingsException e) {
logger.error("Error while updating the project", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
exception.setMessage("Error while updating the project. More info : " + e.getMessage());
throw exception;
}
-
}
@Override
@SecurityCheck
public boolean deleteProject(AuthzToken authzToken, String projectId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, ProjectNotFoundException, AuthorizationException, TException {
-
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.PROJECT, projectId)) {
- logger.error("Project does not exist in the system. Please provide a valid project ID...");
- ProjectNotFoundException exception = new ProjectNotFoundException();
- exception.setMessage("Project does not exist in the system. Please provide a valid project ID...");
- throw exception;
- }
-
- Project existingProject = (Project) experimentCatalog.get(ExperimentCatalogModelType.PROJECT, projectId);
+ RegistryService.Client regClient = getRegistryServiceClient();
+ Project existingProject = regClient.getProject(projectId);
if(!authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.USER_NAME).equals(existingProject.getOwner())
|| !authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.GATEWAY_ID).equals(existingProject.getGatewayId())){
try {
@@ -690,11 +569,10 @@ public class AiravataServerHandler implements Airavata.Iface {
throw new AuthorizationException("User does not have permission to access this resource");
}
}
-
- experimentCatalog.remove(ExperimentCatalogModelType.PROJECT, projectId);
+ boolean ret = regClient.deleteProject(projectId);
logger.debug("Airavata deleted project with project Id : " + projectId );
- return true;
- } catch (RegistryException e) {
+ return ret;
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while removing the project", e);
ProjectNotFoundException exception = new ProjectNotFoundException();
exception.setMessage("Error while removing the project. More info : " + e.getMessage());
@@ -720,16 +598,7 @@ public class AiravataServerHandler implements Airavata.Iface {
public Project getProject(AuthzToken authzToken, String projectId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, ProjectNotFoundException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.PROJECT, projectId)){
- logger.error("Project does not exist in the system. Please provide a valid project ID...");
- ProjectNotFoundException exception = new ProjectNotFoundException();
- exception.setMessage("Project does not exist in the system. Please provide a valid project ID...");
- throw exception;
- }
- logger.debug("Airavata retrieved project with project Id : " + projectId );
-
- Project project = (Project) experimentCatalog.get(ExperimentCatalogModelType.PROJECT, projectId);
+ Project project = getRegistryServiceClient().getProject(projectId);
if(authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.USER_NAME).equals(project.getOwner())
&& authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.GATEWAY_ID).equals(project.getGatewayId())){
return project;
@@ -746,7 +615,7 @@ public class AiravataServerHandler implements Airavata.Iface {
throw new AuthorizationException("User does not have permission to access this resource");
}
}
- } catch (RegistryException e) {
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while retrieving the project", e);
ProjectNotFoundException exception = new ProjectNotFoundException();
exception.setMessage("Error while retrieving the project. More info : " + e.getMessage());
@@ -773,40 +642,9 @@ public class AiravataServerHandler implements Airavata.Iface {
public List<Project> getUserProjects(AuthzToken authzToken, String gatewayId, String userName,
int limit, int offset)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
- if (!validateString(userName)){
- logger.error("Username cannot be empty. Please provide a valid user..");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Username cannot be empty. Please provide a valid user..");
- throw exception;
- }
- if (!isGatewayExistInternal(gatewayId)){
- logger.error("Gateway does not exist.Please provide a valid gateway id...");
- throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- }
- List<Project> projects = new ArrayList<Project>();
try {
- if (!ExpCatResourceUtils.isUserExist(userName, gatewayId)){
- logger.error("User does not exist in the system. Please provide a valid user..");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("User does not exist in the system. Please provide a valid user..");
- throw exception;
- }
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- Map<String, String> filters = new HashMap<String, String>();
- filters.put(Constants.FieldConstants.ProjectConstants.OWNER, userName);
- filters.put(Constants.FieldConstants.ProjectConstants.GATEWAY_ID, gatewayId);
- List<Object> list = experimentCatalog.search(ExperimentCatalogModelType.PROJECT, filters, limit, offset,
- Constants.FieldConstants.ProjectConstants.CREATION_TIME, ResultOrderType.DESC);
- if (list != null && !list.isEmpty()){
- for (Object o : list){
- projects.add((Project) o);
- }
- }
- logger.debug("Airavata retrieved projects for user : " + userName + " and gateway id : " + gatewayId );
- return projects;
- } catch (RegistryException e) {
+ return getRegistryServiceClient().getUserProjects(gatewayId, userName, limit, offset);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while retrieving projects", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -840,50 +678,11 @@ public class AiravataServerHandler implements Airavata.Iface {
@Override
public List<Project> searchProjects(AuthzToken authzToken, String gatewayId, String userName, Map<ProjectSearchFields,
String> filters, int limit, int offset) throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
- if (!validateString(userName)){
- logger.error("Username cannot be empty. Please provide a valid user..");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Username cannot be empty. Please provide a valid user..");
- throw exception;
- }
- if (!isGatewayExistInternal(gatewayId)){
- logger.error("Gateway does not exist.Please provide a valid gateway id...");
- throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- }
try {
- if (!ExpCatResourceUtils.isUserExist(userName, gatewayId)){
- logger.error("User does not exist in the system. Please provide a valid user..");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("User does not exist in the system. Please provide a valid user..");
- throw exception;
- }
- List<Project> projects = new ArrayList<Project>();
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- Map<String, String> regFilters = new HashMap<String, String>();
- regFilters.put(Constants.FieldConstants.ProjectConstants.GATEWAY_ID, gatewayId);
- for(Map.Entry<ProjectSearchFields, String> entry : filters.entrySet())
- {
- if(entry.getKey().equals(ProjectSearchFields.PROJECT_NAME)){
- regFilters.put(Constants.FieldConstants.ProjectConstants.PROJECT_NAME, entry.getValue());
- }else if(entry.getKey().equals(ProjectSearchFields.PROJECT_DESCRIPTION)){
- regFilters.put(Constants.FieldConstants.ProjectConstants.DESCRIPTION, entry.getValue());
- }
- }
List<String> accessibleProjIds = new ArrayList<>();
accessibleProjIds.addAll(getAllAccessibleResourcesForUser(userName+"@"+gatewayId, ResourceType.PROJECT, ResourcePermissionType.READ));
- if(accessibleProjIds.size() == 0)
- return new ArrayList<>();
-
- List<Object> results = experimentCatalog.searchAllAccessible(ExperimentCatalogModelType.PROJECT, accessibleProjIds,
- regFilters, limit, offset, Constants.FieldConstants.ProjectConstants.CREATION_TIME, ResultOrderType.DESC);
- for (Object object : results) {
- projects.add((Project)object);
- }
- logger.debug("Airavata retrieved projects for user : " + userName + " and gateway id : " + gatewayId);
- return projects;
+ return getRegistryServiceClient().searchProjects(gatewayId, userName, accessibleProjIds, filters, limit, offset);
}catch (Exception e) {
logger.error("Error while retrieving projects", e);
AiravataSystemException exception = new AiravataSystemException();
@@ -914,61 +713,10 @@ public class AiravataServerHandler implements Airavata.Iface {
public List<ExperimentSummaryModel> searchExperiments(AuthzToken authzToken, String gatewayId, String userName, Map<ExperimentSearchFields,
String> filters, int limit, int offset)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
- if (!validateString(userName)){
- logger.error("Username cannot be empty. Please provide a valid user..");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Username cannot be empty. Please provide a valid user..");
- throw exception;
- }
- if (!isGatewayExistInternal(gatewayId)){
- logger.error("Gateway does not exist.Please provide a valid gateway id...");
- throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- }
try {
- if (!ExpCatResourceUtils.isUserExist(userName, gatewayId)){
- logger.error("User does not exist in the system. Please provide a valid user..");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("User does not exist in the system. Please provide a valid user..");
- throw exception;
- }
- List<ExperimentSummaryModel> summaries = new ArrayList<ExperimentSummaryModel>();
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- Map<String, String> regFilters = new HashMap();
- regFilters.put(Constants.FieldConstants.ExperimentConstants.GATEWAY_ID, gatewayId);
- for(Map.Entry<ExperimentSearchFields, String> entry : filters.entrySet())
- {
- if(entry.getKey().equals(ExperimentSearchFields.EXPERIMENT_NAME)){
- regFilters.put(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_NAME, entry.getValue());
- }else if(entry.getKey().equals(ExperimentSearchFields.EXPERIMENT_DESC)){
- regFilters.put(Constants.FieldConstants.ExperimentConstants.DESCRIPTION, entry.getValue());
- }else if(entry.getKey().equals(ExperimentSearchFields.APPLICATION_ID)){
- regFilters.put(Constants.FieldConstants.ExperimentConstants.EXECUTION_ID, entry.getValue());
- }else if(entry.getKey().equals(ExperimentSearchFields.STATUS)){
- regFilters.put(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_STATUS, entry.getValue());
- }else if(entry.getKey().equals(ExperimentSearchFields.FROM_DATE)){
- regFilters.put(Constants.FieldConstants.ExperimentConstants.FROM_DATE, entry.getValue());
- }else if(entry.getKey().equals(ExperimentSearchFields.TO_DATE)){
- regFilters.put(Constants.FieldConstants.ExperimentConstants.TO_DATE, entry.getValue());
- }else if(entry.getKey().equals(ExperimentSearchFields.PROJECT_ID)){
- regFilters.put(Constants.FieldConstants.ExperimentConstants.PROJECT_ID, entry.getValue());
- }
- }
List<String> accessibleExpIds = new ArrayList<>();
accessibleExpIds.addAll(getAllAccessibleResourcesForUser(userName + "@" + gatewayId, ResourceType.EXPERIMENT, ResourcePermissionType.READ));
-
- if(accessibleExpIds.size() == 0)
- return new ArrayList<>();
-
- List<Object> results = experimentCatalog.searchAllAccessible(ExperimentCatalogModelType.EXPERIMENT,
- accessibleExpIds, regFilters, limit,
- offset, Constants.FieldConstants.ExperimentConstants.CREATION_TIME, ResultOrderType.DESC);
- for (Object object : results) {
- summaries.add((ExperimentSummaryModel) object);
- }
- logger.debug("Airavata retrieved experiments for user : " + userName + " and gateway id : " + gatewayId );
- return summaries;
+ return getRegistryServiceClient().searchExperiments(gatewayId, userName, accessibleExpIds, filters, limit, offset);
}catch (Exception e) {
logger.error("Error while retrieving experiments", e);
AiravataSystemException exception = new AiravataSystemException();
@@ -995,19 +743,8 @@ public class AiravataServerHandler implements Airavata.Iface {
@SecurityCheck
public ExperimentStatistics getExperimentStatistics(AuthzToken authzToken, String gatewayId, long fromTime, long toTime)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
- if (!isGatewayExistInternal(gatewayId)){
- logger.error("Gateway does not exist.Please provide a valid gateway id...");
- throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- }
try {
- Map<String, String> filters = new HashMap();
- filters.put(Constants.FieldConstants.ExperimentConstants.GATEWAY_ID, gatewayId);
- filters.put(Constants.FieldConstants.ExperimentConstants.FROM_DATE, fromTime+"");
- filters.put(Constants.FieldConstants.ExperimentConstants.TO_DATE, toTime+"");
-
- List<Object> results = experimentCatalog.search(ExperimentCatalogModelType.EXPERIMENT_STATISTICS, filters);
- logger.debug("Airavata retrieved experiments for gateway id : " + gatewayId + " between : " + AiravataUtils.getTime(fromTime) + " and " + AiravataUtils.getTime(toTime));
- return (ExperimentStatistics) results.get(0);
+ return getRegistryServiceClient().getExperimentStatistics(gatewayId, fromTime, toTime);
}catch (Exception e) {
logger.error("Error while retrieving experiments", e);
AiravataSystemException exception = new AiravataSystemException();
@@ -1033,23 +770,10 @@ public class AiravataServerHandler implements Airavata.Iface {
public List<ExperimentModel> getExperimentsInProject(AuthzToken authzToken, String projectId, int limit, int offset)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, ProjectNotFoundException,
AuthorizationException, TException {
- if (!validateString(projectId)){
- logger.error("Project id cannot be empty. Please provide a valid project ID...");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Project id cannot be empty. Please provide a valid project ID...");
- throw exception;
- }
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.PROJECT, projectId)){
- logger.error("Project does not exist in the system. Please provide a valid project ID...");
- ProjectNotFoundException exception = new ProjectNotFoundException();
- exception.setMessage("Project does not exist in the system. Please provide a valid project ID...");
- throw exception;
- }
+ RegistryService.Client regClient = getRegistryServiceClient();
+ Project project = regClient.getProject(projectId);
- Project project = (Project) experimentCatalog.get(ExperimentCatalogModelType.PROJECT, projectId);
if(!authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.USER_NAME).equals(project.getOwner())
|| !authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.GATEWAY_ID).equals(project.getGatewayId())){
try {
@@ -1062,18 +786,7 @@ public class AiravataServerHandler implements Airavata.Iface {
throw new AuthorizationException("User does not have permission to access this resource");
}
}
-
- List<ExperimentModel> experiments = new ArrayList<ExperimentModel>();
- List<Object> list = experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT,
- Constants.FieldConstants.ExperimentConstants.PROJECT_ID, projectId, limit, offset,
- Constants.FieldConstants.ExperimentConstants.CREATION_TIME, ResultOrderType.DESC);
- if (list != null && !list.isEmpty()) {
- for (Object o : list) {
- experiments.add((ExperimentModel) o);
- }
- }
- logger.debug("Airavata retrieved experiments for project : " + projectId);
- return experiments;
+ return regClient.getExperimentsInProject(projectId, limit, offset);
} catch (Exception e) {
logger.error("Error while retrieving the experiments", e);
AiravataSystemException exception = new AiravataSystemException();
@@ -1101,37 +814,8 @@ public class AiravataServerHandler implements Airavata.Iface {
public List<ExperimentModel> getUserExperiments(AuthzToken authzToken, String gatewayId, String userName, int limit,
int offset) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
- if (!validateString(userName)){
- logger.error("Username cannot be empty. Please provide a valid user..");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Username cannot be empty. Please provide a valid user..");
- throw exception;
- }
- if (!isGatewayExistInternal(gatewayId)){
- logger.error("Gateway does not exist.Please provide a valid gateway id...");
- throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- }
try {
- if (!ExpCatResourceUtils.isUserExist(userName, gatewayId)){
- logger.error("User does not exist in the system. Please provide a valid user..");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("User does not exist in the system. Please provide a valid user..");
- throw exception;
- }
- List<ExperimentModel> experiments = new ArrayList<ExperimentModel>();
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- List<Object> list = experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT,
- Constants.FieldConstants.ExperimentConstants.USER_NAME, userName, limit, offset,
- Constants.FieldConstants.ExperimentConstants.CREATION_TIME, ResultOrderType.DESC);
- if (list != null && !list.isEmpty()){
- for (Object o : list){
- experiments.add((ExperimentModel)o);
- }
- }
- logger.debug("Airavata retrieved experiments for user : " + userName);
- return experiments;
+ return getRegistryServiceClient().getUserExperiments(gatewayId, userName, limit, offset);
} catch (Exception e) {
logger.error("Error while retrieving the experiments", e);
AiravataSystemException exception = new AiravataSystemException();
@@ -1168,37 +852,7 @@ public class AiravataServerHandler implements Airavata.Iface {
public String createExperiment(AuthzToken authzToken, String gatewayId, ExperimentModel experiment) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getExperimentCatalog(gatewayId);
- appCatalog = RegistryFactory.getAppCatalog();
- if (!validateString(experiment.getExperimentName())){
- logger.error("Cannot create experiments with empty experiment name");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Cannot create experiments with empty experiment name");
- throw exception;
- }
- if (!isGatewayExistInternal(gatewayId)){
- logger.error("Gateway does not exist.Please provide a valid gateway id...");
- throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- }
-
- if(experiment.getUserConfigurationData() != null && experiment.getUserConfigurationData()
- .getComputationalResourceScheduling() != null){
-
- String compResourceId = experiment.getUserConfigurationData()
- .getComputationalResourceScheduling().getResourceHostId();
- ComputeResourceDescription computeResourceDescription = appCatalog.getComputeResource()
- .getComputeResource(compResourceId);
- if(!computeResourceDescription.isEnabled()){
- logger.error("Compute Resource is not enabled by the Admin!");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Compute Resource is not enabled by the Admin!");
- throw exception;
- }
- }
-
- String experimentId = (String) experimentCatalog.add(ExpCatParentDataType.EXPERIMENT, experiment, gatewayId);
+ String experimentId = getRegistryServiceClient().createExperiment(gatewayId, experiment);
GroupManagerCPI groupManager = GroupManagerFactory.getGroupManager();
Resource expResource = new Resource(experimentId, org.apache.airavata.grouper.resource.ResourceType.EXPERIMENT);
expResource.setOwnerId(experiment.getUserName()+"@"+experiment.getGatewayId());
@@ -1241,11 +895,8 @@ public class AiravataServerHandler implements Airavata.Iface {
@SecurityCheck
public boolean deleteExperiment(AuthzToken authzToken, String experimentId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, experimentId)){
- throw new ExperimentNotFoundException("Requested experiment id " + experimentId + " does not exist in the system..");
- }
- ExperimentModel experimentModel = (ExperimentModel) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT, experimentId);
+ RegistryService.Client regClient = getRegistryServiceClient();
+ ExperimentModel experimentModel = regClient.getExperiment(experimentId);
if(!authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.USER_NAME).equals(experimentModel.getUserName())
|| !authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.GATEWAY_ID).equals(experimentModel.getGatewayId())){
@@ -1264,9 +915,7 @@ public class AiravataServerHandler implements Airavata.Iface {
logger.error("Error while deleting the experiment");
throw new ExperimentCatalogException("Experiment is not in CREATED state. Hence cannot deleted. ID:"+ experimentId);
}
- experimentCatalog.remove(ExperimentCatalogModelType.EXPERIMENT, experimentId);
- logger.debug("Airavata removed experiment with experiment id : " + experimentId);
- return true;
+ return regClient.deleteExperiment(experimentId);
} catch (Exception e) {
logger.error("Error while deleting the experiment", e);
AiravataSystemException exception = new AiravataSystemException();
@@ -1302,7 +951,16 @@ public class AiravataServerHandler implements Airavata.Iface {
@SecurityCheck
public ExperimentModel getExperiment(AuthzToken authzToken, String airavataExperimentId) throws InvalidRequestException,
ExperimentNotFoundException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
- ExperimentModel experimentModel = getExperimentInternal(airavataExperimentId);
+ ExperimentModel experimentModel = null;
+ try {
+ experimentModel = getRegistryServiceClient().getExperiment(airavataExperimentId);
+ } catch (ApplicationSettingsException e) {
+ logger.error("Error while getting the experiment", e);
+ AiravataSystemException exception = new AiravataSystemException();
+ exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage("Error while getting the experiment. More info : " + e.getMessage());
+ throw exception;
+ }
if(authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.USER_NAME).equals(experimentModel.getUserName())
&& authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.GATEWAY_ID).equals(experimentModel.getGatewayId())){
return experimentModel;
@@ -1349,39 +1007,7 @@ public class AiravataServerHandler implements Airavata.Iface {
public ExperimentModel getDetailedExperimentTree(AuthzToken authzToken, String airavataExperimentId) throws InvalidRequestException,
ExperimentNotFoundException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- ExperimentModel experimentModel = getExperimentInternal(airavataExperimentId);
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- List<Object> processObjects = experimentCatalog.get(ExperimentCatalogModelType.PROCESS,
- Constants.FieldConstants.ExperimentConstants.EXPERIMENT_ID, experimentModel.getExperimentId());
- List<ProcessModel> processList = new ArrayList<>();
- if(processObjects != null){
- processObjects.stream().forEach(p -> {
- //Process already has the task object
- ((ProcessModel)p).getTasks().stream().forEach(t->{
- try {
- List<Object> jobObjects = experimentCatalog.get(ExperimentCatalogModelType.JOB,
- Constants.FieldConstants.JobConstants.TASK_ID, ((TaskModel)t).getTaskId());
- List<JobModel> jobList = new ArrayList<JobModel>();
- if(jobObjects != null){
- jobObjects.stream().forEach(j -> jobList.add((JobModel)j));
- Collections.sort(jobList, new Comparator<JobModel>() {
- @Override
- public int compare(JobModel o1, JobModel o2) {
- return (int) (o1.getCreationTime() - o2.getCreationTime());
- }
- });
- t.setJobs(jobList);
- }
- } catch (RegistryException e) {
- logger.error(e.getMessage(), e);
- }
- });
- processList.add((ProcessModel)p);
- });
- experimentModel.setProcesses(processList);
- }
- logger.debug("Airavata retrieved detailed experiment with experiment id : " + airavataExperimentId);
- return experimentModel;
+ return getRegistryServiceClient().getDetailedExperimentTree(airavataExperimentId);
} catch (Exception e) {
logger.error("Error while retrieving the experiment", e);
AiravataSystemException exception = new AiravataSystemException();
@@ -1391,24 +1017,6 @@ public class AiravataServerHandler implements Airavata.Iface {
}
}
- /*This private method wraps the logic of getExperiment method as this method is called internally in the API.*/
- private ExperimentModel getExperimentInternal(String airavataExperimentId) throws InvalidRequestException,
- ExperimentNotFoundException, AiravataClientException, AiravataSystemException, TException {
- try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
- throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
- }
- return (ExperimentModel) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId);
- } catch (RegistryException e) {
- logger.error("Error while retrieving the experiment", e);
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Error while retrieving the experiment. More info : " + e.getMessage());
- throw exception;
- }
- }
-
/**
* Configure a previously created experiment with required inputs, scheduling and other quality of service
* parameters. This method only updates the experiment object within the registry. The experiment has to be launched
@@ -1439,13 +1047,8 @@ public class AiravataServerHandler implements Airavata.Iface {
throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)) {
- logger.error(airavataExperimentId, "Update request failed, Experiment {} doesn't exist.", airavataExperimentId);
- throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
- }
-
- ExperimentModel experimentModel = (ExperimentModel) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId);
+ RegistryService.Client regClient = getRegistryServiceClient();
+ ExperimentModel experimentModel = regClient.getExperiment(airavataExperimentId);
if(!authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.USER_NAME).equals(experimentModel.getUserName())
|| !authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.GATEWAY_ID).equals(experimentModel.getGatewayId())){
try {
@@ -1459,47 +1062,8 @@ public class AiravataServerHandler implements Airavata.Iface {
}
}
- ExperimentStatus experimentStatus = getExperimentStatusInternal(airavataExperimentId);
- if (experimentStatus != null){
- ExperimentState experimentState = experimentStatus.getState();
- switch (experimentState){
- case CREATED: case VALIDATED:
- if(experiment.getUserConfigurationData() != null && experiment.getUserConfigurationData()
- .getComputationalResourceScheduling() != null){
- String compResourceId = experiment.getUserConfigurationData()
- .getComputationalResourceScheduling().getResourceHostId();
- ComputeResourceDescription computeResourceDescription = appCatalog.getComputeResource()
- .getComputeResource(compResourceId);
- if(!computeResourceDescription.isEnabled()){
- logger.error("Compute Resource is not enabled by the Admin!");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Compute Resource is not enabled by the Admin!");
- throw exception;
- }
- }
- experimentCatalog.update(ExperimentCatalogModelType.EXPERIMENT, experiment, airavataExperimentId);
- logger.debug(airavataExperimentId, "Successfully updated experiment {} ", experiment.getExperimentName());
- break;
- default:
- logger.error(airavataExperimentId, "Error while updating experiment. Update experiment is only valid for experiments " +
- "with status CREATED, VALIDATED, CANCELLED, FAILED and UNKNOWN. Make sure the given " +
- "experiment is in one of above statuses... ");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Error while updating experiment. Update experiment is only valid for experiments " +
- "with status CREATED, VALIDATED, CANCELLED, FAILED and UNKNOWN. Make sure the given " +
- "experiment is in one of above statuses... ");
- throw exception;
- }
- }
- } catch (RegistryException e) {
- logger.error(airavataExperimentId, "Error while updating experiment", e);
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Error while updating experiment. More info : " + e.getMessage());
- throw exception;
- } catch (AppCatalogException e) {
+ regClient.updateExperiment(airavataExperimentId, experiment);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error(airavataExperimentId, "Error while updating experiment", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -1513,31 +1077,7 @@ public class AiravataServerHandler implements Airavata.Iface {
public void updateExperimentConfiguration(AuthzToken authzToken, String airavataExperimentId, UserConfigurationDataModel userConfiguration)
throws AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
- logger.error(airavataExperimentId, "Update experiment configuration failed, experiment {} doesn't exist.", airavataExperimentId);
- throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
- }
- ExperimentStatus experimentStatus = getExperimentStatusInternal(airavataExperimentId);
- if (experimentStatus != null){
- ExperimentState experimentState = experimentStatus.getState();
- switch (experimentState){
- case CREATED: case VALIDATED: case CANCELED: case FAILED:
- experimentCatalog.add(ExpCatChildDataType.USER_CONFIGURATION_DATA, userConfiguration, airavataExperimentId);
- logger.debug(airavataExperimentId, "Successfully updated experiment configuration for experiment {}.", airavataExperimentId);
- break;
- default:
- logger.error(airavataExperimentId, "Error while updating experiment {}. Update experiment is only valid for experiments " +
- "with status CREATED, VALIDATED, CANCELLED, FAILED and UNKNOWN. Make sure the given " +
- "experiment is in one of above statuses... ", airavataExperimentId);
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Error while updating experiment. Update experiment is only valid for experiments " +
- "with status CREATED, VALIDATED, CANCELLED, FAILED and UNKNOWN. Make sure the given " +
- "experiment is in one of above statuses... ");
- throw exception;
- }
- }
+ getRegistryServiceClient().send_updateExperimentConfiguration(airavataExperimentId, userConfiguration);
} catch (Exception e) {
logger.error(airavataExperimentId, "Error while updating user configuration", e);
AiravataSystemException exception = new AiravataSystemException();
@@ -1555,31 +1095,7 @@ public class AiravataServerHandler implements Airavata.Iface {
public void updateResourceScheduleing(AuthzToken authzToken, String airavataExperimentId,
ComputationalResourceSchedulingModel resourceScheduling) throws AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
- logger.debug(airavataExperimentId, "Update resource scheduling failed, experiment {} doesn't exist.", airavataExperimentId);
- throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
- }
- ExperimentStatus experimentStatus = getExperimentStatusInternal(airavataExperimentId);
- if (experimentStatus != null){
- ExperimentState experimentState = experimentStatus.getState();
- switch (experimentState){
- case CREATED: case VALIDATED: case CANCELED: case FAILED:
- experimentCatalog.add(ExpCatChildDataType.PROCESS_RESOURCE_SCHEDULE, resourceScheduling, airavataExperimentId);
- logger.debug(airavataExperimentId, "Successfully updated resource scheduling for the experiment {}.", airavataExperimentId);
- break;
- default:
- logger.error(airavataExperimentId, "Error while updating scheduling info. Update experiment is only valid for experiments " +
- "with status CREATED, VALIDATED, CANCELLED, FAILED and UNKNOWN. Make sure the given " +
- "experiment is in one of above statuses... ");
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Error while updating experiment. Update experiment is only valid for experiments " +
- "with status CREATED, VALIDATED, CANCELLED, FAILED and UNKNOWN. Make sure the given " +
- "experiment is in one of above statuses... ");
- throw exception;
- }
- }
+ getRegistryServiceClient().updateResourceScheduleing(airavataExperimentId, resourceScheduling);
} catch (Exception e) {
logger.error(airavataExperimentId, "Error while updating scheduling info", e);
AiravataSystemException exception = new AiravataSystemException();
@@ -1608,12 +1124,12 @@ public class AiravataServerHandler implements Airavata.Iface {
public boolean validateExperiment(AuthzToken authzToken, String airavataExperimentId) throws InvalidRequestException,
ExperimentNotFoundException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)) {
+ ExperimentModel experimentModel = getRegistryServiceClient().getExperiment(airavataExperimentId);
+ if (experimentModel == null) {
logger.error(airavataExperimentId, "Experiment validation failed , experiment {} doesn't exist.", airavataExperimentId);
throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
}
- } catch (RegistryException e1) {
+ } catch (RegistryServiceException | ApplicationSettingsException e1) {
logger.error(airavataExperimentId, "Error while retrieving projects", e1);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -1665,43 +1181,22 @@ public class AiravataServerHandler implements Airavata.Iface {
@SecurityCheck
public ExperimentStatus getExperimentStatus(AuthzToken authzToken, String airavataExperimentId) throws InvalidRequestException,
ExperimentNotFoundException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
- ExperimentStatus experimentStatus = getExperimentStatusInternal(airavataExperimentId);
- logger.debug("Airavata retrieved experiment status for experiment id : " + airavataExperimentId);
- return experimentStatus;
- }
-
- /*Private method wraps the logic of getExperimentStatus method since this method is called internally.*/
- private ExperimentStatus getExperimentStatusInternal(String airavataExperimentId) throws InvalidRequestException,
- ExperimentNotFoundException, AiravataClientException, AiravataSystemException, TException {
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
- logger.error(airavataExperimentId, "Error while retrieving experiment status, experiment {} doesn't exist.", airavataExperimentId);
- throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId +
- " does not exist in the system..");
- }
- return (ExperimentStatus) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT_STATUS, airavataExperimentId);
- } catch (Exception e) {
- logger.error(airavataExperimentId, "Error while retrieving the experiment status", e);
+ return getRegistryServiceClient().getExperimentStatus(airavataExperimentId);
+ } catch (ApplicationSettingsException e) {
AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Error while retrieving the experiment status. More info : " + e.getMessage());
+ exception.setMessage(e.getMessage());
throw exception;
}
}
+
@Override
@SecurityCheck
public List<OutputDataObjectType> getExperimentOutputs(AuthzToken authzToken, String airavataExperimentId)
throws AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
- logger.error(airavataExperimentId, "Get experiment outputs failed, experiment {} doesn't exit.", airavataExperimentId);
- throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
- }
- logger.debug("Airavata retrieved experiment outputs for experiment id : " + airavataExperimentId);
- return (List<OutputDataObjectType>) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT_OUTPUT, airavataExperimentId);
+ return getRegistryServiceClient().getExperimentOutputs(airavataExperimentId);
} catch (Exception e) {
logger.error(airavataExperimentId, "Error while retrieving the experiment outputs", e);
AiravataSystemException exception = new AiravataSystemException();
@@ -1722,37 +1217,7 @@ public class AiravataServerHandler implements Airavata.Iface {
public Map<String, JobStatus> getJobStatuses(AuthzToken authzToken, String airavataExperimentId)
throws AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
- logger.error(airavataExperimentId, "Error while retrieving job details, experiment {} doesn't exist.", airavataExperimentId);
- throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
- }
- List<Object> processModels = experimentCatalog.get(ExperimentCatalogModelType.PROCESS, Constants.FieldConstants.ProcessConstants.EXPERIMENT_ID, airavataExperimentId);
- Map<String, JobStatus> jobStatus = new HashMap<String, JobStatus>();
- if (processModels != null && !processModels.isEmpty()){
- for (Object process : processModels) {
- ProcessModel processModel = (ProcessModel) process;
- List<TaskModel> tasks = processModel.getTasks();
- if (tasks != null && !tasks.isEmpty()){
- for (TaskModel task : tasks){
- String taskId = task.getTaskId();
- List<Object> jobs = experimentCatalog.get(ExperimentCatalogModelType.JOB, Constants.FieldConstants.JobConstants.TASK_ID, taskId);
- if (jobs != null && !jobs.isEmpty()){
- for (Object jobObject : jobs) {
- JobModel jobModel = (JobModel) jobObject;
- String jobID = jobModel.getJobId();
- JobStatus status = jobModel.getJobStatus();
- if (status != null){
- jobStatus.put(jobID, status);
- }
- }
- }
- }
- }
- }
- }
- logger.debug("Airavata retrieved job statuses for experiment with experiment id : " + airavataExperimentId);
- return jobStatus;
+ return getRegistryServiceClient().getJobStatuses(airavataExperimentId);
} catch (Exception e) {
logger.error(airavataExperimentId, "Error while retrieving the job statuses", e);
AiravataSystemException exception = new AiravataSystemException();
@@ -1767,30 +1232,7 @@ public class AiravataServerHandler implements Airavata.Iface {
public List<JobModel> getJobDetails(AuthzToken authzToken, String airavataExperimentId) throws InvalidRequestException,
ExperimentNotFoundException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)){
- logger.error(airavataExperimentId, "Error while retrieving job details, experiment {} doesn't exist.", airavataExperimentId);
- throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
- }
- List<Object> processModels = experimentCatalog.get(ExperimentCatalogModelType.PROCESS, Constants.FieldConstants.ProcessConstants.EXPERIMENT_ID, airavataExperimentId);
- List<JobModel> jobList = new ArrayList<>();
- if (processModels != null && !processModels.isEmpty()){
- for (Object process : processModels) {
- ProcessModel processModel = (ProcessModel) process;
- List<TaskModel> tasks = processModel.getTasks();
- if (tasks != null && !tasks.isEmpty()){
- for (TaskModel taskModel : tasks){
- String taskId = taskModel.getTaskId();
- List<Object> jobs = experimentCatalog.get(ExperimentCatalogModelType.JOB, Constants.FieldConstants.JobConstants.TASK_ID, taskId);
- for (Object jobObject : jobs) {
- jobList.add ((JobModel)jobObject);
- }
- }
- }
- }
- }
- logger.debug("Airavata retrieved job models for experiment with experiment id : " + airavataExperimentId);
- return jobList;
+ return getRegistryServiceClient().getJobDetails(airavataExperimentId);
} catch (Exception e) {
logger.error(airavataExperimentId, "Error while retrieving the job details", e);
AiravataSystemException exception = new AiravataSystemException();
@@ -1833,45 +1275,35 @@ public class AiravataServerHandler implements Airavata.Iface {
public void launchExperiment(AuthzToken authzToken, final String airavataExperimentId, String gatewayId)
throws AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- appCatalog = RegistryFactory.getAppCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId)) {
+ ExperimentModel experiment = getRegistryServiceClient().getExperiment(airavataExperimentId);
+ if (experiment == null) {
logger.error(airavataExperimentId, "Error while launching experiment, experiment {} doesn't exist.", airavataExperimentId);
throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
}
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.GATEWAY, gatewayId)) {
- logger.error(airavataExperimentId, "Error while launching experiment, gatewayId {} doesn't exist.", gatewayId);
- throw new ExperimentNotFoundException("Requested gateway id " + gatewayId + " does not exist in the system..");
- }
- ExperimentModel experiment = getExperimentInternal(airavataExperimentId);
- String applicationID = experiment.getExecutionId();
- if (!appCatalog.getApplicationInterface().isApplicationInterfaceExists(applicationID)){
- logger.error(airavataExperimentId, "Error while launching experiment, application id {} for experiment {} doesn't exist.", applicationID, airavataExperimentId);
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Error while launching experiment, application id : " + applicationID + " for experiment : " + airavataExperimentId +
- " doesn't exist..");
- throw exception;
- }
+// FIXME
+// String applicationID = experiment.getExecutionId();
+// if (!appCatalog.getApplicationInterface().isApplicationInterfaceExists(applicationID)){
+// logger.error(airavataExperimentId, "Error while launching experiment, application id {} for experiment {} doesn't exist.", applicationID, airavataExperimentId);
+// AiravataSystemException exception = new AiravataSystemException();
+// exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+// exception.setMessage("Error while launching experiment, application id : " + applicationID + " for experiment : " + airavataExperimentId +
+// " doesn't exist..");
+// throw exception;
+// }
OrchestratorService.Client orchestratorClient = getOrchestratorClient();
if (orchestratorClient.validateExperiment(airavataExperimentId)) {
orchestratorClient.launchExperiment(airavataExperimentId, gatewayId);
logger.debug("Airavata launched experiment with experiment id : " + airavataExperimentId);
}else {
logger.error(airavataExperimentId, "Couldn't identify experiment type, experiment {} is neither single application nor workflow.", airavataExperimentId);
- throw new InvalidRequestException("Experiment '" + airavataExperimentId + "' launch failed. Unable to figureout execution type for application " + applicationID);
+ throw new InvalidRequestException("Experiment '" + airavataExperimentId + "' launch failed. Unable to figureout execution type for application " + experiment.getExecutionId());
}
- } catch (RegistryException e1) {
+ } catch (RegistryServiceException | ApplicationSettingsException e1) {
logger.error(airavataExperimentId, "Error while instantiate the registry instance", e1);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
exception.setMessage("Error while instantiate the registry instance. More info : " + e1.getMessage());
throw exception;
- } catch (AppCatalogException e) {
- logger.error(airavataExperimentId, "Error while instantiate the registry instance", e);
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Error while instantiate the registry instance. More info : " + e.getMessage());
}
}
@@ -1933,16 +1365,17 @@ public class AiravataServerHandler implements Airavata.Iface {
throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
try {
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, existingExperimentID)){
+ RegistryService.Client regClient = getRegistryServiceClient();
+ ExperimentModel existingExperiment = regClient.getExperiment(existingExperimentID);
+ if (existingExperiment == null){
logger.error(existingExperimentID, "Error while cloning experiment {}, experiment doesn't exist.", existingExperimentID);
throw new ExperimentNotFoundException("Requested experiment id " + existingExperimentID + " does not exist in the system..");
}
- ExperimentModel existingExperiment = (ExperimentModel) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT, existingExperimentID);
- String gatewayId = (String) experimentCatalog.getValue(ExperimentCatalogModelType.EXPERIMENT, existingExperimentID, Constants.FieldConstants.ExperimentConstants.GATEWAY_ID);
+
+ String gatewayId = existingExperiment.getGatewayId();
existingExperiment.setCreationTime(AiravataUtils.getCurrentTimestamp().getTime());
if (existingExperiment.getExecutionId() != null){
- List<OutputDataObjectType> applicationOutputs = getApplicationOutputsInternal(existingExperiment.getExecutionId());
+ List<OutputDataObjectType> applicationOutputs = regClient.getApplicationOutputs(existingExperiment.getExecutionId());
existingExperiment.setExperimentOutputs(applicationOutputs);
}
if (validateString(newExperiementName)){
@@ -1956,15 +1389,14 @@ public class AiravataServerHandler implements Airavata.Iface {
String compResourceId = existingExperiment.getUserConfigurationData()
.getComputationalResourceScheduling().getResourceHostId();
- ComputeResourceDescription computeResourceDescription = appCatalog.getComputeResource()
- .getComputeResource(compResourceId);
+ ComputeResourceDescription computeResourceDescription = regClient.getComputeResource(compResourceId);
if(!computeResourceDescription.isEnabled()){
existingExperiment.getUserConfigurationData().setComputationalResourceScheduling(null);
}
}
logger.debug("Airavata cloned experiment with experiment id : " + existingExperimentID);
existingExperiment.setUserName(authzToken.getClaimsMap().get(org.apache.airavata.common.utils.Constants.USER_NAME));
- String expId = (String) experimentCatalog.add(ExpCatParentDataType.EXPERIMENT, existingExperiment, gatewayId);
+ String expId = regClient.createExperiment(gatewayId, existingExperiment);
String projectId = existingExperiment.getProjectId();
if(!isResourceExistsInGrouper(projectId, ResourceType.PROJECT)){
@@ -2007,14 +1439,17 @@ public class AiravataServerHandler implements Airavata.Iface {
public void terminateExperiment(AuthzToken authzToken, String airavataExperimentId, String gatewayId) throws InvalidRequestException,
ExperimentNotFoundException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- if (!(experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, airavataExperimentId))){
- logger.error("Experiment does not exist.Please provide a valid experiment id...");
- throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ RegistryService.Client regClient = getRegistryServiceClient();
+ ExperimentModel existingExperiment = regClient.getExperiment(airavataExperimentId);
+ if (existingExperiment == null){
+ logger.error(airavataExperimentId, "Error while cloning experiment {}, experiment doesn't exist.", airavataExperimentId);
+ throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
}
+
Client client = getOrchestratorClient();
client.terminateExperiment(airavataExperimentId, gatewayId);
logger.debug("Airavata cancelled experiment with experiment id : " + airavataExperimentId);
- } catch (RegistryException e) {
+ } catch (RegistryServiceException | ApplicationSettingsException e) {
logger.error(airavataExperimentId, "Error while cancelling the experiment...", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -2034,16 +1469,9 @@ public class AiravataServerHandler implements Airavata.Iface {
@SecurityCheck
public String registerApplicationModule(AuthzToken authzToken, String gatewayId, ApplicationModule applicationModule)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
- if (!isGatewayExistInternal(gatewayId)){
- logger.error("Gateway does not exist.Please provide a valid gateway id...");
- throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- }
try {
- appCatalog = RegistryFactory.getAppCatalog();
- String module = appCatalog.getApplicationInterface().addApplicationModule(applicationModule, gatewayId);
- logger.debug("Airavata registered application module for gateway id : " + gatewayId);
- return module;
- } catch (AppCatalogException e) {
+ return getRegistryServiceClient().registerApplicationModule(gatewayId,applicationModule);
+ } catch (ApplicationSettingsException | RegistryServiceException e) {
logger.error("Error while adding application module...", e);
AiravataSystemException exception = new AiravataSystemException();
exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
@@ -2064,11 +1492,8 @@ public class AiravataServerHandler implements Airavata.Iface {
public ApplicationModule getApplicationModule(AuthzToken authzToken, String appModuleId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
try {
- appCatalog = RegistryFactory.getAppCatalog();
- ApplicationModule module = appCatalog.getApplicationInterface().getApplicationModule(appModuleId);
- logger.debug("Airavata retrieved application module with module id : " + appModuleId);
- return module;
- } catch (AppCatalogException e) {
+
<TRUNCATED>
[4/7] airavata git commit: moving registry code from API server to
registry server
Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/airavata-api/airavata-api-server/src/test/java/org/apache/airavata/api/server/handler/AiravataServerHandlerTest.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/test/java/org/apache/airavata/api/server/handler/AiravataServerHandlerTest.java b/airavata-api/airavata-api-server/src/test/java/org/apache/airavata/api/server/handler/AiravataServerHandlerTest.java
deleted file mode 100644
index ef9e47e..0000000
--- a/airavata-api/airavata-api-server/src/test/java/org/apache/airavata/api/server/handler/AiravataServerHandlerTest.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- *
- * 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.api.server.handler;
-
-import junit.framework.Assert;
-import org.apache.airavata.api.server.handler.utils.AppCatInit;
-import org.apache.airavata.api.server.handler.utils.ExpCatInit;
-import org.apache.airavata.api.server.util.ExperimentCatalogInitUtil;
-import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
-import org.apache.airavata.model.application.io.DataType;
-import org.apache.airavata.model.application.io.InputDataObjectType;
-import org.apache.airavata.model.application.io.OutputDataObjectType;
-import org.apache.airavata.model.experiment.ExperimentModel;
-import org.apache.airavata.model.experiment.UserConfigurationDataModel;
-import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel;
-import org.apache.airavata.model.security.AuthzToken;
-import org.apache.airavata.model.workspace.Gateway;
-import org.apache.airavata.model.workspace.GatewayApprovalStatus;
-import org.apache.airavata.model.workspace.Notification;
-import org.apache.airavata.model.workspace.NotificationPriority;
-import org.apache.airavata.model.workspace.Project;
-import org.apache.thrift.TException;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.util.List;
-import java.util.UUID;
-
-/**
- * Test methods for Airavata Service Handler
- */
-public class AiravataServerHandlerTest {
-// private final static Logger logger = LoggerFactory.getLogger(AiravataServerHandlerTest.class);
-
- private static AiravataServerHandler airavataServerHandler;
- private static String gatewayId = "php_reference_gateway";
- private static String computeResouceId = null;
- private AuthzToken token = new AuthzToken("empty_token");
-
- @BeforeClass
- public static void setupBeforeClass() throws Exception {
- AppCatInit appCatInit = new AppCatInit("appcatalog-derby.sql");
- appCatInit.initializeDB();
- ExpCatInit expCatInit = new ExpCatInit("expcatalog-derby.sql");
- expCatInit.initializeDB();
- airavataServerHandler = new AiravataServerHandler();
-
- Gateway gateway = new Gateway();
- gateway.setGatewayId(gatewayId);
- gateway.setGatewayApprovalStatus(GatewayApprovalStatus.REQUESTED);
- airavataServerHandler.addGateway(new AuthzToken(""), gateway);
-
- ComputeResourceDescription computeResourceDescription = new ComputeResourceDescription();
- computeResourceDescription.setHostName("test.compute.resource");
- computeResourceDescription.setResourceDescription("test compute resource");
- computeResourceDescription.setEnabled(true);
- computeResouceId = airavataServerHandler.registerComputeResource(new AuthzToken(""),
- computeResourceDescription);
- }
-
- @AfterClass
- public static void tearDown() {
- ExperimentCatalogInitUtil.stopDerbyInServerMode();
- }
-
- /**
- * Testing for project related API methods
- */
- @Test
- public void testProject() {
- try {
- String TAG = System.currentTimeMillis() + "";
-
-
- //testing the creation of a project
- Project project = new Project();
- project.setOwner("TestUser" + TAG);
- project.setName("TestProject" + TAG);
- project.setDescription("This is a test project" + TAG);
- String projectId1 = airavataServerHandler.createProject(new AuthzToken(""), gatewayId, project);
- Assert.assertNotNull(projectId1);
-
- //testing the update of a project
- Project updatedProject = new Project();
- updatedProject.setProjectID(projectId1);
- updatedProject.setOwner("TestUser" + TAG);
- updatedProject.setName("UpdatedTestProject" + TAG);
- updatedProject.setDescription("This is an updated test project" + TAG);
- airavataServerHandler.updateProject(new AuthzToken(""), projectId1, updatedProject);
-
- //testing project retrieval
- Project retrievedProject = airavataServerHandler.getProject(new AuthzToken(""), projectId1);
- Assert.assertEquals(updatedProject.getProjectID(), retrievedProject.getProjectID());
- Assert.assertEquals(updatedProject.getOwner(), retrievedProject.getOwner());
- Assert.assertEquals(updatedProject.getName(), retrievedProject.getName());
- Assert.assertEquals(updatedProject.getDescription(), retrievedProject.getDescription());
- Assert.assertNotNull(retrievedProject.getCreationTime());
- //created user should be in the shared users list
- Assert.assertTrue(retrievedProject.getSharedUsers().size() == 1);
-
- //creating more projects for the same user
- project = new Project();
- project.setOwner("TestUser" + TAG);
- project.setName("Project Terrible" + TAG);
- project.setDescription("This is a test project_2" + TAG);
- String projectId2 = airavataServerHandler.createProject(new AuthzToken(""), gatewayId, project);
- Assert.assertNotNull(projectId2);
-
- project = new Project();
- project.setOwner("TestUser" + TAG);
- project.setName("Project Funny" + TAG);
- project.setDescription("This is a test project_3" + TAG);
- String projectId3 = airavataServerHandler.createProject(new AuthzToken(""), gatewayId, project);
- Assert.assertNotNull(projectId3);
-
- project = new Project();
- project.setOwner("TestUser" + TAG);
- project.setName("Project Stupid" + TAG);
- project.setDescription("This is a test project_4" + TAG);
- String projectId4 = airavataServerHandler.createProject(new AuthzToken(""), gatewayId, project);
- Assert.assertNotNull(projectId4);
-
- project = new Project();
- project.setOwner("TestUser" + TAG);
- project.setName("Project Boring" + TAG);
- project.setDescription("This is a test project_5" + TAG);
- String projectId5 = airavataServerHandler.createProject(token, gatewayId, project);
- Assert.assertNotNull(projectId5);
-
-
- //get all projects of user
- List<Project> list = airavataServerHandler.getUserProjects(token, gatewayId, "TestUser" + TAG, 2, 2);
- Assert.assertTrue(list.size() == 2);
- Project project1 = list.get(0);
- Project project2 = list.get(1);
- Assert.assertTrue(project1.getCreationTime() - project2.getCreationTime() > 0);
- } catch (Exception e) {
- e.printStackTrace();
- Assert.fail();
- }
- }
-
- /**
- * Testing for project related API methods
- */
- @Test
- public void testExperiment() {
- try {
- String TAG = System.currentTimeMillis() + "";
-
- String applicationId = "Echo_" + UUID.randomUUID().toString();
-
- //creating project
- Project project = new Project();
- project.setOwner("TestUser" + TAG);
- project.setName("TestProject" + TAG);
- project.setDescription("This is a test project" + TAG);
- String projectId1 = airavataServerHandler.createProject(new AuthzToken(""), gatewayId, project);
- Assert.assertNotNull(projectId1);
-
- //creating sample echo experiment. assumes echo application is already defined
- InputDataObjectType inputDataObjectType = new InputDataObjectType();
- inputDataObjectType.setName("Input_to_Echo");
- inputDataObjectType.setValue("Hello World");
- inputDataObjectType.setType(DataType.STRING);
-
- ComputationalResourceSchedulingModel scheduling = new ComputationalResourceSchedulingModel();
- scheduling.setResourceHostId(computeResouceId);
- scheduling.setTotalCPUCount(1);
- scheduling.setNodeCount(1);
- scheduling.setWallTimeLimit(15);
- scheduling.setQueueName("normal");
-
- UserConfigurationDataModel userConfigurationData = new UserConfigurationDataModel();
- userConfigurationData.setAiravataAutoSchedule(false);
- userConfigurationData.setOverrideManualScheduledParams(false);
- userConfigurationData.setComputationalResourceScheduling(scheduling);
-
- ExperimentModel experiment = new ExperimentModel();
- experiment.setProjectId(projectId1);
- experiment.setGatewayId(gatewayId);
- experiment.setUserName("TestUser" + TAG);
- experiment.setExperimentName("TestExperiment" + TAG);
- experiment.setDescription("experiment");
- experiment.setExecutionId(applicationId);
- experiment.setUserConfigurationData(userConfigurationData);
- experiment.addToExperimentInputs(inputDataObjectType);
-
- String experimentId1 = airavataServerHandler.createExperiment(new AuthzToken(""), gatewayId, experiment);
- Assert.assertNotNull(experimentId1);
-
- //retrieving the stored experiment
- ExperimentModel retrievedExperiment = airavataServerHandler.getExperiment(new AuthzToken(""), experimentId1);
- Assert.assertNotNull(retrievedExperiment);
- Assert.assertEquals(retrievedExperiment.getProjectId(), experiment.getProjectId());
- Assert.assertEquals(retrievedExperiment.getDescription(), experiment.getDescription());
- Assert.assertEquals(retrievedExperiment.getExperimentName(), experiment.getExperimentName());
- Assert.assertEquals(retrievedExperiment.getExecutionId(), experiment.getExecutionId());
- Assert.assertNotNull(retrievedExperiment.getUserConfigurationData());
- Assert.assertNotNull(retrievedExperiment.getExperimentInputs());
-
- //updating an existing experiment
- experiment.setExperimentName("NewExperimentName" + TAG);
- OutputDataObjectType outputDataObjectType = new OutputDataObjectType();
- outputDataObjectType.setName("Output_to_Echo");
- outputDataObjectType.setValue("Hello World");
- outputDataObjectType.setType(DataType.STRING);
- experiment.addToExperimentOutputs(outputDataObjectType);
- airavataServerHandler.updateExperiment(new AuthzToken(""), experimentId1, experiment);
-
- //creating more experiments
- experiment = new ExperimentModel();
- experiment.setProjectId(projectId1);
- experiment.setGatewayId(gatewayId);
- experiment.setUserName("TestUser" + TAG);
- experiment.setExperimentName("TestExperiment2" + TAG);
- experiment.setDescription("experiment");
- experiment.setExecutionId(applicationId);
- experiment.setUserConfigurationData(userConfigurationData);
- experiment.addToExperimentInputs(inputDataObjectType);
-
- String experimentId2 = airavataServerHandler.createExperiment(new AuthzToken(""), gatewayId, experiment);
- Assert.assertNotNull(experimentId2);
-
- experiment = new ExperimentModel();
- experiment.setProjectId(projectId1);
- experiment.setGatewayId(gatewayId);
- experiment.setUserName("TestUser" + TAG);
- experiment.setExperimentName("TestExperiment3" + TAG);
- experiment.setDescription("experiment");
- experiment.setExecutionId(applicationId);
- experiment.setUserConfigurationData(userConfigurationData);
- experiment.addToExperimentInputs(inputDataObjectType);
-
- String experimentId3 = airavataServerHandler.createExperiment(token, gatewayId, experiment);
- Assert.assertNotNull(experimentId3);
-
- //retrieving all experiments in project
- List<ExperimentModel> list = airavataServerHandler.getExperimentsInProject(token, projectId1, 2, 1);
- Assert.assertTrue(list.size() == 2);
-
- //getting all user experiments
- list = airavataServerHandler.getUserExperiments(token,
- gatewayId, "TestUser" + TAG, 2, 0);
- //testing time ordering
- Assert.assertTrue(list.size() == 2);
- ExperimentModel exp1 = list.get(0);
- ExperimentModel exp2 = list.get(1);
- Assert.assertTrue(exp1.getCreationTime() - exp2.getCreationTime() > 0);
-
- } catch (Exception e) {
- e.printStackTrace();
- Assert.fail();
- }
- }
- @Test
- public void testNotifications(){
- try {
- AuthzToken authzToken = new AuthzToken();
- authzToken.setAccessToken("");
- Notification notification = new Notification();
- notification.setTitle("3424234");
- notification.setGatewayId("test");
- notification.setNotificationMessage("sdkjfbjks kjbsdf kjsdbfkjsdbf");
- notification.setPriority(NotificationPriority.NORMAL);
- String notificationId = airavataServerHandler.createNotification(authzToken, notification);
- Assert.assertNotNull(notificationId);
- List<Notification> notifications = airavataServerHandler.getAllNotifications(authzToken, "test");
- Assert.assertTrue(notifications.size() > 0);
- Assert.assertNotNull(airavataServerHandler.getNotification(authzToken,"test",notificationId));
- } catch (TException e) {
- e.printStackTrace();
- Assert.fail();
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
----------------------------------------------------------------------
diff --git a/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java b/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
index b6afb18..b3d68a6 100644
--- a/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
+++ b/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
@@ -21,22 +21,18 @@
package org.apache.airavata.common.utils;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
+import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
public class ApplicationSettings {
public static final String SERVER_PROPERTIES="airavata-server.properties";
@@ -398,6 +394,14 @@ public class ApplicationSettings {
return getSetting("email.from");
}
+ public static String getRegistryServerPort() throws ApplicationSettingsException {
+ return getSetting("regserver.server.host");
+ }
+
+ public static String getRegistryServerHost() throws ApplicationSettingsException {
+ return getSetting("regserver.server.port");
+ }
+
/**
* @deprecated use {{@link #getSetting(String)}}
* @return
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
index 8e00946..565e9c6 100644
--- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.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-05-01")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-09")
public class CredentialStoreService {
public interface Iface {
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
index cbb5b37..77a85d4 100644
--- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.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-05-01")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-09")
public class CertificateCredential implements org.apache.thrift.TBase<CertificateCredential, CertificateCredential._Fields>, java.io.Serializable, Cloneable, Comparable<CertificateCredential> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CertificateCredential");
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
index 1fb27e7..457cad6 100644
--- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.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-05-01")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-09")
public class CommunityUser implements org.apache.thrift.TBase<CommunityUser, CommunityUser._Fields>, java.io.Serializable, Cloneable, Comparable<CommunityUser> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CommunityUser");
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
index 6978767..c488315 100644
--- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
@@ -22,18 +22,35 @@
*/
package org.apache.airavata.credential.store.datamodel;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
-import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
import javax.annotation.Generated;
-import java.util.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-01")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-09")
public class PasswordCredential implements org.apache.thrift.TBase<PasswordCredential, PasswordCredential._Fields>, java.io.Serializable, Cloneable, Comparable<PasswordCredential> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PasswordCredential");
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
index 3d18b99..3e9de8d 100644
--- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.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-05-01")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-09")
public class SSHCredential implements org.apache.thrift.TBase<SSHCredential, SSHCredential._Fields>, java.io.Serializable, Cloneable, Comparable<SSHCredential> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SSHCredential");
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
index a99b0be..48ea94c 100644
--- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.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-05-01")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-09")
public class CredentialStoreException extends TException implements org.apache.thrift.TBase<CredentialStoreException, CredentialStoreException._Fields>, java.io.Serializable, Cloneable, Comparable<CredentialStoreException> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CredentialStoreException");
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/modules/gfac/gfac-client/src/main/java/org/apache/airavata/gfac/cpi/GfacService.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-client/src/main/java/org/apache/airavata/gfac/cpi/GfacService.java b/modules/gfac/gfac-client/src/main/java/org/apache/airavata/gfac/cpi/GfacService.java
index e350ded..9483a20 100644
--- a/modules/gfac/gfac-client/src/main/java/org/apache/airavata/gfac/cpi/GfacService.java
+++ b/modules/gfac/gfac-client/src/main/java/org/apache/airavata/gfac/cpi/GfacService.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-05-01")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-09")
public class GfacService {
public interface Iface {
http://git-wip-us.apache.org/repos/asf/airavata/blob/c01d7a14/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
index 173204b..fc8362e 100644
--- a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
+++ b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.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-05-01")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-09")
public class OrchestratorService {
public interface Iface {
[2/7] airavata git commit: moving registry code from API server to
registry server
Posted by sc...@apache.org.
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/RegistryService.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
index 22e29d1..36420b7 100644
--- a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
+++ b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.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 RegistryService {
public interface Iface {
@@ -317,11 +317,12 @@ public class RegistryService {
*
* @param gatewayId
* @param userName
+ * @param accessibleProjIds
* @param filters
* @param limit
* @param offset
*/
- public List<org.apache.airavata.model.workspace.Project> searchProjects(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+ public List<org.apache.airavata.model.workspace.Project> searchProjects(String gatewayId, String userName, List<String> accessibleProjIds, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
/**
* Search Experiments.
@@ -349,11 +350,12 @@ public class RegistryService {
*
* @param gatewayId
* @param userName
+ * @param accessibleExpIds
* @param filters
* @param limit
* @param offset
*/
- public List<org.apache.airavata.model.experiment.ExperimentSummaryModel> searchExperiments(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+ public List<org.apache.airavata.model.experiment.ExperimentSummaryModel> searchExperiments(String gatewayId, String userName, List<String> accessibleExpIds, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
/**
*
@@ -2148,9 +2150,9 @@ public class RegistryService {
public void getUserProjects(String gatewayId, String userName, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void searchProjects(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void searchProjects(String gatewayId, String userName, List<String> accessibleProjIds, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void searchExperiments(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void searchExperiments(String gatewayId, String userName, List<String> accessibleExpIds, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getExperimentStatistics(String gatewayId, long fromTime, long toTime, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -2888,17 +2890,18 @@ public class RegistryService {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUserProjects failed: unknown result");
}
- public List<org.apache.airavata.model.workspace.Project> searchProjects(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ public List<org.apache.airavata.model.workspace.Project> searchProjects(String gatewayId, String userName, List<String> accessibleProjIds, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
{
- send_searchProjects(gatewayId, userName, filters, limit, offset);
+ send_searchProjects(gatewayId, userName, accessibleProjIds, filters, limit, offset);
return recv_searchProjects();
}
- public void send_searchProjects(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset) throws org.apache.thrift.TException
+ public void send_searchProjects(String gatewayId, String userName, List<String> accessibleProjIds, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset) throws org.apache.thrift.TException
{
searchProjects_args args = new searchProjects_args();
args.setGatewayId(gatewayId);
args.setUserName(userName);
+ args.setAccessibleProjIds(accessibleProjIds);
args.setFilters(filters);
args.setLimit(limit);
args.setOffset(offset);
@@ -2918,17 +2921,18 @@ public class RegistryService {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "searchProjects failed: unknown result");
}
- public List<org.apache.airavata.model.experiment.ExperimentSummaryModel> searchExperiments(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ public List<org.apache.airavata.model.experiment.ExperimentSummaryModel> searchExperiments(String gatewayId, String userName, List<String> accessibleExpIds, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
{
- send_searchExperiments(gatewayId, userName, filters, limit, offset);
+ send_searchExperiments(gatewayId, userName, accessibleExpIds, filters, limit, offset);
return recv_searchExperiments();
}
- public void send_searchExperiments(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset) throws org.apache.thrift.TException
+ public void send_searchExperiments(String gatewayId, String userName, List<String> accessibleExpIds, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset) throws org.apache.thrift.TException
{
searchExperiments_args args = new searchExperiments_args();
args.setGatewayId(gatewayId);
args.setUserName(userName);
+ args.setAccessibleExpIds(accessibleExpIds);
args.setFilters(filters);
args.setLimit(limit);
args.setOffset(offset);
@@ -6456,9 +6460,9 @@ public class RegistryService {
}
}
- public void searchProjects(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void searchProjects(String gatewayId, String userName, List<String> accessibleProjIds, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- searchProjects_call method_call = new searchProjects_call(gatewayId, userName, filters, limit, offset, resultHandler, this, ___protocolFactory, ___transport);
+ searchProjects_call method_call = new searchProjects_call(gatewayId, userName, accessibleProjIds, filters, limit, offset, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
@@ -6466,13 +6470,15 @@ public class RegistryService {
public static class searchProjects_call extends org.apache.thrift.async.TAsyncMethodCall {
private String gatewayId;
private String userName;
+ private List<String> accessibleProjIds;
private Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters;
private int limit;
private int offset;
- public searchProjects_call(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ public searchProjects_call(String gatewayId, String userName, List<String> accessibleProjIds, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.gatewayId = gatewayId;
this.userName = userName;
+ this.accessibleProjIds = accessibleProjIds;
this.filters = filters;
this.limit = limit;
this.offset = offset;
@@ -6483,6 +6489,7 @@ public class RegistryService {
searchProjects_args args = new searchProjects_args();
args.setGatewayId(gatewayId);
args.setUserName(userName);
+ args.setAccessibleProjIds(accessibleProjIds);
args.setFilters(filters);
args.setLimit(limit);
args.setOffset(offset);
@@ -6500,9 +6507,9 @@ public class RegistryService {
}
}
- public void searchExperiments(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void searchExperiments(String gatewayId, String userName, List<String> accessibleExpIds, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- searchExperiments_call method_call = new searchExperiments_call(gatewayId, userName, filters, limit, offset, resultHandler, this, ___protocolFactory, ___transport);
+ searchExperiments_call method_call = new searchExperiments_call(gatewayId, userName, accessibleExpIds, filters, limit, offset, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
@@ -6510,13 +6517,15 @@ public class RegistryService {
public static class searchExperiments_call extends org.apache.thrift.async.TAsyncMethodCall {
private String gatewayId;
private String userName;
+ private List<String> accessibleExpIds;
private Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters;
private int limit;
private int offset;
- public searchExperiments_call(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ public searchExperiments_call(String gatewayId, String userName, List<String> accessibleExpIds, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.gatewayId = gatewayId;
this.userName = userName;
+ this.accessibleExpIds = accessibleExpIds;
this.filters = filters;
this.limit = limit;
this.offset = offset;
@@ -6527,6 +6536,7 @@ public class RegistryService {
searchExperiments_args args = new searchExperiments_args();
args.setGatewayId(gatewayId);
args.setUserName(userName);
+ args.setAccessibleExpIds(accessibleExpIds);
args.setFilters(filters);
args.setLimit(limit);
args.setOffset(offset);
@@ -10828,7 +10838,7 @@ public class RegistryService {
public searchProjects_result getResult(I iface, searchProjects_args args) throws org.apache.thrift.TException {
searchProjects_result result = new searchProjects_result();
try {
- result.success = iface.searchProjects(args.gatewayId, args.userName, args.filters, args.limit, args.offset);
+ result.success = iface.searchProjects(args.gatewayId, args.userName, args.accessibleProjIds, args.filters, args.limit, args.offset);
} catch (org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
result.rse = rse;
}
@@ -10852,7 +10862,7 @@ public class RegistryService {
public searchExperiments_result getResult(I iface, searchExperiments_args args) throws org.apache.thrift.TException {
searchExperiments_result result = new searchExperiments_result();
try {
- result.success = iface.searchExperiments(args.gatewayId, args.userName, args.filters, args.limit, args.offset);
+ result.success = iface.searchExperiments(args.gatewayId, args.userName, args.accessibleExpIds, args.filters, args.limit, args.offset);
} catch (org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
result.rse = rse;
}
@@ -14776,7 +14786,7 @@ public class RegistryService {
}
public void start(I iface, searchProjects_args args, org.apache.thrift.async.AsyncMethodCallback<List<org.apache.airavata.model.workspace.Project>> resultHandler) throws TException {
- iface.searchProjects(args.gatewayId, args.userName, args.filters, args.limit, args.offset,resultHandler);
+ iface.searchProjects(args.gatewayId, args.userName, args.accessibleProjIds, args.filters, args.limit, args.offset,resultHandler);
}
}
@@ -14833,7 +14843,7 @@ public class RegistryService {
}
public void start(I iface, searchExperiments_args args, org.apache.thrift.async.AsyncMethodCallback<List<org.apache.airavata.model.experiment.ExperimentSummaryModel>> resultHandler) throws TException {
- iface.searchExperiments(args.gatewayId, args.userName, args.filters, args.limit, args.offset,resultHandler);
+ iface.searchExperiments(args.gatewayId, args.userName, args.accessibleExpIds, args.filters, args.limit, args.offset,resultHandler);
}
}
@@ -37492,9 +37502,10 @@ public class RegistryService {
private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField FILTERS_FIELD_DESC = new org.apache.thrift.protocol.TField("filters", org.apache.thrift.protocol.TType.MAP, (short)3);
- private static final org.apache.thrift.protocol.TField LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("limit", org.apache.thrift.protocol.TType.I32, (short)4);
- private static final org.apache.thrift.protocol.TField OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset", org.apache.thrift.protocol.TType.I32, (short)5);
+ private static final org.apache.thrift.protocol.TField ACCESSIBLE_PROJ_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("accessibleProjIds", org.apache.thrift.protocol.TType.LIST, (short)3);
+ private static final org.apache.thrift.protocol.TField FILTERS_FIELD_DESC = new org.apache.thrift.protocol.TField("filters", org.apache.thrift.protocol.TType.MAP, (short)4);
+ private static final org.apache.thrift.protocol.TField LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("limit", org.apache.thrift.protocol.TType.I32, (short)5);
+ private static final org.apache.thrift.protocol.TField OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset", org.apache.thrift.protocol.TType.I32, (short)6);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -37504,6 +37515,7 @@ public class RegistryService {
public String gatewayId; // required
public String userName; // required
+ public List<String> accessibleProjIds; // required
public Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters; // required
public int limit; // required
public int offset; // required
@@ -37512,9 +37524,10 @@ public class RegistryService {
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
GATEWAY_ID((short)1, "gatewayId"),
USER_NAME((short)2, "userName"),
- FILTERS((short)3, "filters"),
- LIMIT((short)4, "limit"),
- OFFSET((short)5, "offset");
+ ACCESSIBLE_PROJ_IDS((short)3, "accessibleProjIds"),
+ FILTERS((short)4, "filters"),
+ LIMIT((short)5, "limit"),
+ OFFSET((short)6, "offset");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -37533,11 +37546,13 @@ public class RegistryService {
return GATEWAY_ID;
case 2: // USER_NAME
return USER_NAME;
- case 3: // FILTERS
+ case 3: // ACCESSIBLE_PROJ_IDS
+ return ACCESSIBLE_PROJ_IDS;
+ case 4: // FILTERS
return FILTERS;
- case 4: // LIMIT
+ case 5: // LIMIT
return LIMIT;
- case 5: // OFFSET
+ case 6: // OFFSET
return OFFSET;
default:
return null;
@@ -37589,6 +37604,9 @@ public class RegistryService {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.ACCESSIBLE_PROJ_IDS, new org.apache.thrift.meta_data.FieldMetaData("accessibleProjIds", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
tmpMap.put(_Fields.FILTERS, new org.apache.thrift.meta_data.FieldMetaData("filters", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.airavata.model.experiment.ProjectSearchFields.class),
@@ -37607,6 +37625,7 @@ public class RegistryService {
public searchProjects_args(
String gatewayId,
String userName,
+ List<String> accessibleProjIds,
Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters,
int limit,
int offset)
@@ -37614,6 +37633,7 @@ public class RegistryService {
this();
this.gatewayId = gatewayId;
this.userName = userName;
+ this.accessibleProjIds = accessibleProjIds;
this.filters = filters;
this.limit = limit;
setLimitIsSet(true);
@@ -37632,6 +37652,10 @@ public class RegistryService {
if (other.isSetUserName()) {
this.userName = other.userName;
}
+ if (other.isSetAccessibleProjIds()) {
+ List<String> __this__accessibleProjIds = new ArrayList<String>(other.accessibleProjIds);
+ this.accessibleProjIds = __this__accessibleProjIds;
+ }
if (other.isSetFilters()) {
Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> __this__filters = new HashMap<org.apache.airavata.model.experiment.ProjectSearchFields,String>(other.filters.size());
for (Map.Entry<org.apache.airavata.model.experiment.ProjectSearchFields, String> other_element : other.filters.entrySet()) {
@@ -37659,6 +37683,7 @@ public class RegistryService {
public void clear() {
this.gatewayId = null;
this.userName = null;
+ this.accessibleProjIds = null;
this.filters = null;
setLimitIsSet(false);
this.limit = 0;
@@ -37714,6 +37739,45 @@ public class RegistryService {
}
}
+ public int getAccessibleProjIdsSize() {
+ return (this.accessibleProjIds == null) ? 0 : this.accessibleProjIds.size();
+ }
+
+ public java.util.Iterator<String> getAccessibleProjIdsIterator() {
+ return (this.accessibleProjIds == null) ? null : this.accessibleProjIds.iterator();
+ }
+
+ public void addToAccessibleProjIds(String elem) {
+ if (this.accessibleProjIds == null) {
+ this.accessibleProjIds = new ArrayList<String>();
+ }
+ this.accessibleProjIds.add(elem);
+ }
+
+ public List<String> getAccessibleProjIds() {
+ return this.accessibleProjIds;
+ }
+
+ public searchProjects_args setAccessibleProjIds(List<String> accessibleProjIds) {
+ this.accessibleProjIds = accessibleProjIds;
+ return this;
+ }
+
+ public void unsetAccessibleProjIds() {
+ this.accessibleProjIds = null;
+ }
+
+ /** Returns true if field accessibleProjIds is set (has been assigned a value) and false otherwise */
+ public boolean isSetAccessibleProjIds() {
+ return this.accessibleProjIds != null;
+ }
+
+ public void setAccessibleProjIdsIsSet(boolean value) {
+ if (!value) {
+ this.accessibleProjIds = null;
+ }
+ }
+
public int getFiltersSize() {
return (this.filters == null) ? 0 : this.filters.size();
}
@@ -37813,6 +37877,14 @@ public class RegistryService {
}
break;
+ case ACCESSIBLE_PROJ_IDS:
+ if (value == null) {
+ unsetAccessibleProjIds();
+ } else {
+ setAccessibleProjIds((List<String>)value);
+ }
+ break;
+
case FILTERS:
if (value == null) {
unsetFilters();
@@ -37848,6 +37920,9 @@ public class RegistryService {
case USER_NAME:
return getUserName();
+ case ACCESSIBLE_PROJ_IDS:
+ return getAccessibleProjIds();
+
case FILTERS:
return getFilters();
@@ -37872,6 +37947,8 @@ public class RegistryService {
return isSetGatewayId();
case USER_NAME:
return isSetUserName();
+ case ACCESSIBLE_PROJ_IDS:
+ return isSetAccessibleProjIds();
case FILTERS:
return isSetFilters();
case LIMIT:
@@ -37913,6 +37990,15 @@ public class RegistryService {
return false;
}
+ boolean this_present_accessibleProjIds = true && this.isSetAccessibleProjIds();
+ boolean that_present_accessibleProjIds = true && that.isSetAccessibleProjIds();
+ if (this_present_accessibleProjIds || that_present_accessibleProjIds) {
+ if (!(this_present_accessibleProjIds && that_present_accessibleProjIds))
+ return false;
+ if (!this.accessibleProjIds.equals(that.accessibleProjIds))
+ return false;
+ }
+
boolean this_present_filters = true && this.isSetFilters();
boolean that_present_filters = true && that.isSetFilters();
if (this_present_filters || that_present_filters) {
@@ -37957,6 +38043,11 @@ public class RegistryService {
if (present_userName)
list.add(userName);
+ boolean present_accessibleProjIds = true && (isSetAccessibleProjIds());
+ list.add(present_accessibleProjIds);
+ if (present_accessibleProjIds)
+ list.add(accessibleProjIds);
+
boolean present_filters = true && (isSetFilters());
list.add(present_filters);
if (present_filters)
@@ -38003,6 +38094,16 @@ public class RegistryService {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetAccessibleProjIds()).compareTo(other.isSetAccessibleProjIds());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAccessibleProjIds()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.accessibleProjIds, other.accessibleProjIds);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
lastComparison = Boolean.valueOf(isSetFilters()).compareTo(other.isSetFilters());
if (lastComparison != 0) {
return lastComparison;
@@ -38069,6 +38170,14 @@ public class RegistryService {
}
first = false;
if (!first) sb.append(", ");
+ sb.append("accessibleProjIds:");
+ if (this.accessibleProjIds == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.accessibleProjIds);
+ }
+ first = false;
+ if (!first) sb.append(", ");
sb.append("filters:");
if (this.filters == null) {
sb.append("null");
@@ -38096,6 +38205,9 @@ public class RegistryService {
if (userName == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' was not present! Struct: " + toString());
}
+ if (accessibleProjIds == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'accessibleProjIds' was not present! Struct: " + toString());
+ }
// alas, we cannot check 'limit' because it's a primitive and you chose the non-beans generator.
// alas, we cannot check 'offset' because it's a primitive and you chose the non-beans generator.
// check for sub-struct validity
@@ -38153,18 +38265,36 @@ public class RegistryService {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 3: // FILTERS
+ case 3: // ACCESSIBLE_PROJ_IDS
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
+ struct.accessibleProjIds = new ArrayList<String>(_list32.size);
+ String _elem33;
+ for (int _i34 = 0; _i34 < _list32.size; ++_i34)
+ {
+ _elem33 = iprot.readString();
+ struct.accessibleProjIds.add(_elem33);
+ }
+ iprot.readListEnd();
+ }
+ struct.setAccessibleProjIdsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // FILTERS
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
- org.apache.thrift.protocol.TMap _map32 = iprot.readMapBegin();
- struct.filters = new HashMap<org.apache.airavata.model.experiment.ProjectSearchFields,String>(2*_map32.size);
- org.apache.airavata.model.experiment.ProjectSearchFields _key33;
- String _val34;
- for (int _i35 = 0; _i35 < _map32.size; ++_i35)
+ org.apache.thrift.protocol.TMap _map35 = iprot.readMapBegin();
+ struct.filters = new HashMap<org.apache.airavata.model.experiment.ProjectSearchFields,String>(2*_map35.size);
+ org.apache.airavata.model.experiment.ProjectSearchFields _key36;
+ String _val37;
+ for (int _i38 = 0; _i38 < _map35.size; ++_i38)
{
- _key33 = org.apache.airavata.model.experiment.ProjectSearchFields.findByValue(iprot.readI32());
- _val34 = iprot.readString();
- struct.filters.put(_key33, _val34);
+ _key36 = org.apache.airavata.model.experiment.ProjectSearchFields.findByValue(iprot.readI32());
+ _val37 = iprot.readString();
+ struct.filters.put(_key36, _val37);
}
iprot.readMapEnd();
}
@@ -38173,7 +38303,7 @@ public class RegistryService {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 4: // LIMIT
+ case 5: // LIMIT
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.limit = iprot.readI32();
struct.setLimitIsSet(true);
@@ -38181,7 +38311,7 @@ public class RegistryService {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 5: // OFFSET
+ case 6: // OFFSET
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.offset = iprot.readI32();
struct.setOffsetIsSet(true);
@@ -38220,14 +38350,26 @@ public class RegistryService {
oprot.writeString(struct.userName);
oprot.writeFieldEnd();
}
+ if (struct.accessibleProjIds != null) {
+ oprot.writeFieldBegin(ACCESSIBLE_PROJ_IDS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.accessibleProjIds.size()));
+ for (String _iter39 : struct.accessibleProjIds)
+ {
+ oprot.writeString(_iter39);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
if (struct.filters != null) {
oprot.writeFieldBegin(FILTERS_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, struct.filters.size()));
- for (Map.Entry<org.apache.airavata.model.experiment.ProjectSearchFields, String> _iter36 : struct.filters.entrySet())
+ for (Map.Entry<org.apache.airavata.model.experiment.ProjectSearchFields, String> _iter40 : struct.filters.entrySet())
{
- oprot.writeI32(_iter36.getKey().getValue());
- oprot.writeString(_iter36.getValue());
+ oprot.writeI32(_iter40.getKey().getValue());
+ oprot.writeString(_iter40.getValue());
}
oprot.writeMapEnd();
}
@@ -38258,6 +38400,13 @@ public class RegistryService {
TTupleProtocol oprot = (TTupleProtocol) prot;
oprot.writeString(struct.gatewayId);
oprot.writeString(struct.userName);
+ {
+ oprot.writeI32(struct.accessibleProjIds.size());
+ for (String _iter41 : struct.accessibleProjIds)
+ {
+ oprot.writeString(_iter41);
+ }
+ }
oprot.writeI32(struct.limit);
oprot.writeI32(struct.offset);
BitSet optionals = new BitSet();
@@ -38268,10 +38417,10 @@ public class RegistryService {
if (struct.isSetFilters()) {
{
oprot.writeI32(struct.filters.size());
- for (Map.Entry<org.apache.airavata.model.experiment.ProjectSearchFields, String> _iter37 : struct.filters.entrySet())
+ for (Map.Entry<org.apache.airavata.model.experiment.ProjectSearchFields, String> _iter42 : struct.filters.entrySet())
{
- oprot.writeI32(_iter37.getKey().getValue());
- oprot.writeString(_iter37.getValue());
+ oprot.writeI32(_iter42.getKey().getValue());
+ oprot.writeString(_iter42.getValue());
}
}
}
@@ -38284,6 +38433,17 @@ public class RegistryService {
struct.setGatewayIdIsSet(true);
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
+ {
+ org.apache.thrift.protocol.TList _list43 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.accessibleProjIds = new ArrayList<String>(_list43.size);
+ String _elem44;
+ for (int _i45 = 0; _i45 < _list43.size; ++_i45)
+ {
+ _elem44 = iprot.readString();
+ struct.accessibleProjIds.add(_elem44);
+ }
+ }
+ struct.setAccessibleProjIdsIsSet(true);
struct.limit = iprot.readI32();
struct.setLimitIsSet(true);
struct.offset = iprot.readI32();
@@ -38291,15 +38451,15 @@ public class RegistryService {
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TMap _map38 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.filters = new HashMap<org.apache.airavata.model.experiment.ProjectSearchFields,String>(2*_map38.size);
- org.apache.airavata.model.experiment.ProjectSearchFields _key39;
- String _val40;
- for (int _i41 = 0; _i41 < _map38.size; ++_i41)
+ org.apache.thrift.protocol.TMap _map46 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.filters = new HashMap<org.apache.airavata.model.experiment.ProjectSearchFields,String>(2*_map46.size);
+ org.apache.airavata.model.experiment.ProjectSearchFields _key47;
+ String _val48;
+ for (int _i49 = 0; _i49 < _map46.size; ++_i49)
{
- _key39 = org.apache.airavata.model.experiment.ProjectSearchFields.findByValue(iprot.readI32());
- _val40 = iprot.readString();
- struct.filters.put(_key39, _val40);
+ _key47 = org.apache.airavata.model.experiment.ProjectSearchFields.findByValue(iprot.readI32());
+ _val48 = iprot.readString();
+ struct.filters.put(_key47, _val48);
}
}
struct.setFiltersIsSet(true);
@@ -38707,14 +38867,14 @@ public class RegistryService {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list42 = iprot.readListBegin();
- struct.success = new ArrayList<org.apache.airavata.model.workspace.Project>(_list42.size);
- org.apache.airavata.model.workspace.Project _elem43;
- for (int _i44 = 0; _i44 < _list42.size; ++_i44)
+ org.apache.thrift.protocol.TList _list50 = iprot.readListBegin();
+ struct.success = new ArrayList<org.apache.airavata.model.workspace.Project>(_list50.size);
+ org.apache.airavata.model.workspace.Project _elem51;
+ for (int _i52 = 0; _i52 < _list50.size; ++_i52)
{
- _elem43 = new org.apache.airavata.model.workspace.Project();
- _elem43.read(iprot);
- struct.success.add(_elem43);
+ _elem51 = new org.apache.airavata.model.workspace.Project();
+ _elem51.read(iprot);
+ struct.success.add(_elem51);
}
iprot.readListEnd();
}
@@ -38751,9 +38911,9 @@ public class RegistryService {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
- for (org.apache.airavata.model.workspace.Project _iter45 : struct.success)
+ for (org.apache.airavata.model.workspace.Project _iter53 : struct.success)
{
- _iter45.write(oprot);
+ _iter53.write(oprot);
}
oprot.writeListEnd();
}
@@ -38792,9 +38952,9 @@ public class RegistryService {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (org.apache.airavata.model.workspace.Project _iter46 : struct.success)
+ for (org.apache.airavata.model.workspace.Project _iter54 : struct.success)
{
- _iter46.write(oprot);
+ _iter54.write(oprot);
}
}
}
@@ -38809,14 +38969,14 @@ public class RegistryService {
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list47 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new ArrayList<org.apache.airavata.model.workspace.Project>(_list47.size);
- org.apache.airavata.model.workspace.Project _elem48;
- for (int _i49 = 0; _i49 < _list47.size; ++_i49)
+ org.apache.thrift.protocol.TList _list55 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<org.apache.airavata.model.workspace.Project>(_list55.size);
+ org.apache.airavata.model.workspace.Project _elem56;
+ for (int _i57 = 0; _i57 < _list55.size; ++_i57)
{
- _elem48 = new org.apache.airavata.model.workspace.Project();
- _elem48.read(iprot);
- struct.success.add(_elem48);
+ _elem56 = new org.apache.airavata.model.workspace.Project();
+ _elem56.read(iprot);
+ struct.success.add(_elem56);
}
}
struct.setSuccessIsSet(true);
@@ -38836,9 +38996,10 @@ public class RegistryService {
private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField FILTERS_FIELD_DESC = new org.apache.thrift.protocol.TField("filters", org.apache.thrift.protocol.TType.MAP, (short)3);
- private static final org.apache.thrift.protocol.TField LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("limit", org.apache.thrift.protocol.TType.I32, (short)4);
- private static final org.apache.thrift.protocol.TField OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset", org.apache.thrift.protocol.TType.I32, (short)5);
+ private static final org.apache.thrift.protocol.TField ACCESSIBLE_EXP_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("accessibleExpIds", org.apache.thrift.protocol.TType.LIST, (short)3);
+ private static final org.apache.thrift.protocol.TField FILTERS_FIELD_DESC = new org.apache.thrift.protocol.TField("filters", org.apache.thrift.protocol.TType.MAP, (short)4);
+ private static final org.apache.thrift.protocol.TField LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("limit", org.apache.thrift.protocol.TType.I32, (short)5);
+ private static final org.apache.thrift.protocol.TField OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset", org.apache.thrift.protocol.TType.I32, (short)6);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -38848,6 +39009,7 @@ public class RegistryService {
public String gatewayId; // required
public String userName; // required
+ public List<String> accessibleExpIds; // required
public Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters; // required
public int limit; // required
public int offset; // required
@@ -38856,9 +39018,10 @@ public class RegistryService {
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
GATEWAY_ID((short)1, "gatewayId"),
USER_NAME((short)2, "userName"),
- FILTERS((short)3, "filters"),
- LIMIT((short)4, "limit"),
- OFFSET((short)5, "offset");
+ ACCESSIBLE_EXP_IDS((short)3, "accessibleExpIds"),
+ FILTERS((short)4, "filters"),
+ LIMIT((short)5, "limit"),
+ OFFSET((short)6, "offset");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -38877,11 +39040,13 @@ public class RegistryService {
return GATEWAY_ID;
case 2: // USER_NAME
return USER_NAME;
- case 3: // FILTERS
+ case 3: // ACCESSIBLE_EXP_IDS
+ return ACCESSIBLE_EXP_IDS;
+ case 4: // FILTERS
return FILTERS;
- case 4: // LIMIT
+ case 5: // LIMIT
return LIMIT;
- case 5: // OFFSET
+ case 6: // OFFSET
return OFFSET;
default:
return null;
@@ -38933,6 +39098,9 @@ public class RegistryService {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.ACCESSIBLE_EXP_IDS, new org.apache.thrift.meta_data.FieldMetaData("accessibleExpIds", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
tmpMap.put(_Fields.FILTERS, new org.apache.thrift.meta_data.FieldMetaData("filters", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.airavata.model.experiment.ExperimentSearchFields.class),
@@ -38951,6 +39119,7 @@ public class RegistryService {
public searchExperiments_args(
String gatewayId,
String userName,
+ List<String> accessibleExpIds,
Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters,
int limit,
int offset)
@@ -38958,6 +39127,7 @@ public class RegistryService {
this();
this.gatewayId = gatewayId;
this.userName = userName;
+ this.accessibleExpIds = accessibleExpIds;
this.filters = filters;
this.limit = limit;
setLimitIsSet(true);
@@ -38976,6 +39146,10 @@ public class RegistryService {
if (other.isSetUserName()) {
this.userName = other.userName;
}
+ if (other.isSetAccessibleExpIds()) {
+ List<String> __this__accessibleExpIds = new ArrayList<String>(other.accessibleExpIds);
+ this.accessibleExpIds = __this__accessibleExpIds;
+ }
if (other.isSetFilters()) {
Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> __this__filters = new HashMap<org.apache.airavata.model.experiment.ExperimentSearchFields,String>(other.filters.size());
for (Map.Entry<org.apache.airavata.model.experiment.ExperimentSearchFields, String> other_element : other.filters.entrySet()) {
@@ -39003,6 +39177,7 @@ public class RegistryService {
public void clear() {
this.gatewayId = null;
this.userName = null;
+ this.accessibleExpIds = null;
this.filters = null;
setLimitIsSet(false);
this.limit = 0;
@@ -39058,6 +39233,45 @@ public class RegistryService {
}
}
+ public int getAccessibleExpIdsSize() {
+ return (this.accessibleExpIds == null) ? 0 : this.accessibleExpIds.size();
+ }
+
+ public java.util.Iterator<String> getAccessibleExpIdsIterator() {
+ return (this.accessibleExpIds == null) ? null : this.accessibleExpIds.iterator();
+ }
+
+ public void addToAccessibleExpIds(String elem) {
+ if (this.accessibleExpIds == null) {
+ this.accessibleExpIds = new ArrayList<String>();
+ }
+ this.accessibleExpIds.add(elem);
+ }
+
+ public List<String> getAccessibleExpIds() {
+ return this.accessibleExpIds;
+ }
+
+ public searchExperiments_args setAccessibleExpIds(List<String> accessibleExpIds) {
+ this.accessibleExpIds = accessibleExpIds;
+ return this;
+ }
+
+ public void unsetAccessibleExpIds() {
+ this.accessibleExpIds = null;
+ }
+
+ /** Returns true if field accessibleExpIds is set (has been assigned a value) and false otherwise */
+ public boolean isSetAccessibleExpIds() {
+ return this.accessibleExpIds != null;
+ }
+
+ public void setAccessibleExpIdsIsSet(boolean value) {
+ if (!value) {
+ this.accessibleExpIds = null;
+ }
+ }
+
public int getFiltersSize() {
return (this.filters == null) ? 0 : this.filters.size();
}
@@ -39157,6 +39371,14 @@ public class RegistryService {
}
break;
+ case ACCESSIBLE_EXP_IDS:
+ if (value == null) {
+ unsetAccessibleExpIds();
+ } else {
+ setAccessibleExpIds((List<String>)value);
+ }
+ break;
+
case FILTERS:
if (value == null) {
unsetFilters();
@@ -39192,6 +39414,9 @@ public class RegistryService {
case USER_NAME:
return getUserName();
+ case ACCESSIBLE_EXP_IDS:
+ return getAccessibleExpIds();
+
case FILTERS:
return getFilters();
@@ -39216,6 +39441,8 @@ public class RegistryService {
return isSetGatewayId();
case USER_NAME:
return isSetUserName();
+ case ACCESSIBLE_EXP_IDS:
+ return isSetAccessibleExpIds();
case FILTERS:
return isSetFilters();
case LIMIT:
@@ -39257,6 +39484,15 @@ public class RegistryService {
return false;
}
+ boolean this_present_accessibleExpIds = true && this.isSetAccessibleExpIds();
+ boolean that_present_accessibleExpIds = true && that.isSetAccessibleExpIds();
+ if (this_present_accessibleExpIds || that_present_accessibleExpIds) {
+ if (!(this_present_accessibleExpIds && that_present_accessibleExpIds))
+ return false;
+ if (!this.accessibleExpIds.equals(that.accessibleExpIds))
+ return false;
+ }
+
boolean this_present_filters = true && this.isSetFilters();
boolean that_present_filters = true && that.isSetFilters();
if (this_present_filters || that_present_filters) {
@@ -39301,6 +39537,11 @@ public class RegistryService {
if (present_userName)
list.add(userName);
+ boolean present_accessibleExpIds = true && (isSetAccessibleExpIds());
+ list.add(present_accessibleExpIds);
+ if (present_accessibleExpIds)
+ list.add(accessibleExpIds);
+
boolean present_filters = true && (isSetFilters());
list.add(present_filters);
if (present_filters)
@@ -39347,6 +39588,16 @@ public class RegistryService {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetAccessibleExpIds()).compareTo(other.isSetAccessibleExpIds());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAccessibleExpIds()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.accessibleExpIds, other.accessibleExpIds);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
lastComparison = Boolean.valueOf(isSetFilters()).compareTo(other.isSetFilters());
if (lastComparison != 0) {
return lastComparison;
@@ -39413,6 +39664,14 @@ public class RegistryService {
}
first = false;
if (!first) sb.append(", ");
+ sb.append("accessibleExpIds:");
+ if (this.accessibleExpIds == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.accessibleExpIds);
+ }
+ first = false;
+ if (!first) sb.append(", ");
sb.append("filters:");
if (this.filters == null) {
sb.append("null");
@@ -39440,6 +39699,9 @@ public class RegistryService {
if (userName == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' was not present! Struct: " + toString());
}
+ if (accessibleExpIds == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'accessibleExpIds' was not present! Struct: " + toString());
+ }
// alas, we cannot check 'limit' because it's a primitive and you chose the non-beans generator.
// alas, we cannot check 'offset' because it's a primitive and you chose the non-beans generator.
// check for sub-struct validity
@@ -39497,18 +39759,36 @@ public class RegistryService {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 3: // FILTERS
+ case 3: // ACCESSIBLE_EXP_IDS
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list58 = iprot.readListBegin();
+ struct.accessibleExpIds = new ArrayList<String>(_list58.size);
+ String _elem59;
+ for (int _i60 = 0; _i60 < _list58.size; ++_i60)
+ {
+ _elem59 = iprot.readString();
+ struct.accessibleExpIds.add(_elem59);
+ }
+ iprot.readListEnd();
+ }
+ struct.setAccessibleExpIdsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // FILTERS
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
- org.apache.thrift.protocol.TMap _map50 = iprot.readMapBegin();
- struct.filters = new HashMap<org.apache.airavata.model.experiment.ExperimentSearchFields,String>(2*_map50.size);
- org.apache.airavata.model.experiment.ExperimentSearchFields _key51;
- String _val52;
- for (int _i53 = 0; _i53 < _map50.size; ++_i53)
+ org.apache.thrift.protocol.TMap _map61 = iprot.readMapBegin();
+ struct.filters = new HashMap<org.apache.airavata.model.experiment.ExperimentSearchFields,String>(2*_map61.size);
+ org.apache.airavata.model.experiment.ExperimentSearchFields _key62;
+ String _val63;
+ for (int _i64 = 0; _i64 < _map61.size; ++_i64)
{
- _key51 = org.apache.airavata.model.experiment.ExperimentSearchFields.findByValue(iprot.readI32());
- _val52 = iprot.readString();
- struct.filters.put(_key51, _val52);
+ _key62 = org.apache.airavata.model.experiment.ExperimentSearchFields.findByValue(iprot.readI32());
+ _val63 = iprot.readString();
+ struct.filters.put(_key62, _val63);
}
iprot.readMapEnd();
}
@@ -39517,7 +39797,7 @@ public class RegistryService {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 4: // LIMIT
+ case 5: // LIMIT
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.limit = iprot.readI32();
struct.setLimitIsSet(true);
@@ -39525,7 +39805,7 @@ public class RegistryService {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 5: // OFFSET
+ case 6: // OFFSET
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.offset = iprot.readI32();
struct.setOffsetIsSet(true);
@@ -39564,14 +39844,26 @@ public class RegistryService {
oprot.writeString(struct.userName);
oprot.writeFieldEnd();
}
+ if (struct.accessibleExpIds != null) {
+ oprot.writeFieldBegin(ACCESSIBLE_EXP_IDS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.accessibleExpIds.size()));
+ for (String _iter65 : struct.accessibleExpIds)
+ {
+ oprot.writeString(_iter65);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
if (struct.filters != null) {
oprot.writeFieldBegin(FILTERS_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, struct.filters.size()));
- for (Map.Entry<org.apache.airavata.model.experiment.ExperimentSearchFields, String> _iter54 : struct.filters.entrySet())
+ for (Map.Entry<org.apache.airavata.model.experiment.ExperimentSearchFields, String> _iter66 : struct.filters.entrySet())
{
- oprot.writeI32(_iter54.getKey().getValue());
- oprot.writeString(_iter54.getValue());
+ oprot.writeI32(_iter66.getKey().getValue());
+ oprot.writeString(_iter66.getValue());
}
oprot.writeMapEnd();
}
@@ -39602,6 +39894,13 @@ public class RegistryService {
TTupleProtocol oprot = (TTupleProtocol) prot;
oprot.writeString(struct.gatewayId);
oprot.writeString(struct.userName);
+ {
+ oprot.writeI32(struct.accessibleExpIds.size());
+ for (String _iter67 : struct.accessibleExpIds)
+ {
+ oprot.writeString(_iter67);
+ }
+ }
oprot.writeI32(struct.limit);
oprot.writeI32(struct.offset);
BitSet optionals = new BitSet();
@@ -39612,10 +39911,10 @@ public class RegistryService {
if (struct.isSetFilters()) {
{
oprot.writeI32(struct.filters.size());
- for (Map.Entry<org.apache.airavata.model.experiment.ExperimentSearchFields, String> _iter55 : struct.filters.entrySet())
+ for (Map.Entry<org.apache.airavata.model.experiment.ExperimentSearchFields, String> _iter68 : struct.filters.entrySet())
{
- oprot.writeI32(_iter55.getKey().getValue());
- oprot.writeString(_iter55.getValue());
+ oprot.writeI32(_iter68.getKey().getValue());
+ oprot.writeString(_iter68.getValue());
}
}
}
@@ -39628,6 +39927,17 @@ public class RegistryService {
struct.setGatewayIdIsSet(true);
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
+ {
+ org.apache.thrift.protocol.TList _list69 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.accessibleExpIds = new ArrayList<String>(_list69.size);
+ String _elem70;
+ for (int _i71 = 0; _i71 < _list69.size; ++_i71)
+ {
+ _elem70 = iprot.readString();
+ struct.accessibleExpIds.add(_elem70);
+ }
+ }
+ struct.setAccessibleExpIdsIsSet(true);
struct.limit = iprot.readI32();
struct.setLimitIsSet(true);
struct.offset = iprot.readI32();
@@ -39635,15 +39945,15 @@ public class RegistryService {
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TMap _map56 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.filters = new HashMap<org.apache.airavata.model.experiment.ExperimentSearchFields,String>(2*_map56.size);
- org.apache.airavata.model.experiment.ExperimentSearchFields _key57;
- String _val58;
- for (int _i59 = 0; _i59 < _map56.size; ++_i59)
+ org.apache.thrift.protocol.TMap _map72 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.filters = new HashMap<org.apache.airavata.model.experiment.ExperimentSearchFields,String>(2*_map72.size);
+ org.apache.airavata.model.experiment.ExperimentSearchFields _key73;
+ String _val74;
+ for (int _i75 = 0; _i75 < _map72.size; ++_i75)
{
- _key57 = org.apache.airavata.model.experiment.ExperimentSearchFields.findByValue(iprot.readI32());
- _val58 = iprot.readString();
- struct.filters.put(_key57, _val58);
+ _key73 = org.apache.airavata.model.experiment.ExperimentSearchFields.findByValue(iprot.readI32());
+ _val74 = iprot.readString();
+ struct.filters.put(_key73, _val74);
}
}
struct.setFiltersIsSet(true);
@@ -40051,14 +40361,14 @@ public class RegistryService {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list60 = iprot.readListBegin();
- struct.success = new ArrayList<org.apache.airavata.model.experiment.ExperimentSummaryModel>(_list60.size);
- org.apache.airavata.model.experiment.ExperimentSummaryModel _elem61;
- for (int _i62 = 0; _i62 < _list60.size; ++_i62)
+ org.apache.thrift.protocol.TList _list76 = iprot.readListBegin();
+ struct.success = new ArrayList<org.apache.airavata.model.experiment.ExperimentSummaryModel>(_list76.size);
+ org.apache.airavata.model.experiment.ExperimentSummaryModel _elem77;
+ for (int _i78 = 0; _i78 < _list76.size; ++_i78)
{
- _elem61 = new org.apache.airavata.model.experiment.ExperimentSummaryModel();
- _elem61.read(iprot);
- struct.success.add(_elem61);
+ _elem77 = new org.apache.airavata.model.experiment.ExperimentSummaryModel();
+ _elem77.read(iprot);
+ struct.success.add(_elem77);
}
iprot.readListEnd();
}
@@ -40095,9 +40405,9 @@ public class RegistryService {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
- for (org.apache.airavata.model.experiment.ExperimentSummaryModel _iter63 : struct.success)
+ for (org.apache.airavata.model.experiment.ExperimentSummaryModel _iter79 : struct.success)
{
- _iter63.write(oprot);
+ _iter79.write(oprot);
}
oprot.writeListEnd();
}
@@ -40136,9 +40446,9 @@ public class RegistryService {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (org.apache.airavata.model.experiment.ExperimentSummaryModel _iter64 : struct.success)
+ for (org.apache.airavata.model.experiment.ExperimentSummaryModel _iter80 : struct.success)
{
- _iter64.write(oprot);
+ _iter80.write(oprot);
}
}
}
@@ -40153,14 +40463,14 @@ public class RegistryService {
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list65 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new ArrayList<org.apache.airavata.model.experiment.ExperimentSummaryModel>(_list65.size);
- org.apache.airavata.model.experiment.ExperimentSummaryModel _elem66;
- for (int _i67 = 0; _i67 < _list65.size; ++_i67)
+ org.apache.thrift.protocol.TList _list81 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<org.apache.airavata.model.experiment.ExperimentSummaryModel>(_list81.size);
+ org.apache.airavata.model.experiment.ExperimentSummaryModel _elem82;
+ for (int _i83 = 0; _i83 < _list81.size; ++_i83)
{
- _elem66 = new org.apache.airavata.model.experiment.ExperimentSummaryModel();
- _elem66.read(iprot);
- struct.success.add(_elem66);
+ _elem82 = new org.apache.airavata.model.experiment.ExperimentSummaryModel();
+ _elem82.read(iprot);
+ struct.success.add(_elem82);
}
}
struct.setSuccessIsSet(true);
@@ -42146,14 +42456,14 @@ public class RegistryService {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list68 = iprot.readListBegin();
- struct.success = new ArrayList<org.apache.airavata.model.experiment.ExperimentModel>(_list68.size);
- org.apache.airavata.model.experiment.ExperimentModel _elem69;
- for (int _i70 = 0; _i70 < _list68.size; ++_i70)
+ org.apache.thrift.protocol.TList _list84 = iprot.readListBegin();
+ struct.success = new ArrayList<org.apache.airavata.model.experiment.ExperimentModel>(_list84.size);
+ org.apache.airavata.model.experiment.ExperimentModel _elem85;
+ for (int _i86 = 0; _i86 < _list84.size; ++_i86)
{
- _elem69 = new org.apache.airavata.model.experiment.ExperimentModel();
- _elem69.read(iprot);
- struct.success.add(_elem69);
+ _elem85 = new org.apache.airavata.model.experiment.ExperimentModel();
+ _elem85.read(iprot);
+ struct.success.add(_elem85);
}
iprot.readListEnd();
}
@@ -42190,9 +42500,9 @@ public class RegistryService {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
- for (org.apache.airavata.model.experiment.ExperimentModel _iter71 : struct.success)
+ for (org.apache.airavata.model.experiment.ExperimentModel _iter87 : struct.success)
{
- _iter71.write(oprot);
+ _iter87.write(oprot);
}
oprot.writeListEnd();
}
@@ -42231,9 +42541,9 @@ public class RegistryService {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (org.apache.airavata.model.experiment.ExperimentModel _iter72 : struct.success)
+ for (org.apache.airavata.model.experiment.ExperimentModel _iter88 : struct.success)
{
- _iter72.write(oprot);
+ _iter88.write(oprot);
}
}
}
@@ -42248,14 +42558,14 @@ public class RegistryService {
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list73 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new ArrayList<org.apache.airavata.model.experiment.ExperimentModel>(_list73.size);
- org.apache.airavata.model.experiment.ExperimentModel _elem74;
- for (int _i75 = 0; _i75 < _list73.size; ++_i75)
+ org.apache.thrift.protocol.TList _list89 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<org.apache.airavata.model.experiment.ExperimentModel>(_list89.size);
+ org.apache.airavata.model.experiment.ExperimentModel _elem90;
+ for (int _i91 = 0; _i91 < _list89.size; ++_i91)
{
- _elem74 = new org.apache.airavata.model.experiment.ExperimentModel();
- _elem74.read(iprot);
- struct.success.add(_elem74);
+ _elem90 = new org.apache.airavata.model.experiment.ExperimentModel();
+ _elem90.read(iprot);
+ struct.success.add(_elem90);
}
}
struct.setSuccessIsSet(true);
@@ -43319,14 +43629,14 @@ public class RegistryService {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list76 = iprot.readListBegin();
- struct.success = new ArrayList<org.apache.airavata.model.experiment.ExperimentModel>(_list76.size);
- org.apache.airavata.model.experiment.ExperimentModel _elem77;
- for (int _i78 = 0; _i78 < _list76.size; ++_i78)
+ org.apache.thrift.protocol.TList _list92 = iprot.readListBegin();
+ struct.success = new ArrayList<org.apache.airavata.model.experiment.ExperimentModel>(_list92.size);
+ org.apache.airavata.model.experiment.ExperimentModel _elem93;
+ for (int _i94 = 0; _i94 < _list92.size; ++_i94)
{
- _elem77 = new org.apache.airavata.model.experiment.ExperimentModel();
- _elem77.read(iprot);
- struct.success.add(_elem77);
+ _elem93 = new org.apache.airavata.model.experiment.ExperimentModel();
+ _elem93.read(iprot);
+ struct.success.add(_elem93);
}
iprot.readListEnd();
}
@@ -43363,9 +43673,9 @@ public class RegistryService {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
- for (org.apache.airavata.model.experiment.ExperimentModel _iter79 : struct.success)
+ for (org.apache.airavata.model.experiment.ExperimentModel _iter95 : struct.success)
{
- _iter79.write(oprot);
+ _iter95.write(oprot);
}
oprot.writeListEnd();
}
@@ -43404,9 +43714,9 @@ public class RegistryService {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (org.apache.airavata.model.experiment.ExperimentModel _iter80 : struct.success)
+ for (org.apache.airavata.model.experiment.ExperimentModel _iter96 : struct.success)
{
- _iter80.write(oprot);
+ _iter96.write(oprot);
}
}
}
@@ -43421,14 +43731,14 @@ public class RegistryService {
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list81 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new ArrayList<org.apache.airavata.model.experiment.ExperimentModel>(_list81.size);
- org.apache.airavata.model.experiment.ExperimentModel _elem82;
- for (int _i83 = 0; _i83 < _list81.size; ++_i83)
+ org.apache.thrift.protocol.TList _list97 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<org.apache.airavata.model.experiment.ExperimentModel>(_list97.size);
+ org.apache.airavata.model.experiment.ExperimentModel _elem98;
+ for (int _i99 = 0; _i99 < _list97.size; ++_i99)
{
- _elem82 = new org.apache.airavata.model.experiment.ExperimentModel();
- _elem82.read(iprot);
- struct.success.add(_elem82);
+ _elem98 = new org.apache.airavata.model.experiment.ExperimentModel();
+ _elem98.read(iprot);
+ struct.success.add(_elem98);
}
}
struct.setSuccessIsSet(true);
@@ -50895,14 +51205,14 @@ public class RegistryService {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list84 = iprot.readListBegin();
- struct.success = new ArrayList<org.apache.airavata.model.application.io.OutputDataObjectType>(_list84.size);
- org.apache.airavata.model.application.io.OutputDataObjectType _elem85;
- for (int _i86 = 0; _i86 < _list84.size; ++_i86)
+ org.apache.thrift.protocol.TList _list100 = iprot.readListBegin();
+ struct.success = new ArrayList<org.apache.airavata.model.application.io.OutputDataObjectType>(_list100.size);
+ org.apache.airavata.model.application.io.OutputDataObjectType _elem101;
+ for (int _i102 = 0; _i102 < _list100.size; ++_i102)
{
- _elem85 = new org.apache.airavata.model.application.io.OutputDataObjectType();
- _elem85.read(iprot);
- struct.success.add(_elem85);
+ _elem101 = new org.apache.airavata.model.application.io.OutputDataObjectType();
+ _elem101.read(iprot);
+ struct.success.add(_elem101);
}
iprot.readListEnd();
}
@@ -50939,9 +51249,9 @@ public class RegistryService {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
- for (org.apache.airavata.model.application.io.OutputDataObjectType _iter87 : struct.success)
+ for (org.apache.airavata.model.application.io.OutputDataObjectType _iter103 : struct.success)
{
- _iter87.write(oprot);
+ _iter103.write(oprot);
}
oprot.writeListEnd();
}
@@ -50980,9 +51290,9 @@ public class RegistryService {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (org.apache.airavata.model.application.io.OutputDataObjectType _iter88 : struct.success)
+ for (org.apache.airavata.model.application.io.OutputDataObjectType _iter104 : struct.success)
{
- _iter88.write(oprot);
+ _iter104.write(oprot);
}
}
}
@@ -50997,14 +51307,14 @@ public class RegistryService {
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list89 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new ArrayList<org.apache.airavata.model.application.io.OutputDataObjectType>(_list89.size);
- org.apache.airavata.model.application.io.OutputDataObjectType _elem90;
- for (int _i91 = 0; _i91 < _list89.size; ++_i91)
+ org.apache.thrift.protocol.TList _list105 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<org.apache.airavata.model.application.io.OutputDataObjectType>(_list105.size);
+ org.apache.airavata.model.application.io.OutputDataObjectType _elem106;
+ for (int _i107 = 0; _i107 < _list105.size; ++_i107)
{
- _elem90 = new org.apache.airavata.model.application.io.OutputDataObjectType();
- _elem90.read(iprot);
- struct.success.add(_elem90);
+ _elem106 = new org.apache.airavata.model.application.io.OutputDataObjectType();
+ _elem106.read(iprot);
+ struct.success.add(_elem106);
}
}
struct.setSuccessIsSet(true);
@@ -51771,14 +52081,14 @@ public class RegistryService {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list92 = iprot.readListBegin();
- struct.success = new ArrayList<org.apache.airavata.model.application.io.OutputDataObjectType>(_list92.size);
- org.apache.airavata.model.application.io.OutputDataObjectType _elem93;
- for (int _i94 = 0; _i94 < _list92.size; ++_i94)
+ org.apache.thrift.protocol.TList _list108 = iprot.readListBegin();
+ struct.success = new ArrayList<org.apache.airavata.model.application.io.OutputDataObjectType>(_list108.size);
+ org.apache.airavata.model.application.io.OutputDataObjectType _elem109;
+ for (int _i110 = 0; _i110 < _list108.size; ++_i110)
{
- _elem93 = new org.apache.airavata.model.application.io.OutputDataObjectType();
- _elem93.read(iprot);
- struct.success.add(_elem93);
+ _elem109 = new org.apache.airavata.model.application.io.OutputDataObjectType();
+ _elem109.read(iprot);
+ struct.success.add(_elem109);
}
iprot.readListEnd();
}
@@ -51815,9 +52125,9 @@ public class RegistryService {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
- for (org.apache.airavata.model.application.io.OutputDataObjectType _iter95 : struct.success)
+ for (org.apache.airavata.model.application.io.OutputDataObjectType _iter111 : struct.success)
{
- _iter95.write(oprot);
+ _iter111.write(oprot);
}
oprot.writeListEnd();
}
@@ -51856,9 +52166,9 @@ public class RegistryService {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (org.apache.airavata.model.application.io.OutputDataObjectType _iter96 : struct.success)
+ for (org.apache.airavata.model.application.io.OutputDataObjectType _iter112 : struct.success)
{
- _iter96.write(oprot);
+ _iter112.write(oprot);
}
}
}
@@ -51873,14 +52183,14 @@ public class RegistryService {
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list97 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new ArrayList<org.apache.airavata.model.application.io.OutputDataObjectType>(_list97.size);
- org.apache.airavata.model.application.io.OutputDataObjectType _elem98;
- for (int _i99 = 0; _i99 < _list97.size; ++_i99)
+ org.apache.thrift.protocol.TList _list113 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<org.apache.airavata.model.application.io.OutputDataObjectType>(_list113.size);
+ org.apache.airavata.model.application.io.OutputDataObjectType _elem114;
+ for (int _i115 = 0; _i115 < _list113.size; ++_i115)
{
- _elem98 = new org.apache.airavata.model.application.io.OutputDataObjectType();
- _elem98.read(iprot);
- struct.success.add(_elem98);
+ _elem114 = new org.apache.airavata.model.application.io.OutputDataObjectType();
+ _elem114.read(iprot);
+ struct.success.add(_elem114);
}
}
struct.setSuccessIsSet(true);
@@ -52652,16 +52962,16 @@ public class RegistryService {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
- org.apache.thrift.protocol.TMap _map100 = iprot.readMapBegin();
- struct.success = new HashMap<String,org.apache.airavata.model.status.JobStatus>(2*_map100.size);
- String _key101;
- org.apache.airavata.model.status.JobStatus _val102;
- for (int _i103 = 0; _i103 < _map100.size; ++_i103)
+ org.apache.thrift.protocol.TMap _map116 = iprot.readMapBegin();
+ struct.success = new HashMap<String,org.apache.airavata.model.status.JobStatus>(2*_map116.size);
+ String _key117;
+ org.apache.airavata.model.status.JobStatus _val118;
+ for (int _i119 = 0; _i119 < _map116.size; ++_i119)
{
- _key101 = iprot.readString();
- _val102 = new org.apache.airavata.model.status.JobStatus();
- _val102.read(iprot);
- struct.success.put(_key101, _val102);
+ _key117 = iprot.readString();
+ _val118 = new org.apache.airavata.model.status.JobStatus();
+ _val118.read(iprot);
+ struct.success.put(_key117, _val118);
}
iprot.readMapEnd();
}
@@ -52698,10 +53008,10 @@ public class RegistryService {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
- for (Map.Entry<String, org.apache.airavata.model.status.JobStatus> _iter104 : struct.success.entrySet())
+ for (Map.Entry<String, org.apache.airavata.model.status.JobStatus> _iter120 : struct.success.entrySet())
{
- oprot.writeString(_iter104.getKey());
- _iter104.getValue().write(oprot);
+ oprot.writeString(_iter120.getKey());
+ _iter120.getValue().write(oprot);
}
oprot.writeMapEnd();
}
@@ -52740,10 +53050,10 @@ public class RegistryService {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (Map.Entry<String, org.apache.airavata.model.status.JobStatus> _iter105 : struct.success.entrySet())
+ for (Map.Entry<String, org.apache.airavata.model.status.JobStatus> _iter121 : struct.success.entrySet())
{
- oprot.writeString(_iter105.getKey());
- _iter105.getValue().write(oprot);
+ oprot.writeString(_iter121.getKey());
+ _iter121.getValue().write(oprot);
}
}
}
@@ -52758,16 +53068,16 @@ public class RegistryService {
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TMap _map106 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new HashMap<String,org.apache.airavata.model.status.JobStatus>(2*_map106.size);
- String _key107;
- org.apache.airavata.model.status.JobStatus _val108;
- for (int _i109 = 0; _i109 < _map106.size; ++_i109)
+ org.apache.thrift.protocol.TMap _map122 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new HashMap<String,org.apache.airavata.model.status.JobStatus>(2*_map122.size);
+ String _key123;
+ org.apache.airavata.model.status.JobStatus _val124;
+ for (int _i125 = 0; _i125 < _map122.size; ++_i125)
{
- _key107 = iprot.readString();
- _val108 = new org.apache.airavata.model.status.JobStatus();
- _val108.read(iprot);
- struct.success.put(_key107, _val108);
+ _key123 = iprot.readString();
+ _val124 = new org.apache.airavata.model.status.JobStatus();
+ _val124.read(iprot);
+ struct.success.put(_key123, _val124);
}
}
struct.setSuccessIsSet(true);
@@ -53534,14 +53844,14 @@ public class RegistryService {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list110 = iprot.readListBegin();
- struct.success = new ArrayList<org.apache.airavata.model.job.JobModel>(_list110.size);
- org.apache.airavata.model.job.JobModel _elem111;
- for (int _i112 = 0; _i112 < _list110.size; ++_i112)
+ org.apache.thrift.protocol.TList _list126 = iprot.readListBegin();
+ struct.success = new ArrayList<org.apache.airavata.model.job.JobModel>(_list126.size);
+ org.apache.airavata.model.job.JobModel _elem127;
+ for (int _i128 = 0; _i128 < _list126.size; ++_i128)
{
- _elem111 = new org.apache.airavata.model.job.JobModel();
- _elem111.read(iprot);
- struct.success.add(_elem111);
+ _elem127 = new org.apache.airavata.model.job.JobModel();
+ _elem127.read(iprot);
+ struct.success.add(_elem127);
}
iprot.readListEnd();
}
@@ -53578,9 +53888,9 @@ public class RegistryService {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
- for (org.apache.airavata.model.job.JobModel _iter113 : struct.success)
+ for (org.apache.airavata.model.job.JobModel _iter129 : struct.success)
{
- _iter113.write(oprot);
+ _iter129.write(oprot);
}
oprot.writeListEnd();
}
@@ -53619,9 +53929,9 @@ public class RegistryService {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (org.apache.airavata.model.job.JobModel _iter114 : struct.success)
+ for (org.apache.airavata.model.job.JobModel _iter130 : struct.success)
{
- _iter114.write(oprot);
+ _iter130.write(oprot);
}
}
}
@@ -53636,14 +53946,14 @@ public class RegistryService {
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list115 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new ArrayList<org.apache.airavata.model.job.JobModel>(_list115.size);
- org.apache.airavata.model.job.JobModel _elem116;
- for (int _i117 = 0; _i117 < _list115.size; ++_i117)
+ org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<org.apache.airavata.model.job.JobModel>(_list131.size);
+ org.apache.airavata.model.job.JobModel _elem132;
+ for (int _i133 = 0; _i133 < _list131.size; ++_i133)
{
- _elem116 = new org.apache.airavata.model.job.JobModel();
- _elem116.read(iprot);
- struct.success.add(_elem116);
+ _elem132 = new org.apache.airavata.model.job.JobModel();
+ _elem132.read(iprot);
+ struct.success.add(_elem132);
}
}
struct.setSuccessIsSet(true);
@@ -57093,14 +57403,14 @@ public class RegistryService {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list118 = iprot.readListBegin();
- struct.success = new ArrayList<org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule>(_list118.size);
- org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule _elem119;
- for (int _i120 = 0; _i120 < _list118.size; ++_i120)
+ org.apache.thrift.protocol.TList _list134 = iprot.readListBegin();
+ struct.success = new ArrayList<org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule>(_list134.size);
+ org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule _elem135;
+ for (int _i136 = 0; _i136 < _list134.size; ++_i136)
{
- _elem119 = new org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule();
- _elem119.read(iprot);
- struct.success.add(_elem119);
+ _elem135 = new org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule();
+ _elem135.read(iprot);
+ struct.success.add(_elem135);
}
iprot.readListEnd();
}
@@ -57137,9 +57447,9 @@ public class RegistryService {
<TRUNCATED>