airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [6/7] airavata git commit: adding API methods to get parent and child products
Date Thu, 24 Mar 2016 18:41:42 GMT
adding API methods to get parent and child products


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

Branch: refs/heads/develop
Commit: 02cbb8dc0640e64aae3a4a161cbe79255a81cd13
Parents: 18cd83c
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Thu Mar 24 14:41:15 2016 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Thu Mar 24 14:41:15 2016 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   |    34 +-
 .../java/org/apache/airavata/api/Airavata.java  | 40309 +++++++++--------
 .../main/resources/lib/airavata/Airavata.cpp    |  1614 +-
 .../src/main/resources/lib/airavata/Airavata.h  |   318 +-
 .../lib/airavata/Airavata_server.skeleton.cpp   |    12 +-
 .../airavata/replica_catalog_models_types.cpp   |   216 +-
 .../lib/airavata/replica_catalog_models_types.h |    10 +-
 .../resources/lib/Airavata/API/Airavata.php     | 11273 ++---
 .../lib/Airavata/Model/Data/Replica/Types.php   |    87 +-
 .../lib/apache/airavata/api/Airavata-remote     |    14 +
 .../lib/apache/airavata/api/Airavata.py         |   582 +-
 .../airavata/model/data/replica/ttypes.py       |    50 +-
 .../model/data/replica/DataProductModel.java    |   218 +-
 .../data/replica/DataReplicaLocationModel.java  |    44 +-
 .../catalog/impl/ReplicaCatalogImpl.java        |    46 +
 .../utils/ThriftDataModelConversion.java        |    10 -
 .../airavata/registry/cpi/ReplicaCatalog.java   |     4 +
 .../airavata-apis/airavata_api.thrift           |    11 +
 .../replica_catalog_models.thrift               |     1 -
 19 files changed, 30154 insertions(+), 24699 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/02cbb8dc/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 f1564e5..718243f 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
@@ -4343,7 +4343,39 @@ public class AiravataServerHandler implements Airavata.Iface {
             String replicaId = dataCatalog.registerReplicaLocation(replicaLocationModel);
             return replicaId;
         } catch (Exception e) {
-            String msg = "Error in retreiving the data product "+replicaLocationModel.getReplicaName()+".";
+            String msg = "Error in retreiving the replica "+replicaLocationModel.getReplicaName()+".";
+            logger.error(msg, e);
+            AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage(msg+" More info : " + e.getMessage());
+            throw exception;
+        }
+    }
+
+    @Override
+    public DataProductModel getParentDataProduct(AuthzToken authzToken, String productUri)
throws InvalidRequestException,
+            AiravataClientException, AiravataSystemException, AuthorizationException, TException
{
+        try {
+            dataCatalog = RegistryFactory.getReplicaCatalog();
+            DataProductModel dataProductModel = dataCatalog.getParentDataProduct(productUri;
+            return dataProductModel;
+        } catch (Exception e) {
+            String msg = "Error in retreiving the parent data product for "+ productUri+".";
+            logger.error(msg, e);
+            AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage(msg+" More info : " + e.getMessage());
+            throw exception;
+        }
+    }
+
+    @Override
+    public List<DataProductModel> getChildDataProducts(AuthzToken authzToken, String
productUri) throws InvalidRequestException,
+            AiravataClientException, AiravataSystemException, AuthorizationException, TException
{
+        try {
+            dataCatalog = RegistryFactory.getReplicaCatalog();
+            List<DataProductModel> dataProductModels = dataCatalog.getChildDataProducts(productUri);
+            return dataProductModels;
+        } catch (Exception e) {
+            String msg = "Error in retreiving the child products for "+productUri+".";
             logger.error(msg, e);
             AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
             exception.setMessage(msg+" More info : " + e.getMessage());


Mime
View raw message