stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [19/50] [abbrv] git commit: adding Cluster details to the SM's Topology model
Date Thu, 30 Oct 2014 04:13:43 GMT
adding Cluster details to the SM's Topology model


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

Branch: refs/heads/docker-grouping-merge
Commit: c95377ff9b98b0138b17b52a696b5cedcc68fa2c
Parents: 7b4e326
Author: Isuru Haththotuwa <isuruh@apache.org>
Authored: Tue Oct 28 10:58:12 2014 +0530
Committer: Isuru Haththotuwa <isuruh@apache.org>
Committed: Tue Oct 28 10:58:12 2014 +0530

----------------------------------------------------------------------
 .../receiver/StratosManagerTopologyEventReceiver.java | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/c95377ff/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/topology/receiver/StratosManagerTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/topology/receiver/StratosManagerTopologyEventReceiver.java
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/topology/receiver/StratosManagerTopologyEventReceiver.java
index 6e8552b..d4e90cc 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/topology/receiver/StratosManagerTopologyEventReceiver.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/topology/receiver/StratosManagerTopologyEventReceiver.java
@@ -36,6 +36,8 @@ import org.apache.stratos.messaging.message.receiver.topology.TopologyEventRecei
 import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
 import org.wso2.carbon.context.PrivilegedCarbonContext;
 
+import java.util.List;
+
 public class StratosManagerTopologyEventReceiver implements Runnable {
 
     private static final Log log = LogFactory.getLog(StratosManagerTopologyEventReceiver.class);
@@ -347,6 +349,18 @@ public class StratosManagerTopologyEventReceiver implements Runnable
{
                     } finally {
                     	PrivilegedCarbonContext.endTenantFlow();
                     }
+
+                    // add the clusters to the topology information model
+                    List<Cluster> appClusters = appCreateEvent.getClusterList();
+                    if (appClusters != null && !appClusters.isEmpty()) {
+                        for (Cluster appCluster :  appClusters) {
+                            TopologyClusterInformationModel.getInstance().addCluster(appCluster);
+                        }
+                    } else {
+                        log.warn("No clusters were found in the Application Created event
for app id [ " +
+                                appId + " ] to add to Cluster Information model");
+                    }
+
                 } finally {
                     //TopologyManager.releaseReadLock();
                     TopologyManager.releaseReadLockForApplication(appCreateEvent.getApplication().getUniqueIdentifier());


Mime
View raw message