airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/2] airavata git commit: adding gateway resource profile when creating calling addGateway()
Date Tue, 08 Dec 2015 21:22:11 GMT
Repository: airavata
Updated Branches:
  refs/heads/master e14734617 -> 17d1b4f99


adding gateway resource profile when creating calling addGateway()


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

Branch: refs/heads/master
Commit: c46d5dcbe4802fe7a6a16c690103617901725e2e
Parents: 777af19
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Tue Dec 8 16:19:54 2015 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Tue Dec 8 16:19:54 2015 -0500

----------------------------------------------------------------------
 .../api/server/handler/AiravataServerHandler.java       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/c46d5dcb/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 9e9c3be..6548a2b 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
@@ -116,13 +116,23 @@ public class AiravataServerHandler implements Airavata.Iface {
                 logger.error("Gateway id cannot be empty...");
                 throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
             }
-            return (String) experimentCatalog.add(ExpCatParentDataType.GATEWAY, gateway,
gateway.getGatewayId());
+            String gatewayId = (String) experimentCatalog.add(ExpCatParentDataType.GATEWAY,
gateway, gateway.getGatewayId());
+            GatewayResourceProfile gatewayResourceProfile = new GatewayResourceProfile();
+            gatewayResourceProfile.setGatewayID(gatewayId);
+            appCatalog.getGatewayProfile().addGatewayResourceProfile(gatewayResourceProfile);
+            return gatewayId;
         } catch (RegistryException 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;
         }
     }
 


Mime
View raw message