stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject stratos git commit: Added instanceId field to Member class and exposed it through topology.
Date Sun, 11 Oct 2015 13:03:32 GMT
Repository: stratos
Updated Branches:
  refs/heads/stratos-4.1.x 02d01071c -> 0fe27c799


Added instanceId field to Member class and exposed it through topology.

Conflicts:
	components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/domain/Member.java
	extensions/load-balancer/aws-extension/src/main/java/org/apache/stratos/aws/extension/AWSLoadBalancer.java


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

Branch: refs/heads/stratos-4.1.x
Commit: 0fe27c7990347f4ead3b55d4f4a3b9662175aa8c
Parents: 02d0107
Author: swapnilpatilRajaram <swapnil.patil@students.iiit.ac.in>
Authored: Sun Jun 21 19:59:03 2015 +0000
Committer: gayangunarathne <gayang@wso2.com>
Committed: Sun Oct 11 16:21:59 2015 +0530

----------------------------------------------------------------------
 .../messaging/topology/TopologyBuilder.java           |  1 +
 .../stratos/load/balancer/common/domain/Member.java   | 14 +++++++-------
 .../LoadBalancerCommonTopologyEventReceiver.java      |  4 ++++
 .../stratos/messaging/domain/topology/Member.java     | 10 ++++++++++
 4 files changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/0fe27c79/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
index 7348b81..1b8db0e 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
@@ -398,6 +398,7 @@ public class TopologyBuilder {
             member.setStatus(MemberStatus.Created);
             member.setLbClusterId(lbClusterId);
             member.setProperties(CloudControllerUtil.toJavaUtilProperties(memberContext.getProperties()));
+            member.setInstanceId(memberContext.getInstanceId());
             cluster.addMember(member);
             TopologyManager.updateTopology(topology);
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/0fe27c79/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/domain/Member.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/domain/Member.java
b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/domain/Member.java
index c0422da..1bb93c2 100644
--- a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/domain/Member.java
+++ b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/domain/Member.java
@@ -35,7 +35,7 @@ public class Member {
     private Map<Integer, Port> portMap;
     private String instanceId;
 
-    public Member(String serviceName, String clusterId, String memberId, String hostName)
{
+	public Member(String serviceName, String clusterId, String memberId, String hostName) {
         this.serviceName = serviceName;
         this.clusterId = clusterId;
         this.memberId = memberId;
@@ -87,12 +87,12 @@ public class Member {
     public String getServiceName() {
         return serviceName;
     }
-
+    
     public String getInstanceId() {
-        return instanceId;
-    }
+		return instanceId;
+	}
 
-    public void setInstanceId(String instanceId) {
-        this.instanceId = instanceId;
-    }
+	public void setInstanceId(String instanceId) {
+		this.instanceId = instanceId;
+	}
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/0fe27c79/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
index 40321d2..534bc38 100644
--- a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
+++ b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/event/receivers/LoadBalancerCommonTopologyEventReceiver.java
@@ -445,6 +445,10 @@ public class LoadBalancerCommonTopologyEventReceiver extends TopologyEventReceiv
                 member.addPort(transformPort(port));
             }
         }
+        
+        if (messagingMember.getInstanceId() != null) {
+            member.setInstanceId(messagingMember.getInstanceId());
+        }
         return member;
     }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/0fe27c79/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Member.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Member.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Member.java
index 2242075..12c34c8 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Member.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Member.java
@@ -43,6 +43,8 @@ public class Member implements Serializable, LifeCycleStateTransitionBehavior<Me
     private final String clusterInstanceId;
     private final String networkPartitionId;
     private final String partitionId;
+    // Instance id on IaaS side, which is available in MemberContext
+    private String instanceId;
 
     // member initiated time
     private final long initTime;
@@ -208,6 +210,14 @@ public class Member implements Serializable, LifeCycleStateTransitionBehavior<Me
     public LoadBalancingIPType getLoadBalancingIPType() {
         return loadBalancingIPType;
     }
+    
+    public String getInstanceId() {
+        return instanceId;
+    }
+
+    public void setInstanceId(String instanceId) {
+        this.instanceId = instanceId;
+    }
 
     @Override
     public String toString() {


Mime
View raw message