You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2017/08/03 16:01:38 UTC

[22/50] [abbrv] airavata git commit: Start DB Event Manager before other servers

Start DB Event Manager before other servers


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

Branch: refs/heads/master
Commit: 33a601fe84d297b11171a1157a2561a451ad9d84
Parents: e72ddf0
Author: Marcus Christie <ma...@apache.org>
Authored: Tue Jul 11 16:46:32 2017 -0500
Committer: Marcus Christie <ma...@apache.org>
Committed: Tue Jul 11 16:46:32 2017 -0500

----------------------------------------------------------------------
 .../api/service/messaging/RegistryServiceDBEventHandler.java | 7 ++++++-
 .../src/main/java/org/apache/airavata/server/ServerMain.java | 8 ++++----
 2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/33a601fe/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java
index 0fb387a..5652722 100644
--- a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java
@@ -91,7 +91,12 @@ public class RegistryServiceDBEventHandler implements MessageHandler {
                             }
                             case UPDATE: {
                                 logger.info("Replicating updateGateway in Registry.");
-                                registryClient.updateGateway(gateway.getGatewayId(), gateway);
+                                if (!registryClient.isGatewayExist(gateway.getGatewayId())) {
+                                    logger.info("Gateway doesn't exist so adding instead of updating.");
+                                    registryClient.addGateway(gateway);
+                                } else {
+                                    registryClient.updateGateway(gateway.getGatewayId(), gateway);
+                                }
                                 logger.info("updateGateway Replication Success!");
                                 break;
                             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/33a601fe/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
----------------------------------------------------------------------
diff --git a/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java b/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
index 36d317b..a391291 100644
--- a/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
+++ b/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
@@ -113,23 +113,23 @@ public class ServerMain {
 		List<String> serverList = new ArrayList<>(Arrays.asList(serverNames.split(",")));
 		if (serverList.indexOf(ALL_IN_ONE) > -1) {
 			serverList.clear();
-			serverList.add(REGISTRY_SERVER);  // registry server should start before everything
+			serverList.add(DB_EVENT_MANAGER); // DB Event Manager should start before everything
+			serverList.add(REGISTRY_SERVER);  // registry server should start before everything else
 			serverList.add(CREDENTIAL_STORE); // credential store should start before api server
 			serverList.add(SHARING_SERVER);
 			serverList.add(API_SERVER);
 			serverList.add(ORCHESTRATOR);
 			serverList.add(GFAC_SERVER);
 			serverList.add(PROFILE_SERVICE);
-			serverList.add(DB_EVENT_MANAGER);
 		} else if (serverList.indexOf(API_ORCH) > -1) {
 			serverList.clear();
-            serverList.add(REGISTRY_SERVER);  // registry server should start before everything
+			serverList.add(DB_EVENT_MANAGER); // DB Event Manager should start before everything
+			serverList.add(REGISTRY_SERVER);  // registry server should start before everything else
             serverList.add(CREDENTIAL_STORE); // credential store should start before api server
 			serverList.add(SHARING_SERVER);
 			serverList.add(API_SERVER);
 			serverList.add(ORCHESTRATOR);
 			serverList.add(PROFILE_SERVICE);
-			serverList.add(DB_EVENT_MANAGER);
 		} else if (serverList.indexOf(EXECUTION) > -1) {
 			serverList.clear();
 			serverList.add(GFAC_SERVER);