You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ma...@apache.org on 2013/12/18 10:15:41 UTC
[1/2] git commit: Refactor CLI component
Updated Branches:
refs/heads/master 2bc47a0d6 -> dc493ccf2
Refactor CLI 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/b8559dd3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/b8559dd3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/b8559dd3
Branch: refs/heads/master
Commit: b8559dd36ddb514cd940794cbf573832e6fa61cf
Parents: 6d65c70
Author: Manula Thantriwatte <ma...@apache.org>
Authored: Wed Dec 18 14:43:21 2013 +0530
Committer: Manula Thantriwatte <ma...@apache.org>
Committed: Wed Dec 18 14:43:21 2013 +0530
----------------------------------------------------------------------
.../org/apache/stratos/cli/AutoscalePolicy.java | 52 -----
.../java/org/apache/stratos/cli/Cartridge.java | 201 -------------------
.../apache/stratos/cli/CartridgeInfoBean.java | 124 ------------
.../apache/stratos/cli/DeploymentPolicy.java | 31 ---
.../java/org/apache/stratos/cli/Partition.java | 76 -------
.../org/apache/stratos/cli/PropertyBean.java | 42 ----
.../stratos/cli/RestCommandLineService.java | 1 +
.../apache/stratos/cli/SubscriptionInfo.java | 44 ----
.../org/apache/stratos/cli/TenantInfoBean.java | 85 --------
.../stratos/cli/beans/AutoscalePolicy.java | 52 +++++
.../org/apache/stratos/cli/beans/Cartridge.java | 201 +++++++++++++++++++
.../stratos/cli/beans/CartridgeInfoBean.java | 124 ++++++++++++
.../stratos/cli/beans/DeploymentPolicy.java | 31 +++
.../org/apache/stratos/cli/beans/Partition.java | 76 +++++++
.../apache/stratos/cli/beans/PropertyBean.java | 42 ++++
.../stratos/cli/beans/SubscriptionInfo.java | 44 ++++
.../stratos/cli/beans/TenantInfoBean.java | 85 ++++++++
17 files changed, 656 insertions(+), 655 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/AutoscalePolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/AutoscalePolicy.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/AutoscalePolicy.java
deleted file mode 100644
index ab76704..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/AutoscalePolicy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 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.cli;
-
-public class AutoscalePolicy {
-
- private String id;
-
- private String displayName;
-
- private String description;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getDisplayName() {
- return displayName;
- }
-
- public void setDisplayName(String displayName) {
- this.displayName = displayName;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/Cartridge.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/Cartridge.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/Cartridge.java
deleted file mode 100644
index 1623fd7..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/Cartridge.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * 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.cli;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class Cartridge implements Comparable<Cartridge> {
-
- private String displayName;
- private String description;
- private String cartridgeAlias;
- private String cartridgeType;
- private int activeInstances;
- private String status;
- private String ip;
- private String password;
- private String provider;
- private String version;
- private boolean multiTenant;
- private String hostName;
- private String policy;
- private String policyDescription;
- private String repoURL;
- private String dbUserName;
- private String mappedDomain;
-
- private String[] accessURLs;
-
- public String getDisplayName() {
- return displayName;
- }
-
- public void setDisplayName(String displayName) {
- this.displayName = displayName;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getCartridgeAlias() {
- return cartridgeAlias;
- }
-
- public void setCartridgeAlias(String cartridgeAlias) {
- this.cartridgeAlias = cartridgeAlias;
- }
-
- public String getCartridgeType() {
- return cartridgeType;
- }
-
- public void setCartridgeType(String cartridgeType) {
- this.cartridgeType = cartridgeType;
- }
-
- public int getActiveInstances() {
- return activeInstances;
- }
-
- public void setActiveInstances(int activeInstances) {
- this.activeInstances = activeInstances;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getIp() {
- return ip;
- }
-
- public void setIp(String ip) {
- this.ip = ip;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getProvider() {
- return provider;
- }
-
- public void setProvider(String provider) {
- this.provider = provider;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public boolean isMultiTenant() {
- return multiTenant;
- }
-
- public void setMultiTenant(boolean multiTenant) {
- this.multiTenant = multiTenant;
- }
-
- public String getHostName() {
- return hostName;
- }
-
- public void setHostName(String hostName) {
- this.hostName = hostName;
- }
-
- public String getPolicy() {
- return policy;
- }
-
- public void setPolicy(String policy) {
- this.policy = policy;
- }
-
- public String getPolicyDescription() {
- return policyDescription;
- }
-
- public void setPolicyDescription(String policyDescription) {
- this.policyDescription = policyDescription;
- }
-
- public String getRepoURL() {
- return repoURL;
- }
-
- public void setRepoURL(String repoURL) {
- this.repoURL = repoURL;
- }
-
- public String getDbUserName() {
- return dbUserName;
- }
-
- public String[] getAccessURLs() {
- return accessURLs;
- }
-
- public void setAccessURLs(String[] accessURLs) {
- this.accessURLs = accessURLs;
- }
-
- public void setDbUserName(String dbUserName) {
- this.dbUserName = dbUserName;
- }
-
- public String getMappedDomain() {
- return mappedDomain;
- }
-
- public void setMappedDomain(String mappedDomain) {
- this.mappedDomain = mappedDomain;
- }
-
- public int compareTo(Cartridge o) {
- int compare = 0;
- if (cartridgeAlias != null && o.cartridgeAlias != null) {
- compare = cartridgeAlias.compareTo(o.cartridgeAlias);
- }
- if (compare == 0 && cartridgeType != null && o.cartridgeType != null) {
- compare = cartridgeType.compareTo(o.cartridgeType);
- }
- return compare;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/CartridgeInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/CartridgeInfoBean.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/CartridgeInfoBean.java
deleted file mode 100644
index 67ca931..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/CartridgeInfoBean.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-* Copyright (c) 2005-2012, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-*
-* WSO2 Inc. 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.cli;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class CartridgeInfoBean {
- String cartridgeType;
- String alias;
- String policy;
- String repoURL;
- boolean privateRepo;
- String repoUsername;
- String repoPassword;
- String dataCartridgeType;
- String dataCartridgeAlias;
- private String autoscalePolicy;
- private String deploymentPolicy;
-
-
- public String getCartridgeType() {
- return cartridgeType;
- }
-
- public void setCartridgeType(String cartridgeType) {
- this.cartridgeType = cartridgeType;
- }
-
- public String getAlias() {
- return alias;
- }
-
- public void setAlias(String alias) {
- this.alias = alias;
- }
-
- public String getPolicy() {
- return policy;
- }
-
- public void setPolicy(String policy) {
- this.policy = policy;
- }
-
- public String getRepoURL() {
- return repoURL;
- }
-
- public void setRepoURL(String repoURL) {
- this.repoURL = repoURL;
- }
-
- public boolean isPrivateRepo() {
- return privateRepo;
- }
-
- public void setPrivateRepo(boolean privateRepo) {
- this.privateRepo = privateRepo;
- }
-
- public String getRepoUsername() {
- return repoUsername;
- }
-
- public void setRepoUsername(String repoUsername) {
- this.repoUsername = repoUsername;
- }
-
- public String getRepoPassword() {
- return repoPassword;
- }
-
- public void setRepoPassword(String repoPassword) {
- this.repoPassword = repoPassword;
- }
-
- public String getDataCartridgeType() {
- return dataCartridgeType;
- }
-
- public void setDataCartridgeType(String dataCartridgeType) {
- this.dataCartridgeType = dataCartridgeType;
- }
-
- public String getDataCartridgeAlias() {
- return dataCartridgeAlias;
- }
-
- public void setDataCartridgeAlias(String dataCartridgeAlias) {
- this.dataCartridgeAlias = dataCartridgeAlias;
- }
-
- public String getAutoscalePolicy() {
- return autoscalePolicy;
- }
-
- public void setAutoscalePolicy(String autoscalePolicy) {
- this.autoscalePolicy = autoscalePolicy;
- }
-
- public String getDeploymentPolicy() {
- return deploymentPolicy;
- }
-
- public void setDeploymentPolicy(String deploymentPolicy) {
- this.deploymentPolicy = deploymentPolicy;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/DeploymentPolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/DeploymentPolicy.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/DeploymentPolicy.java
deleted file mode 100644
index e4d7d1e..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/DeploymentPolicy.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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.cli;
-
-public class DeploymentPolicy {
- private String id;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/Partition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/Partition.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/Partition.java
deleted file mode 100644
index 6c74bb5..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/Partition.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.cli;
-
-import java.util.List;
-
-public class Partition {
-
- private String id;
-
- private int partitionMin;
-
- private int partitionMax;
-
- private String provider;
-
- private List<PropertyBean> property;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public int getPartitionMin() {
- return partitionMin;
- }
-
- public void setPartitionMin(int partitionMin) {
- this.partitionMin = partitionMin;
- }
-
- public int getPartitionMax() {
- return partitionMax;
- }
-
- public void setPartitionMax(int partitionMax) {
- this.partitionMax = partitionMax;
- }
-
- public String getProvider() {
- return provider;
- }
-
- public void setProvider(String provider) {
- this.provider = provider;
- }
-
- public List<PropertyBean> getProperty() {
- return property;
- }
-
- public void setProperty(List<PropertyBean> property) {
- this.property = property;
- }
-}
-
-
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/PropertyBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/PropertyBean.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/PropertyBean.java
deleted file mode 100644
index 8af86f6..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/PropertyBean.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.cli;
-
-public class PropertyBean {
-
- private String name;
-
- private String value;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
index 303e477..20633b2 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
@@ -28,6 +28,7 @@ import org.apache.axis2.transport.http.HttpTransportProperties;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
+import org.apache.stratos.cli.beans.*;
import org.apache.stratos.cli.exception.CommandException;
import org.apache.stratos.cli.utils.CliConstants;
import org.slf4j.Logger;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/SubscriptionInfo.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/SubscriptionInfo.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/SubscriptionInfo.java
deleted file mode 100644
index 384db93..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/SubscriptionInfo.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.cli;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class SubscriptionInfo {
-
- private String hostname;
- private String repositoryURL;
-
- public String getHostname() {
- return hostname;
- }
-
- public void setHostname(String hostname) {
- this.hostname = hostname;
- }
-
- public String getRepositoryURL() {
- return repositoryURL;
- }
-
- public void setRepositoryURL(String repositoryURL) {
- this.repositoryURL = repositoryURL;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/TenantInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/TenantInfoBean.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/TenantInfoBean.java
deleted file mode 100644
index fe73749..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/TenantInfoBean.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * 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.cli;
-
-public class TenantInfoBean {
- private String admin;
- private String firstname;
- private String lastname;
- private String adminPassword;
- private String tenantDomain;
- private String email;
- private String active;
-
- public String getAdmin() {
- return admin;
- }
-
- public void setAdmin(String admin) {
- this.admin = admin;
- }
-
- public String getFirstname() {
- return firstname;
- }
-
- public void setFirstname(String firstname) {
- this.firstname = firstname;
- }
-
- public String getLastname() {
- return lastname;
- }
-
- public void setLastname(String lastname) {
- this.lastname = lastname;
- }
-
- public String getAdminPassword() {
- return adminPassword;
- }
-
- public void setAdminPassword(String adminPassword) {
- this.adminPassword = adminPassword;
- }
-
- public String getTenantDomain() {
- return tenantDomain;
- }
-
- public void setTenantDomain(String tenantDomain) {
- this.tenantDomain = tenantDomain;
- }
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public String getActive() {
- return active;
- }
-
- public void setActive(String active) {
- this.active = active;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/AutoscalePolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/AutoscalePolicy.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/AutoscalePolicy.java
new file mode 100644
index 0000000..f810198
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/AutoscalePolicy.java
@@ -0,0 +1,52 @@
+/**
+ * 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.cli.beans;
+
+public class AutoscalePolicy {
+
+ private String id;
+
+ private String displayName;
+
+ private String description;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/Cartridge.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/Cartridge.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/Cartridge.java
new file mode 100644
index 0000000..49a4651
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/Cartridge.java
@@ -0,0 +1,201 @@
+/*
+ * 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.cli.beans;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Cartridge implements Comparable<Cartridge> {
+
+ private String displayName;
+ private String description;
+ private String cartridgeAlias;
+ private String cartridgeType;
+ private int activeInstances;
+ private String status;
+ private String ip;
+ private String password;
+ private String provider;
+ private String version;
+ private boolean multiTenant;
+ private String hostName;
+ private String policy;
+ private String policyDescription;
+ private String repoURL;
+ private String dbUserName;
+ private String mappedDomain;
+
+ private String[] accessURLs;
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getCartridgeAlias() {
+ return cartridgeAlias;
+ }
+
+ public void setCartridgeAlias(String cartridgeAlias) {
+ this.cartridgeAlias = cartridgeAlias;
+ }
+
+ public String getCartridgeType() {
+ return cartridgeType;
+ }
+
+ public void setCartridgeType(String cartridgeType) {
+ this.cartridgeType = cartridgeType;
+ }
+
+ public int getActiveInstances() {
+ return activeInstances;
+ }
+
+ public void setActiveInstances(int activeInstances) {
+ this.activeInstances = activeInstances;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getIp() {
+ return ip;
+ }
+
+ public void setIp(String ip) {
+ this.ip = ip;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getProvider() {
+ return provider;
+ }
+
+ public void setProvider(String provider) {
+ this.provider = provider;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public boolean isMultiTenant() {
+ return multiTenant;
+ }
+
+ public void setMultiTenant(boolean multiTenant) {
+ this.multiTenant = multiTenant;
+ }
+
+ public String getHostName() {
+ return hostName;
+ }
+
+ public void setHostName(String hostName) {
+ this.hostName = hostName;
+ }
+
+ public String getPolicy() {
+ return policy;
+ }
+
+ public void setPolicy(String policy) {
+ this.policy = policy;
+ }
+
+ public String getPolicyDescription() {
+ return policyDescription;
+ }
+
+ public void setPolicyDescription(String policyDescription) {
+ this.policyDescription = policyDescription;
+ }
+
+ public String getRepoURL() {
+ return repoURL;
+ }
+
+ public void setRepoURL(String repoURL) {
+ this.repoURL = repoURL;
+ }
+
+ public String getDbUserName() {
+ return dbUserName;
+ }
+
+ public String[] getAccessURLs() {
+ return accessURLs;
+ }
+
+ public void setAccessURLs(String[] accessURLs) {
+ this.accessURLs = accessURLs;
+ }
+
+ public void setDbUserName(String dbUserName) {
+ this.dbUserName = dbUserName;
+ }
+
+ public String getMappedDomain() {
+ return mappedDomain;
+ }
+
+ public void setMappedDomain(String mappedDomain) {
+ this.mappedDomain = mappedDomain;
+ }
+
+ public int compareTo(Cartridge o) {
+ int compare = 0;
+ if (cartridgeAlias != null && o.cartridgeAlias != null) {
+ compare = cartridgeAlias.compareTo(o.cartridgeAlias);
+ }
+ if (compare == 0 && cartridgeType != null && o.cartridgeType != null) {
+ compare = cartridgeType.compareTo(o.cartridgeType);
+ }
+ return compare;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/CartridgeInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/CartridgeInfoBean.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/CartridgeInfoBean.java
new file mode 100644
index 0000000..256902f
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/CartridgeInfoBean.java
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2005-2012, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+* WSO2 Inc. 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.cli.beans;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class CartridgeInfoBean {
+ String cartridgeType;
+ String alias;
+ String policy;
+ String repoURL;
+ boolean privateRepo;
+ String repoUsername;
+ String repoPassword;
+ String dataCartridgeType;
+ String dataCartridgeAlias;
+ private String autoscalePolicy;
+ private String deploymentPolicy;
+
+
+ public String getCartridgeType() {
+ return cartridgeType;
+ }
+
+ public void setCartridgeType(String cartridgeType) {
+ this.cartridgeType = cartridgeType;
+ }
+
+ public String getAlias() {
+ return alias;
+ }
+
+ public void setAlias(String alias) {
+ this.alias = alias;
+ }
+
+ public String getPolicy() {
+ return policy;
+ }
+
+ public void setPolicy(String policy) {
+ this.policy = policy;
+ }
+
+ public String getRepoURL() {
+ return repoURL;
+ }
+
+ public void setRepoURL(String repoURL) {
+ this.repoURL = repoURL;
+ }
+
+ public boolean isPrivateRepo() {
+ return privateRepo;
+ }
+
+ public void setPrivateRepo(boolean privateRepo) {
+ this.privateRepo = privateRepo;
+ }
+
+ public String getRepoUsername() {
+ return repoUsername;
+ }
+
+ public void setRepoUsername(String repoUsername) {
+ this.repoUsername = repoUsername;
+ }
+
+ public String getRepoPassword() {
+ return repoPassword;
+ }
+
+ public void setRepoPassword(String repoPassword) {
+ this.repoPassword = repoPassword;
+ }
+
+ public String getDataCartridgeType() {
+ return dataCartridgeType;
+ }
+
+ public void setDataCartridgeType(String dataCartridgeType) {
+ this.dataCartridgeType = dataCartridgeType;
+ }
+
+ public String getDataCartridgeAlias() {
+ return dataCartridgeAlias;
+ }
+
+ public void setDataCartridgeAlias(String dataCartridgeAlias) {
+ this.dataCartridgeAlias = dataCartridgeAlias;
+ }
+
+ public String getAutoscalePolicy() {
+ return autoscalePolicy;
+ }
+
+ public void setAutoscalePolicy(String autoscalePolicy) {
+ this.autoscalePolicy = autoscalePolicy;
+ }
+
+ public String getDeploymentPolicy() {
+ return deploymentPolicy;
+ }
+
+ public void setDeploymentPolicy(String deploymentPolicy) {
+ this.deploymentPolicy = deploymentPolicy;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/DeploymentPolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/DeploymentPolicy.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/DeploymentPolicy.java
new file mode 100644
index 0000000..19974ac
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/DeploymentPolicy.java
@@ -0,0 +1,31 @@
+/**
+ * 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.cli.beans;
+
+public class DeploymentPolicy {
+ private String id;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/Partition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/Partition.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/Partition.java
new file mode 100644
index 0000000..1af9496
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/Partition.java
@@ -0,0 +1,76 @@
+/*
+ * 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.cli.beans;
+
+import java.util.List;
+
+public class Partition {
+
+ private String id;
+
+ private int partitionMin;
+
+ private int partitionMax;
+
+ private String provider;
+
+ private List<PropertyBean> property;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public int getPartitionMin() {
+ return partitionMin;
+ }
+
+ public void setPartitionMin(int partitionMin) {
+ this.partitionMin = partitionMin;
+ }
+
+ public int getPartitionMax() {
+ return partitionMax;
+ }
+
+ public void setPartitionMax(int partitionMax) {
+ this.partitionMax = partitionMax;
+ }
+
+ public String getProvider() {
+ return provider;
+ }
+
+ public void setProvider(String provider) {
+ this.provider = provider;
+ }
+
+ public List<PropertyBean> getProperty() {
+ return property;
+ }
+
+ public void setProperty(List<PropertyBean> property) {
+ this.property = property;
+ }
+}
+
+
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/PropertyBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/PropertyBean.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/PropertyBean.java
new file mode 100644
index 0000000..0efe7f5
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/PropertyBean.java
@@ -0,0 +1,42 @@
+/*
+ * 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.cli.beans;
+
+public class PropertyBean {
+
+ private String name;
+
+ private String value;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/SubscriptionInfo.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/SubscriptionInfo.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/SubscriptionInfo.java
new file mode 100644
index 0000000..d8c200e
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/SubscriptionInfo.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.cli.beans;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class SubscriptionInfo {
+
+ private String hostname;
+ private String repositoryURL;
+
+ public String getHostname() {
+ return hostname;
+ }
+
+ public void setHostname(String hostname) {
+ this.hostname = hostname;
+ }
+
+ public String getRepositoryURL() {
+ return repositoryURL;
+ }
+
+ public void setRepositoryURL(String repositoryURL) {
+ this.repositoryURL = repositoryURL;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b8559dd3/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/TenantInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/TenantInfoBean.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/TenantInfoBean.java
new file mode 100644
index 0000000..683c1d7
--- /dev/null
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/TenantInfoBean.java
@@ -0,0 +1,85 @@
+/**
+ * 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.cli.beans;
+
+public class TenantInfoBean {
+ private String admin;
+ private String firstname;
+ private String lastname;
+ private String adminPassword;
+ private String tenantDomain;
+ private String email;
+ private String active;
+
+ public String getAdmin() {
+ return admin;
+ }
+
+ public void setAdmin(String admin) {
+ this.admin = admin;
+ }
+
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ public String getAdminPassword() {
+ return adminPassword;
+ }
+
+ public void setAdminPassword(String adminPassword) {
+ this.adminPassword = adminPassword;
+ }
+
+ public String getTenantDomain() {
+ return tenantDomain;
+ }
+
+ public void setTenantDomain(String tenantDomain) {
+ this.tenantDomain = tenantDomain;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+}
[2/2] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-stratos
Posted by ma...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/dc493ccf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/dc493ccf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/dc493ccf
Branch: refs/heads/master
Commit: dc493ccf289e8bc9ce97785b94fe94b04596a7e0
Parents: b8559dd 2bc47a0
Author: Manula Thantriwatte <ma...@apache.org>
Authored: Wed Dec 18 14:44:13 2013 +0530
Committer: Manula Thantriwatte <ma...@apache.org>
Committed: Wed Dec 18 14:44:13 2013 +0530
----------------------------------------------------------------------
.../src/conf/cartridge-config.properties | 64 -----
.../manager/CartridgeSubscriptionManager.java | 9 +-
.../service/ApplicationManagementService.java | 35 +--
.../utils/CartridgeSubscriptionUtils.java | 34 +++
.../stratos/autoscaler/AutoscalerContext.java | 8 +
.../stratos/autoscaler/ClusterMonitor.java | 251 -----------------
.../stratos/autoscaler/LbClusterMonitor.java | 226 ----------------
.../health/HealthEventMessageDelegator.java | 25 +-
.../autoscaler/monitor/AbstractMonitor.java | 44 +++
.../autoscaler/monitor/ClusterMonitor.java | 270 +++++++++++++++++++
.../autoscaler/monitor/LbClusterMonitor.java | 245 +++++++++++++++++
.../autoscaler/policy/PolicyManager.java | 2 +-
.../topology/AutoscalerTopologyReceiver.java | 2 +
.../stratos/autoscaler/util/AutoscalerUtil.java | 3 +
.../balancer/LoadBalancerTenantReceiver.java | 37 ++-
.../TopologyFilterConfigurator.java | 9 +
.../internal/LoadBalancerServiceComponent.java | 11 +
.../src/main/conf/cartridge-config.properties | 5 +-
18 files changed, 690 insertions(+), 590 deletions(-)
----------------------------------------------------------------------