You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/10/08 18:53:05 UTC

[11/27] git commit: Introducing container cluster context as it holds the data to be passed to CC container API.

Introducing container cluster context as it holds the data to be passed to CC container API.


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

Branch: refs/heads/container-autoscaling
Commit: 25f0ec66714712416931d23ef4d0453837b305a4
Parents: 5bc3a87
Author: Nirmal Fernando <ni...@gmail.com>
Authored: Tue Oct 7 17:54:24 2014 +0530
Committer: Nirmal Fernando <ni...@gmail.com>
Committed: Wed Oct 8 22:21:29 2014 +0530

----------------------------------------------------------------------
 .../pojo/ContainerClusterContext.java           | 84 ++++++++++++++++++++
 1 file changed, 84 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/25f0ec66/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/ContainerClusterContext.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/ContainerClusterContext.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/ContainerClusterContext.java
new file mode 100644
index 0000000..f6c9b31
--- /dev/null
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/ContainerClusterContext.java
@@ -0,0 +1,84 @@
+/*
+ * 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.cloud.controller.pojo;
+
+import java.io.Serializable;
+
+/**
+ * Holds information about a container cluster to be started.
+ *
+ */
+public class ContainerClusterContext implements Serializable {
+
+    private static final long serialVersionUID = -388327475844701869L;
+    // cluster id this Pod belongs to
+    private String clusterId;
+    // properties
+    private Properties properties;
+    
+    public ContainerClusterContext(String clusterId) {
+        this.clusterId = clusterId;
+    }
+    
+    public String getClusterId() {
+        return clusterId;
+    }
+    public void setClusterId(String clusterId) {
+        this.clusterId = clusterId;
+    }
+    public Properties getProperties() {
+        return properties;
+    }
+
+    public void setProperties(Properties properties) {
+        this.properties = properties;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((clusterId == null) ? 0 : clusterId.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        ContainerClusterContext other = (ContainerClusterContext) obj;
+        if (clusterId == null) {
+            if (other.clusterId != null)
+                return false;
+        } else if (!clusterId.equals(other.clusterId))
+            return false;
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return "ContainerClusterContext [clusterId=" + clusterId + ", properties=" + properties
+                + "]";
+    }
+
+}