Repository: stratos
Updated Branches:
  refs/heads/4.0.0-grouping e81038cb5 -> ea9f4042e


Status for Group and Application


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

Branch: refs/heads/4.0.0-grouping
Commit: ea9f4042e556c266ae2df122fabeb876e55b13a7
Parents: e81038c
Author: Isuru Haththotuwa <[email protected]>
Authored: Tue Sep 16 17:21:55 2014 +0530
Committer: Isuru Haththotuwa <[email protected]>
Committed: Tue Sep 16 17:21:55 2014 +0530

----------------------------------------------------------------------
 .../messaging/domain/topology/Application.java  | 11 ++++++
 .../messaging/domain/topology/Group.java        | 11 ++++++
 .../messaging/domain/topology/Status.java       | 37 ++++++++++++++++++++
 3 files changed, 59 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/ea9f4042/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Application.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Application.java
 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Application.java
index e442996..2d53833 100644
--- 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Application.java
+++ 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Application.java
@@ -38,10 +38,13 @@ public class Application implements SubscribableBehavior {
     private Map<String, Group> groupMap;
     // Cluster Id map, key = service name
     private Map<String, String> clusterIdMap;
+    // Application status
+    private Status status;
 
     public Application (String id) {
         this.id = id;
         this.key = RandomStringUtils.randomAlphanumeric(16);
+        this.status = Status.Created;
         groupMap = new HashMap<String, Group>();
         clusterIdMap = new HashMap<String, String>();
     }
@@ -103,4 +106,12 @@ public class Application implements SubscribableBehavior {
     public String getKey() {
         return key;
     }
+
+    public Status getStatus() {
+        return status;
+    }
+
+    public void setStatus(Status status) {
+        this.status = status;
+    }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/ea9f4042/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Group.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Group.java
 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Group.java
index 16ec775..fd13970 100644
--- 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Group.java
+++ 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Group.java
@@ -40,10 +40,13 @@ public class Group implements SubscribableBehavior {
     private Map<String, Group> groupMap;
     // Cluster id map, key = service name
     private Map<String, String> clusterIdMap;
+    // Group status
+    private Status status;
 
     public Group (String name, String alias) {
         this.name = name;
         this.alias = alias;
+        this.status = Status.Created;
         groupMap = new HashMap<String, Group>();
         clusterIdMap = new HashMap<String, String>();
     }
@@ -138,4 +141,12 @@ public class Group implements SubscribableBehavior {
     public int hashCode () {
         return name.hashCode() + alias.hashCode();
     }
+
+    public Status getStatus() {
+        return status;
+    }
+
+    public void setStatus(Status status) {
+        this.status = status;
+    }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/ea9f4042/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Status.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Status.java
 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Status.java
new file mode 100644
index 0000000..806c113
--- /dev/null
+++ 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Status.java
@@ -0,0 +1,37 @@
+/*
+ * 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.domain.topology;
+
+public enum Status {
+
+    Created(1),
+    In_Maintenance(2),
+    Activated(3);
+
+    private int code;
+
+    private Status(int code) {
+        this.code = code;
+    }
+
+    public int getCode() {
+        return code;
+    }
+}

Reply via email to