You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2015/10/27 17:11:41 UTC

airavata git commit: adding gateway profile when server starts

Repository: airavata
Updated Branches:
  refs/heads/master ed4637cc2 -> e61cb8bbc


adding gateway profile when server starts


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

Branch: refs/heads/master
Commit: e61cb8bbc8627d0b47ec59aea798b24663464260
Parents: ed4637c
Author: Chathuri Wimalasena <ch...@apache.org>
Authored: Tue Oct 27 12:11:31 2015 -0400
Committer: Chathuri Wimalasena <ch...@apache.org>
Committed: Tue Oct 27 12:11:31 2015 -0400

----------------------------------------------------------------------
 .../apache/airavata/api/server/util/AppCatalogInitUtil.java  | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/e61cb8bb/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AppCatalogInitUtil.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AppCatalogInitUtil.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AppCatalogInitUtil.java
index d0fb5cd..c6dcd22 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AppCatalogInitUtil.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AppCatalogInitUtil.java
@@ -22,7 +22,9 @@
 package org.apache.airavata.api.server.util;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.registry.core.app.catalog.resources.GatewayProfileResource;
 import org.apache.derby.drda.NetworkServerControl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -76,6 +78,12 @@ public class AppCatalogInitUtil {
             } else {
                 logger.info("Database already created for App Catalog!");
             }
+            GatewayProfileResource gatewayProfileResource = new GatewayProfileResource();
+            if (!gatewayProfileResource.isExists(ServerSettings.getDefaultUserGateway())){
+                gatewayProfileResource.setGatewayID(ServerSettings.getDefaultUserGateway());
+                gatewayProfileResource.setCreatedTime(AiravataUtils.getCurrentTimestamp());
+                gatewayProfileResource.save();
+            }
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
             throw new RuntimeException("Database failure", e);