You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ga...@apache.org on 2015/01/28 13:32:56 UTC

stratos git commit: Update the findClusterId method to support with the group cartridge clusters also

Repository: stratos
Updated Branches:
  refs/heads/master 814c21938 -> 65078b813


Update the findClusterId method to support with the group cartridge clusters also


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

Branch: refs/heads/master
Commit: 65078b813d6a914977866b0c2677e58b9ca591b2
Parents: 814c219
Author: Gayan Gunarathne <ga...@wso2.com>
Authored: Wed Jan 28 18:02:10 2015 +0530
Committer: Gayan Gunarathne <ga...@wso2.com>
Committed: Wed Jan 28 18:02:10 2015 +0530

----------------------------------------------------------------------
 .../components/ArtifactDistributionCoordinator.java | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/65078b81/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/components/ArtifactDistributionCoordinator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/components/ArtifactDistributionCoordinator.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/components/ArtifactDistributionCoordinator.java
index c96627b..96a9191 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/components/ArtifactDistributionCoordinator.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/components/ArtifactDistributionCoordinator.java
@@ -22,6 +22,7 @@ package org.apache.stratos.manager.components;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.domain.application.Group;
 import org.apache.stratos.messaging.domain.application.signup.ApplicationSignUp;
 import org.apache.stratos.messaging.domain.application.signup.ArtifactRepository;
 import org.apache.stratos.manager.exception.ArtifactDistributionCoordinatorException;
@@ -174,9 +175,20 @@ public class ArtifactDistributionCoordinator {
         }
 
         ClusterDataHolder clusterData = application.getClusterData(alias);
+
         if(clusterData == null) {
-            throw new RuntimeException(String.format("Cluster data not found for alias: [application-id] %s [alias] %s",
-                    applicationId, alias));
+	        for(Group group:application.getGroups()){
+		        clusterData=group.getClusterData(alias);
+		        if(clusterData!=null){
+			        break;
+		        }
+	        }
+	        if (clusterData == null) {
+		        throw new RuntimeException(
+				        String.format("Cluster data not found for alias: [application-id] %s [alias] %s",
+				                      applicationId, alias));
+	        }
+
         }
         return clusterData.getClusterId();
     }