Updated Branches:
  refs/heads/master 14d6419dc -> def7a48af

adding more events to the messaging component


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

Branch: refs/heads/master
Commit: def7a48af22675c4cf83314ce5e1679b2aa80e28
Parents: 14d6419
Author: rekathiru <[email protected]>
Authored: Wed Oct 16 15:02:04 2013 +0530
Committer: rekathiru <[email protected]>
Committed: Wed Oct 16 15:02:04 2013 +0530

----------------------------------------------------------------------
 .../event/depsync/ArtifactsUpdatedEvent.java    |  44 +++++++
 .../instance/status/MemberActivatedEvent.java   |  57 +++++++++
 .../instance/status/MemberStartedEvent.java     | 119 +++++++++++++++++++
 .../event/topology/ClusterCreatedEvent.java     |  31 +----
 .../event/topology/MemberSpawnedEvent.java      |  83 +++++++++++++
 .../event/topology/MemberStartedEvent.java      |   2 +-
 6 files changed, 305 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/def7a48a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/depsync/ArtifactsUpdatedEvent.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/depsync/ArtifactsUpdatedEvent.java
 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/depsync/ArtifactsUpdatedEvent.java
new file mode 100644
index 0000000..41d78a0
--- /dev/null
+++ 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/depsync/ArtifactsUpdatedEvent.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.messaging.event.depsync;
+
+/**
+ * this event is fired to a cluster when a artifacts notification received 
from the git repository.
+ */
+
+public class ArtifactsUpdatedEvent {
+    private String clusterId;
+    private String status;
+
+    public String getClusterId() {
+        return clusterId;
+    }
+
+    public void setClusterId(String clusterId) {
+        this.clusterId = clusterId;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/def7a48a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/instance/status/MemberActivatedEvent.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/instance/status/MemberActivatedEvent.java
 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/instance/status/MemberActivatedEvent.java
new file mode 100644
index 0000000..083d70c
--- /dev/null
+++ 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/instance/status/MemberActivatedEvent.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.messaging.event.instance.status;
+
+import org.apache.stratos.messaging.event.topology.TopologyEvent;
+
+import java.io.Serializable;
+
+/**
+ * This event is fired by Instance when it has started it's server and
+ * applications are ready to serve the incoming requests.
+ */
+public class MemberActivatedEvent extends TopologyEvent implements 
Serializable {
+    private String serviceName;
+    private String clusterId;
+    private String memberId;
+
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    public void setServiceName(String serviceName) {
+        this.serviceName = serviceName;
+    }
+
+    public String getClusterId() {
+        return clusterId;
+    }
+
+    public void setClusterId(String clusterId) {
+        this.clusterId = clusterId;
+    }
+
+    public String getMemberId() {
+        return memberId;
+    }
+
+    public void setMemberId(String memberId) {
+        this.memberId = memberId;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/def7a48a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/instance/status/MemberStartedEvent.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/instance/status/MemberStartedEvent.java
 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/instance/status/MemberStartedEvent.java
new file mode 100644
index 0000000..f613d88
--- /dev/null
+++ 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/instance/status/MemberStartedEvent.java
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.messaging.event.instance.status;
+
+
+import org.apache.stratos.messaging.domain.topology.MemberStatus;
+import org.apache.stratos.messaging.domain.topology.Port;
+import org.apache.stratos.messaging.event.topology.TopologyEvent;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * This event is fired by Instance when it is started by the IaaS in a given 
cluster.
+ */
+public class MemberStartedEvent extends TopologyEvent implements Serializable {
+    private String serviceName;
+    private String clusterId;
+    private String memberId;
+    private String hostName;
+    private MemberStatus status;
+    private Map<String, Port> portMap;
+    private Properties properties;
+
+    public MemberStartedEvent() {
+        this.portMap = new HashMap<String, Port>();
+    }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    public void setServiceName(String serviceName) {
+        this.serviceName = serviceName;
+    }
+
+    public String getClusterId() {
+        return clusterId;
+    }
+
+    public void setClusterId(String clusterId) {
+        this.clusterId = clusterId;
+    }
+
+    public String getMemberId() {
+        return memberId;
+    }
+
+    public void setMemberId(String memberId) {
+        this.memberId = memberId;
+    }
+
+    public String getHostName() {
+        return hostName;
+    }
+
+    public void setHostName(String hostName) {
+        this.hostName = hostName;
+    }
+
+    public MemberStatus getStatus() {
+        return status;
+    }
+
+    public void setStatus(MemberStatus status) {
+        this.status = status;
+    }
+
+    public Collection<Port> getPorts() {
+        return portMap.values();
+    }
+
+    public void addPort(Port port) {
+        this.portMap.put(port.getProtocol(), port);
+    }
+
+    public void removePort(Port port) {
+        this.portMap.remove(port.getProtocol());
+    }
+
+    public void removePort(String portName) {
+        this.portMap.remove(portName);
+    }
+
+    public boolean portExists(Port port) {
+        return this.portMap.containsKey(port.getProtocol());
+    }
+
+    public Port getPort(String portName) {
+        return this.portMap.get(portName);
+    }
+
+    public Properties getProperties() {
+        return properties;
+    }
+
+    public void setProperties(Properties properties) {
+        this.properties = properties;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/def7a48a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterCreatedEvent.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterCreatedEvent.java
 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterCreatedEvent.java
index 521ae4e..4d24d96 100644
--- 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterCreatedEvent.java
+++ 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterCreatedEvent.java
@@ -19,13 +19,9 @@
 
 package org.apache.stratos.messaging.event.topology;
 
-import org.apache.stratos.messaging.domain.topology.Cloud;
-import org.apache.stratos.messaging.domain.topology.Region;
-import org.apache.stratos.messaging.domain.topology.Zone;
 import org.apache.stratos.messaging.util.Util;
 
 import java.io.Serializable;
-import java.util.Map;
 import java.util.Properties;
 
 /**
@@ -36,9 +32,7 @@ public class ClusterCreatedEvent extends TopologyEvent 
implements Serializable {
     private String clusterId;
     private String hostName;
     private String tenantRange;
-    private Cloud cloud;
-    private Region region;
-    private Zone zone;
+
     private Properties properties;
 
     public String getServiceName() {
@@ -74,29 +68,6 @@ public class ClusterCreatedEvent extends TopologyEvent 
implements Serializable {
         this.tenantRange = tenantRange;
     }
 
-    public Cloud getCloud() {
-        return cloud;
-    }
-
-    public void setCloud(Cloud cloud) {
-        this.cloud = cloud;
-    }
-
-    public Region getRegion() {
-        return region;
-    }
-
-    public void setRegion(Region region) {
-        this.region = region;
-    }
-
-    public Zone getZone() {
-        return zone;
-    }
-
-    public void setZone(Zone zone) {
-        this.zone = zone;
-    }
 
     public Properties getProperties() {
         return properties;

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/def7a48a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/MemberSpawnedEvent.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/MemberSpawnedEvent.java
 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/MemberSpawnedEvent.java
new file mode 100644
index 0000000..d539a6f
--- /dev/null
+++ 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/MemberSpawnedEvent.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.messaging.event.topology;
+
+import org.apache.stratos.messaging.domain.topology.Cloud;
+import org.apache.stratos.messaging.domain.topology.Region;
+import org.apache.stratos.messaging.domain.topology.Zone;
+
+/**
+ * This event is fired by Cloud Controller when a member is spawned by the 
IaaS in a given cluster.
+ */
+public class MemberSpawnedEvent {
+    private Cloud cloud;
+    private Region region;
+    private Zone zone;
+    private String serviceName;
+    private String clusterId;
+    private String memberId;
+
+    public Cloud getCloud() {
+        return cloud;
+    }
+
+    public void setCloud(Cloud cloud) {
+        this.cloud = cloud;
+    }
+
+    public Region getRegion() {
+        return region;
+    }
+
+    public void setRegion(Region region) {
+        this.region = region;
+    }
+
+    public Zone getZone() {
+        return zone;
+    }
+
+    public void setZone(Zone zone) {
+        this.zone = zone;
+    }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    public void setServiceName(String serviceName) {
+        this.serviceName = serviceName;
+    }
+
+    public String getClusterId() {
+        return clusterId;
+    }
+
+    public void setClusterId(String clusterId) {
+        this.clusterId = clusterId;
+    }
+
+    public String getMemberId() {
+        return memberId;
+    }
+
+    public void setMemberId(String memberId) {
+        this.memberId = memberId;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/def7a48a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/MemberStartedEvent.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/MemberStartedEvent.java
 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/MemberStartedEvent.java
index c9060ef..9619607 100644
--- 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/MemberStartedEvent.java
+++ 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/MemberStartedEvent.java
@@ -29,7 +29,7 @@ import java.util.Map;
 import java.util.Properties;
 
 /**
- * This event is fired by Cloud Controller when a member is started by the 
IaaS in a given cluster.
+ * This event is fired by Cloud Controller when a agent inside member  is 
started  successfully in a given cluster.
  */
 public class MemberStartedEvent extends TopologyEvent implements Serializable {
     private String serviceName;

Reply via email to