You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2014/12/14 06:45:05 UTC
[1/7] stratos git commit: Moving rest api domain model to stratos
common component to be reused by the cli
Repository: stratos
Updated Branches:
refs/heads/4.1.0-test 0b9a0d721 -> df2d6e6ce
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/PojoConverter.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/PojoConverter.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/PojoConverter.java
new file mode 100644
index 0000000..6de5776
--- /dev/null
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/PojoConverter.java
@@ -0,0 +1,1255 @@
+/*
+ * 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.rest.endpoint.util.converter;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.stratos.autoscaler.stub.deployment.partition.ChildLevelNetworkPartition;
+import org.apache.stratos.autoscaler.stub.deployment.partition.ChildLevelPartition;
+import org.apache.stratos.autoscaler.stub.deployment.policy.ChildPolicy;
+import org.apache.stratos.autoscaler.stub.pojo.ApplicationContext;
+import org.apache.stratos.autoscaler.stub.pojo.CartridgeContext;
+import org.apache.stratos.autoscaler.stub.pojo.DependencyContext;
+import org.apache.stratos.autoscaler.stub.pojo.GroupContext;
+import org.apache.stratos.autoscaler.stub.pojo.SubscribableInfoContext;
+import org.apache.stratos.cloud.controller.stub.domain.CartridgeConfig;
+import org.apache.stratos.cloud.controller.stub.domain.Container;
+import org.apache.stratos.cloud.controller.stub.domain.FloatingNetwork;
+import org.apache.stratos.cloud.controller.stub.domain.FloatingNetworks;
+import org.apache.stratos.cloud.controller.stub.domain.IaasConfig;
+import org.apache.stratos.cloud.controller.stub.domain.LoadbalancerConfig;
+import org.apache.stratos.cloud.controller.stub.domain.NetworkInterface;
+import org.apache.stratos.cloud.controller.stub.domain.NetworkInterfaces;
+import org.apache.stratos.cloud.controller.stub.domain.Persistence;
+import org.apache.stratos.cloud.controller.stub.domain.PortMapping;
+import org.apache.stratos.cloud.controller.stub.domain.ServiceGroup;
+import org.apache.stratos.cloud.controller.stub.domain.Volume;
+import org.apache.stratos.common.Properties;
+import org.apache.stratos.common.Property;
+import org.apache.stratos.manager.composite.application.beans.ApplicationDefinition;
+import org.apache.stratos.manager.composite.application.beans.CartridgeDefinition;
+import org.apache.stratos.manager.composite.application.beans.GroupDefinition;
+import org.apache.stratos.manager.composite.application.beans.SubscribableInfo;
+import org.apache.stratos.manager.deploy.service.Service;
+import org.apache.stratos.manager.grouping.definitions.DependencyDefinitions;
+import org.apache.stratos.manager.grouping.definitions.ServiceGroupDefinition;
+import org.apache.stratos.manager.subscription.SubscriptionDomain;
+import org.apache.stratos.messaging.domain.applications.Application;
+import org.apache.stratos.messaging.domain.applications.Group;
+import org.apache.stratos.messaging.domain.instance.ApplicationInstance;
+import org.apache.stratos.messaging.domain.instance.ClusterInstance;
+import org.apache.stratos.messaging.domain.instance.GroupInstance;
+import org.apache.stratos.messaging.domain.topology.Cluster;
+import org.apache.stratos.common.beans.ApplicationBean;
+import org.apache.stratos.common.beans.GroupBean;
+import org.apache.stratos.common.beans.autoscaler.partition.ApplicationLevelNetworkPartition;
+import org.apache.stratos.common.beans.autoscaler.partition.Partition;
+import org.apache.stratos.common.beans.autoscaler.policy.autoscale.AutoscalePolicy;
+import org.apache.stratos.common.beans.autoscaler.policy.autoscale.LoadAverageThresholds;
+import org.apache.stratos.common.beans.autoscaler.policy.autoscale.LoadThresholds;
+import org.apache.stratos.common.beans.autoscaler.policy.autoscale.MemoryConsumptionThresholds;
+import org.apache.stratos.common.beans.autoscaler.policy.autoscale.RequestsInFlightThresholds;
+import org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy;
+import org.apache.stratos.common.beans.cartridge.definition.CartridgeDefinitionBean;
+import org.apache.stratos.common.beans.cartridge.definition.ContainerBean;
+import org.apache.stratos.common.beans.cartridge.definition.FloatingNetworkBean;
+import org.apache.stratos.common.beans.cartridge.definition.IaasProviderBean;
+import org.apache.stratos.common.beans.cartridge.definition.LoadBalancerBean;
+import org.apache.stratos.common.beans.cartridge.definition.NetworkInterfaceBean;
+import org.apache.stratos.common.beans.cartridge.definition.PersistenceBean;
+import org.apache.stratos.common.beans.cartridge.definition.PortMappingBean;
+import org.apache.stratos.common.beans.cartridge.definition.PropertyBean;
+import org.apache.stratos.common.beans.cartridge.definition.ServiceDefinitionBean;
+import org.apache.stratos.common.beans.cartridge.definition.VolumeBean;
+import org.apache.stratos.common.beans.kubernetes.KubernetesGroup;
+import org.apache.stratos.common.beans.kubernetes.KubernetesHost;
+import org.apache.stratos.common.beans.kubernetes.KubernetesMaster;
+import org.apache.stratos.common.beans.kubernetes.PortRange;
+import org.apache.stratos.common.beans.subscription.domain.SubscriptionDomainBean;
+import org.apache.stratos.common.beans.topology.Instance;
+import org.apache.stratos.common.beans.topology.Member;
+
+public class PojoConverter {
+
+ public static CartridgeConfig populateCartridgeConfigPojo(CartridgeDefinitionBean cartridgeDefinitionBean) {
+
+ CartridgeConfig cartridgeConfig = new CartridgeConfig();
+
+ cartridgeConfig.setType(cartridgeDefinitionBean.getType());
+ cartridgeConfig.setHostName(cartridgeDefinitionBean.getHost());
+ cartridgeConfig.setProvider(cartridgeDefinitionBean.getProvider());
+ cartridgeConfig.setCategory(cartridgeDefinitionBean.getCategory());
+ cartridgeConfig.setVersion(cartridgeDefinitionBean.getVersion());
+ cartridgeConfig.setMultiTenant(cartridgeDefinitionBean.isMultiTenant());
+ cartridgeConfig.setIsPublic(cartridgeDefinitionBean.isPublic());
+ cartridgeConfig.setDisplayName(cartridgeDefinitionBean.getDisplayName());
+ cartridgeConfig.setDescription(cartridgeDefinitionBean.getDescription());
+ cartridgeConfig.setDefaultAutoscalingPolicy(cartridgeDefinitionBean.getDefaultAutoscalingPolicy());
+ cartridgeConfig.setDefaultDeploymentPolicy(cartridgeDefinitionBean.getDefaultDeploymentPolicy());
+ cartridgeConfig.setServiceGroup(cartridgeDefinitionBean.getServiceGroup());
+ cartridgeConfig.setDeployerType(cartridgeDefinitionBean.getDeployerType());
+
+
+ //deployment information
+ if (cartridgeDefinitionBean.getDeployment() != null) {
+ cartridgeConfig.setBaseDir(cartridgeDefinitionBean.getDeployment().getBaseDir());
+ if (cartridgeDefinitionBean.getDeployment().getDir() != null && !cartridgeDefinitionBean.getDeployment().getDir().isEmpty()) {
+ cartridgeConfig.setDeploymentDirs(cartridgeDefinitionBean.getDeployment().getDir().
+ toArray(new String[cartridgeDefinitionBean.getDeployment().getDir().size()]));
+ }
+ }
+ //port mapping
+ if (cartridgeDefinitionBean.getPortMapping() != null && !cartridgeDefinitionBean.getPortMapping().isEmpty()) {
+ cartridgeConfig.setPortMappings(getPortMappingsAsArray(cartridgeDefinitionBean.getPortMapping()));
+ }
+
+ //persistance mapping
+ if (cartridgeDefinitionBean.getPersistence() != null) {
+ cartridgeConfig.setPersistence(getPersistence(cartridgeDefinitionBean.getPersistence()));
+ }
+
+ //IaaS
+ if (cartridgeDefinitionBean.getIaasProvider() != null && !cartridgeDefinitionBean.getIaasProvider().isEmpty()) {
+ cartridgeConfig.setIaasConfigs(getIaasConfigsAsArray(cartridgeDefinitionBean.getIaasProvider()));
+ }
+ //Properties
+ if (cartridgeDefinitionBean.getProperty() != null && !cartridgeDefinitionBean.getProperty().isEmpty()) {
+ cartridgeConfig.setProperties(getCCProperties(cartridgeDefinitionBean.getProperty()));
+ }
+
+ if (cartridgeDefinitionBean.getExportingProperties() != null) {
+ cartridgeConfig.setExportingProperties(cartridgeDefinitionBean.getExportingProperties());
+ }
+
+ if (cartridgeDefinitionBean.getContainer() != null) {
+ cartridgeConfig.setContainer(getContainer(cartridgeDefinitionBean.getContainer()));
+ }
+
+ return cartridgeConfig;
+ }
+
+ public static ServiceGroup populateServiceGroupPojo(ServiceGroupDefinition serviceGroupDefinition) {
+ ServiceGroup servicegroup = new ServiceGroup();
+
+ return servicegroup;
+ }
+
+ private static Container getContainer(ContainerBean container) {
+ Container cn = new Container();
+ cn.setDockerFileRepo(container.getDockerfileRepo());
+ cn.setImageName(container.getImageName());
+ //cn.setProperties(getProperties(container.property));
+ return cn;
+ }
+
+ private static LoadbalancerConfig getLBConfig(LoadBalancerBean loadBalancer) {
+ LoadbalancerConfig lbConfig = new LoadbalancerConfig();
+ lbConfig.setType(loadBalancer.getType());
+ if (loadBalancer.getProperty() != null && !loadBalancer.getProperty().isEmpty()) {
+ lbConfig.setProperties(getCCProperties(loadBalancer.getProperty()));
+ }
+ return lbConfig;
+ }
+
+ private static PortMapping[] getPortMappingsAsArray(List<PortMappingBean> portMappingBeans) {
+
+ //convert to an array
+ PortMappingBean[] portMappingBeanArray = new PortMappingBean[portMappingBeans.size()];
+ portMappingBeans.toArray(portMappingBeanArray);
+ PortMapping[] portMappingArray = new PortMapping[portMappingBeanArray.length];
+
+ for (int i = 0; i < portMappingBeanArray.length; i++) {
+ PortMapping portMapping = new PortMapping();
+ portMapping.setProtocol(portMappingBeanArray[i].getProtocol());
+ portMapping.setPort(Integer.toString(portMappingBeanArray[i].getPort()));
+ portMapping.setProxyPort(Integer.toString(portMappingBeanArray[i].getProxyPort()));
+ portMappingArray[i] = portMapping;
+ }
+
+ return portMappingArray;
+ }
+
+ private static IaasConfig[] getIaasConfigsAsArray(List<IaasProviderBean> iaasProviderBeans) {
+
+ //convert to an array
+ IaasProviderBean[] iaasProviderBeansArray = new IaasProviderBean[iaasProviderBeans.size()];
+ iaasProviderBeans.toArray(iaasProviderBeansArray);
+ IaasConfig[] iaasConfigsArray = new IaasConfig[iaasProviderBeansArray.length];
+
+ for (int i = 0; i < iaasProviderBeansArray.length; i++) {
+ IaasConfig iaasConfig = new IaasConfig();
+ iaasConfig.setType(iaasProviderBeansArray[i].getType());
+ iaasConfig.setImageId(iaasProviderBeansArray[i].getImageId());
+ iaasConfig.setMaxInstanceLimit(iaasProviderBeansArray[i].getMaxInstanceLimit());
+ iaasConfig.setName(iaasProviderBeansArray[i].getName());
+ iaasConfig.setClassName(iaasProviderBeansArray[i].getClassName());
+ iaasConfig.setCredential(iaasProviderBeansArray[i].getCredential());
+ iaasConfig.setIdentity(iaasProviderBeansArray[i].getIdentity());
+ iaasConfig.setProvider(iaasProviderBeansArray[i].getProvider());
+
+ if (iaasProviderBeansArray[i].getProperty() != null && !iaasProviderBeansArray[i].getProperty().isEmpty()) {
+ //set the Properties instance to IaasConfig instance
+ iaasConfig.setProperties(getCCProperties(iaasProviderBeansArray[i].getProperty()));
+ }
+
+ if (iaasProviderBeansArray[i].getNetworkInterfaces() != null && !iaasProviderBeansArray[i].getNetworkInterfaces().isEmpty()) {
+ iaasConfig.setNetworkInterfaces(PojoConverter.getNetworkInterfaces(iaasProviderBeansArray[i].getNetworkInterfaces()));
+ }
+
+ iaasConfigsArray[i] = iaasConfig;
+ }
+ return iaasConfigsArray;
+ }
+
+ public static Persistence getPersistence(PersistenceBean persistenceBean) {
+ Persistence persistence = new Persistence();
+ persistence.setPersistanceRequired(persistenceBean.isRequired());
+ VolumeBean[] volumeBean = new VolumeBean[persistenceBean.getVolume().size()];
+ persistenceBean.getVolume().toArray(volumeBean);
+ Volume[] volumes = new Volume[persistenceBean.getVolume().size()];
+ for (int i = 0; i < volumes.length; i++) {
+ Volume volume = new Volume();
+ volume.setId(volumeBean[i].getId());
+ volume.setVolumeId(volumeBean[i].getVolumeId());
+ if (StringUtils.isEmpty(volume.getVolumeId())) {
+ volume.setSize(Integer.parseInt(volumeBean[i].getSize()));
+ }
+
+ volume.setDevice(volumeBean[i].getDevice());
+ volume.setRemoveOntermination(volumeBean[i].isRemoveOnTermination());
+ volume.setMappingPath(volumeBean[i].getMappingPath());
+ volume.setSnapshotId(volumeBean[i].getSnapshotId());
+
+ volumes[i] = volume;
+ }
+ persistence.setVolumes(volumes);
+ return persistence;
+
+ }
+
+ public static Properties getProperties(List<PropertyBean> propertyBeans) {
+
+ //convert to an array
+ PropertyBean[] propertyBeansArray = new PropertyBean[propertyBeans.size()];
+ propertyBeans.toArray(propertyBeansArray);
+ Property[] propertyArray = new Property[propertyBeansArray.length];
+
+ for (int j = 0; j < propertyBeansArray.length; j++) {
+ Property property = new Property();
+ property.setName(propertyBeansArray[j].getName());
+ property.setValue(propertyBeansArray[j].getValue());
+ propertyArray[j] = property;
+ }
+
+ Properties properties = new Properties();
+ properties.setProperties(propertyArray);
+ return properties;
+ }
+
+ public static org.apache.stratos.cloud.controller.stub.Properties getCCProperties(List<PropertyBean> propertyBeans) {
+
+ //convert to an array
+ PropertyBean[] propertyBeansArray = new PropertyBean[propertyBeans.size()];
+ propertyBeans.toArray(propertyBeansArray);
+ org.apache.stratos.cloud.controller.stub.Property[] propertyArray = new org.apache.stratos.cloud.controller.stub.Property[propertyBeansArray.length];
+
+ for (int j = 0; j < propertyBeansArray.length; j++) {
+ org.apache.stratos.cloud.controller.stub.Property property = new org.apache.stratos.cloud.controller.stub.Property();
+ property.setName(propertyBeansArray[j].getName());
+ property.setValue(propertyBeansArray[j].getValue());
+ propertyArray[j] = property;
+ }
+
+ org.apache.stratos.cloud.controller.stub.Properties properties = new org.apache.stratos.cloud.controller.stub.Properties();
+ properties.setProperties(propertyArray);
+ return properties;
+ }
+
+
+ public static org.apache.stratos.autoscaler.stub.Properties getASProperties(List<PropertyBean> propertyBeans) {
+ if (propertyBeans == null || propertyBeans.isEmpty()) {
+ return null;
+ }
+
+ //convert to an array
+ PropertyBean[] propertyBeansArray = new PropertyBean[propertyBeans.size()];
+ propertyBeans.toArray(propertyBeansArray);
+ org.apache.stratos.autoscaler.stub.Property[] propertyArray = new org.apache.stratos.autoscaler.stub.Property[propertyBeansArray.length];
+
+ for (int j = 0; j < propertyBeansArray.length; j++) {
+ org.apache.stratos.autoscaler.stub.Property property = new org.apache.stratos.autoscaler.stub.Property();
+ property.setName(propertyBeansArray[j].getName());
+ property.setValue(propertyBeansArray[j].getValue());
+ propertyArray[j] = property;
+ }
+
+ org.apache.stratos.autoscaler.stub.Properties properties = new org.apache.stratos.autoscaler.stub.Properties();
+ properties.setProperties(propertyArray);
+ return properties;
+ }
+
+ private static NetworkInterfaces getNetworkInterfaces(List<NetworkInterfaceBean> networkInterfaceBeans) {
+ NetworkInterface[] networkInterfacesArray = new NetworkInterface[networkInterfaceBeans.size()];
+
+ int i = 0;
+ for (NetworkInterfaceBean nib : networkInterfaceBeans) {
+ NetworkInterface networkInterface = new NetworkInterface();
+ networkInterface.setNetworkUuid(nib.getNetworkUuid());
+ networkInterface.setFixedIp(nib.getFixedIp());
+ networkInterface.setPortUuid(nib.getPortUuid());
+ if (nib.getFloatingNetworks() != null && !nib.getFloatingNetworks().isEmpty()) {
+ networkInterface.setFloatingNetworks(PojoConverter.getFloatingNetworks(nib.getFloatingNetworks()));
+ }
+
+ networkInterfacesArray[i++] = networkInterface;
+ }
+
+ NetworkInterfaces networkInterfaces = new NetworkInterfaces();
+ networkInterfaces.setNetworkInterfaces(networkInterfacesArray);
+ return networkInterfaces;
+ }
+
+ private static FloatingNetworks getFloatingNetworks(List<FloatingNetworkBean> floatingNetworkBeans) {
+
+ FloatingNetwork[] floatingNetworksArray = new FloatingNetwork[floatingNetworkBeans.size()];
+
+ int i =0;
+ for (FloatingNetworkBean floatingNetworkBean : floatingNetworkBeans) {
+ FloatingNetwork floatingNetwork = new FloatingNetwork();
+ floatingNetwork.setName(floatingNetworkBean.getName());
+ floatingNetwork.setNetworkUuid(floatingNetworkBean.getNetworkUuid());
+ floatingNetwork.setFloatingIP(floatingNetworkBean.getFloatingIP());
+ floatingNetworksArray[i++] = floatingNetwork;
+ }
+
+ FloatingNetworks floatingNetworks = new FloatingNetworks();
+ floatingNetworks.setFloatingNetworks(floatingNetworksArray);
+ return floatingNetworks;
+ }
+
+ public static org.apache.stratos.autoscaler.stub.deployment.partition.Partition convertToCCPartitionPojo
+ (Partition partitionBean) {
+
+ org.apache.stratos.autoscaler.stub.deployment.partition.Partition partition = new
+ org.apache.stratos.autoscaler.stub.deployment.partition.Partition();
+
+ partition.setId(partitionBean.getId());
+ partition.setDescription(partitionBean.getDescription());
+ partition.setIsPublic(partitionBean.isPublic());
+ partition.setProvider(partitionBean.getProvider());
+
+ if (partitionBean.getProperty() != null && !partitionBean.getProperty().isEmpty()) {
+ partition.setProperties(getASProperties(partitionBean.getProperty()));
+ }
+
+ return partition;
+ }
+
+ public static org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy convertToCCAutoscalerPojo(AutoscalePolicy
+ autoscalePolicyBean) {
+
+ org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy autoscalePolicy = new
+ org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy();
+
+ autoscalePolicy.setId(autoscalePolicyBean.getId());
+ autoscalePolicy.setDescription(autoscalePolicyBean.getDescription());
+ autoscalePolicy.setIsPublic(autoscalePolicyBean.getIsPublic());
+ autoscalePolicy.setDisplayName(autoscalePolicyBean.getDisplayName());
+ autoscalePolicy.setInstanceRoundingFactor(autoscalePolicyBean.getInstanceRoundingFactor());
+
+ if (autoscalePolicyBean.getLoadThresholds() != null) {
+
+ org.apache.stratos.autoscaler.stub.autoscale.policy.LoadThresholds loadThresholds = new
+ org.apache.stratos.autoscaler.stub.autoscale.policy.LoadThresholds();
+
+ if (autoscalePolicyBean.getLoadThresholds().getLoadAverage() != null) {
+
+ //set load average information
+ org.apache.stratos.autoscaler.stub.autoscale.policy.LoadAverageThresholds loadAverage = new
+ org.apache.stratos.autoscaler.stub.autoscale.policy.LoadAverageThresholds();
+ loadAverage.setUpperLimit(autoscalePolicyBean.getLoadThresholds().getLoadAverage().getThreshold());
+ loadAverage.setLowerLimit(autoscalePolicyBean.getLoadThresholds().getLoadAverage().getLowerLimit());
+ //set load average
+ loadThresholds.setLoadAverage(loadAverage);
+ }
+ if (autoscalePolicyBean.getLoadThresholds().getRequestsInFlight() != null) {
+
+ org.apache.stratos.autoscaler.stub.autoscale.policy.RequestsInFlightThresholds requestsInFlight = new
+ org.apache.stratos.autoscaler.stub.autoscale.policy.RequestsInFlightThresholds();
+ //set request in flight information
+ requestsInFlight.setUpperLimit(autoscalePolicyBean.getLoadThresholds().getRequestsInFlight().getThreshold());
+ requestsInFlight.setLowerLimit(autoscalePolicyBean.getLoadThresholds().getRequestsInFlight().getLowerLimit());
+ //set request in flight
+ loadThresholds.setRequestsInFlight(requestsInFlight);
+ }
+ if (autoscalePolicyBean.getLoadThresholds().getMemoryConsumption() != null) {
+
+ org.apache.stratos.autoscaler.stub.autoscale.policy.MemoryConsumptionThresholds memoryConsumption = new
+ org.apache.stratos.autoscaler.stub.autoscale.policy.MemoryConsumptionThresholds();
+
+ //set memory consumption information
+ memoryConsumption.setUpperLimit(autoscalePolicyBean.getLoadThresholds().getMemoryConsumption().getThreshold());
+ memoryConsumption.setLowerLimit(autoscalePolicyBean.getLoadThresholds().getMemoryConsumption().getLowerLimit());
+ //set memory consumption
+ loadThresholds.setMemoryConsumption(memoryConsumption);
+ }
+
+ autoscalePolicy.setLoadThresholds(loadThresholds);
+ }
+
+ return autoscalePolicy;
+ }
+
+ public static org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy convetToASDeploymentPolicyPojo(
+ DeploymentPolicy deploymentPolicyBean) {
+
+ org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy deploymentPolicy =
+ new org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy();
+
+ deploymentPolicy.setId(deploymentPolicyBean.getId());
+ deploymentPolicy.setDescription(deploymentPolicyBean.getDescription());
+ deploymentPolicy.setIsPublic(deploymentPolicyBean.isPublic());
+ if (deploymentPolicyBean.getApplicationPolicy() != null
+ && deploymentPolicyBean.getApplicationPolicy().getNetworkPartition() != null
+ && !deploymentPolicyBean.getApplicationPolicy().getNetworkPartition().isEmpty()) {
+ deploymentPolicy
+ .setApplicationLevelNetworkPartitions(convertToCCPartitionGroup(deploymentPolicyBean.getApplicationPolicy().getNetworkPartition()));
+ deploymentPolicy.setApplicationId(deploymentPolicyBean.getApplicationPolicy().getApplicationId());
+ }
+
+ if (deploymentPolicyBean.getChildPolicies() != null && !deploymentPolicyBean.getChildPolicies().isEmpty()) {
+ deploymentPolicy.setChildPolicies(convertToCCChildPolicy(deploymentPolicyBean.getChildPolicies()));
+ }
+
+ return deploymentPolicy;
+ }
+
+ private static org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition[] convertToCCPartitionGroup(List<ApplicationLevelNetworkPartition> networkPartitionBeans) {
+
+ org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition[]
+ appNWPartitions = new
+ org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition
+ [networkPartitionBeans.size()];
+
+ for (int i = 0; i < networkPartitionBeans.size(); i++) {
+ org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition appNWPartition = new
+ org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition();
+ appNWPartition.setId(networkPartitionBeans.get(i).getId());
+ appNWPartition.setActiveByDefault(networkPartitionBeans.get(i).isActiveByDefault());
+ if (networkPartitionBeans.get(i).getPartitions() != null && !networkPartitionBeans.get(i).getPartitions().isEmpty()) {
+ appNWPartition.setPartitions(convertToCCPartitionPojos(networkPartitionBeans.get(i).getPartitions()));
+ }
+
+ appNWPartitions[i] = appNWPartition;
+ }
+
+ return appNWPartitions;
+ }
+
+ private static ChildPolicy[] convertToCCChildPolicy(List<org.apache.stratos.common.beans.autoscaler.policy.deployment.ChildPolicy> childPolicies) {
+
+ ChildPolicy[] childPolicies1 = new ChildPolicy[childPolicies.size()];
+
+ for (int i = 0; i < childPolicies.size(); i++) {
+ ChildPolicy childPolicy = new ChildPolicy();
+ childPolicy.setId(childPolicies.get(i).getChildId());
+ childPolicy.setChildLevelNetworkPartitions(convertToCCChildNetworkPartition(childPolicies.get(i).getNetworkPartition()));
+
+
+ childPolicies1[i] = childPolicy;
+ }
+
+ return childPolicies1;
+ }
+
+ private static ChildLevelNetworkPartition[] convertToCCChildNetworkPartition(List<org.apache.stratos.common.beans.autoscaler.partition.ChildLevelNetworkPartition> networkPartitions) {
+
+ ChildLevelNetworkPartition[] childLevelNetworkPartitions = new ChildLevelNetworkPartition[networkPartitions.size()];
+
+ for (int i = 0; i < networkPartitions.size(); i++) {
+ ChildLevelNetworkPartition childLevelNetworkPartition = new ChildLevelNetworkPartition();
+ childLevelNetworkPartition.setId(networkPartitions.get(i).getId());
+ childLevelNetworkPartition.setPartitionAlgo(networkPartitions.get(i).getPartitionAlgo());
+ childLevelNetworkPartition.setChildLevelPartitions(convertToCCChildPartitionPojos(networkPartitions.get(i).getPartitions()));
+
+ childLevelNetworkPartitions[i] = childLevelNetworkPartition;
+ }
+
+ return childLevelNetworkPartitions;
+ }
+
+ public static org.apache.stratos.common.beans.topology.Cluster populateClusterPojos(Cluster cluster, String alias) {
+ org.apache.stratos.common.beans.topology.Cluster cluster1 = new
+ org.apache.stratos.common.beans.topology.Cluster();
+ cluster1.setAlias(alias);
+ cluster1.setServiceName(cluster.getServiceName());
+ cluster1.setClusterId(cluster.getClusterId());
+ cluster1.setLbCluster(cluster.isLbCluster());
+ cluster1.setTenantRange(cluster.getTenantRange());
+ cluster1.setProperty(getPropertyBeans(cluster.getProperties()));
+ cluster1.setMember(new ArrayList<Member>());
+ cluster1.setHostNames(new ArrayList<String>());
+ Collection<ClusterInstance> clusterInstances = cluster.getClusterInstances();
+ List<org.apache.stratos.common.beans.topology.Instance> instancesList =
+ new ArrayList<org.apache.stratos.common.beans.topology.Instance>();
+ if (clusterInstances != null) {
+ for (ClusterInstance clusterInstance : clusterInstances) {
+ org.apache.stratos.common.beans.topology.Instance instance =
+ new org.apache.stratos.common.beans.topology.Instance();
+ instance.setInstanceId(clusterInstance.getInstanceId());
+ instance.setStatus(clusterInstance.getStatus().toString());
+ instancesList.add(instance);
+ }
+ cluster1.setInstances(instancesList);
+ }
+
+ for (org.apache.stratos.messaging.domain.topology.Member tmp : cluster.getMembers()) {
+ Member member = new Member();
+ member.setClusterId(tmp.getClusterId());
+ member.setLbClusterId(tmp.getLbClusterId());
+ member.setNetworkPartitionId(tmp.getNetworkPartitionId());
+ member.setPartitionId(tmp.getPartitionId());
+ member.setMemberId(tmp.getMemberId());
+ if (tmp.getMemberIp() == null) {
+ member.setMemberIp("NULL");
+ } else {
+ member.setMemberIp(tmp.getMemberIp());
+ }
+ if (tmp.getMemberPublicIp() == null) {
+ member.setMemberPublicIp("NULL");
+ } else {
+ member.setMemberPublicIp(tmp.getMemberPublicIp());
+ }
+ member.setServiceName(tmp.getServiceName());
+ member.setStatus(tmp.getStatus().toString());
+ member.setProperty(getPropertyBeans(tmp.getProperties()));
+ cluster1.getMember().add(member);
+ }
+
+ for (String tmp1 : cluster.getHostNames()) {
+ cluster1.getHostNames().add(tmp1);
+ }
+
+ return cluster1;
+ }
+
+ private static org.apache.stratos.autoscaler.stub.deployment.partition.Partition[] convertToCCPartitionPojos
+ (List<Partition> partitionList) {
+
+ org.apache.stratos.autoscaler.stub.deployment.partition.Partition[] partitions =
+ new org.apache.stratos.autoscaler.stub.deployment.partition.Partition[partitionList.size()];
+ for (int i = 0; i < partitionList.size(); i++) {
+ partitions[i] = convertToCCPartitionPojo(partitionList.get(i));
+ }
+
+ return partitions;
+ }
+
+ private static ChildLevelPartition[] convertToCCChildPartitionPojos
+ (List<org.apache.stratos.common.beans.autoscaler.partition.ChildLevelPartition> partitionList) {
+
+ ChildLevelPartition[] childLevelPartitions = new ChildLevelPartition[partitionList.size()];
+ for (int i = 0; i < partitionList.size(); i++) {
+ ChildLevelPartition childLevelPartition = new ChildLevelPartition();
+ childLevelPartition.setPartitionId(partitionList.get(i).getId());
+ childLevelPartition.setMax(partitionList.get(i).getMax());
+
+ childLevelPartitions[i] = childLevelPartition;
+ }
+
+ return childLevelPartitions;
+ }
+
+ public static Partition[] populatePartitionPojos(org.apache.stratos.cloud.controller.stub.domain.Partition[]
+ partitions) {
+
+ Partition[] partitionBeans;
+ if (partitions == null) {
+ partitionBeans = new Partition[0];
+ return partitionBeans;
+ }
+
+ partitionBeans = new Partition[partitions.length];
+ for (int i = 0; i < partitions.length; i++) {
+ partitionBeans[i] = populatePartitionPojo(partitions[i]);
+ }
+ return partitionBeans;
+ }
+
+ public static Partition populatePartitionPojo(org.apache.stratos.cloud.controller.stub.domain.Partition
+ partition) {
+
+ Partition partitionBeans = new Partition();
+ if (partition == null) {
+ return partitionBeans;
+ }
+
+ partitionBeans.setId(partition.getId());
+ partitionBeans.setDescription(partition.getDescription());
+ partitionBeans.setPublic(partition.getIsPublic());
+ partitionBeans.setProvider(partition.getProvider());
+ /*partitionBeans.partitionMin = partition.getPartitionMin();
+ partitionBeans.partitionMax = partition.getPartitionMax();*/
+ //properties
+ if (partition.getProperties() != null) {
+ List<PropertyBean> propertyBeans = getPropertyBeans(partition.getProperties());
+ partitionBeans.setProperty(propertyBeans);
+ }
+
+ return partitionBeans;
+ }
+
+ public static List<SubscriptionDomainBean> populateSubscriptionDomainPojos(List<SubscriptionDomain> subscriptionDomains) {
+
+ List<SubscriptionDomainBean> subscriptionDomainBeans = new ArrayList<SubscriptionDomainBean>();
+
+ if (subscriptionDomains == null) {
+ return subscriptionDomainBeans;
+ }
+
+ for (SubscriptionDomain subscriptionDomain : subscriptionDomains) {
+ subscriptionDomainBeans.add(populateSubscriptionDomainPojo(subscriptionDomain));
+ }
+
+ return subscriptionDomainBeans;
+ }
+
+ public static SubscriptionDomainBean populateSubscriptionDomainPojo(SubscriptionDomain subscriptionDomain) {
+
+ SubscriptionDomainBean subscriptionDomainBean = new SubscriptionDomainBean();
+
+ if (subscriptionDomain == null) {
+ return subscriptionDomainBean;
+ }
+ subscriptionDomainBean.setDomainName(subscriptionDomain.getDomainName());
+ subscriptionDomainBean.setApplicationContext(subscriptionDomain.getApplicationContext());
+
+ return subscriptionDomainBean;
+ }
+
+ private static List<PropertyBean> getPropertyBeans(Properties properties) {
+
+ List<PropertyBean> propertyBeans = null;
+ if (properties.getProperties() != null && properties.getProperties().length != 0) {
+ Property[] propertyArr = properties.getProperties();
+ propertyBeans = new ArrayList<PropertyBean>();
+ for (int i = 0; i < propertyArr.length; i++) {
+ PropertyBean propertyBean = new PropertyBean();
+ propertyBean.setName(propertyArr[i].getName());
+ propertyBean.setValue(propertyArr[i].getValue());
+ propertyBeans.add(propertyBean);
+ }
+ }
+ return propertyBeans;
+ }
+
+ private static List<PropertyBean> getPropertyBeans(org.apache.stratos.cloud.controller.stub.Properties properties) {
+
+ List<PropertyBean> propertyBeans = null;
+ if (properties.getProperties() != null && properties.getProperties().length != 0) {
+ org.apache.stratos.cloud.controller.stub.Property[] propertyArr = properties.getProperties();
+ propertyBeans = new ArrayList<PropertyBean>();
+ for (int i = 0; i < propertyArr.length; i++) {
+ PropertyBean propertyBean = new PropertyBean();
+ propertyBean.setName(propertyArr[i].getName());
+ propertyBean.setValue(propertyArr[i].getValue());
+ propertyBeans.add(propertyBean);
+ }
+ }
+ return propertyBeans;
+ }
+
+ private static List<PropertyBean> getPropertyBeans(java.util.Properties properties) {
+
+ List<PropertyBean> propertyBeans = null;
+ if (properties != null && !properties.isEmpty()) {
+ Enumeration<?> e = properties.propertyNames();
+ propertyBeans = new ArrayList<PropertyBean>();
+
+ while (e.hasMoreElements()) {
+ String key = (String) e.nextElement();
+ String value = properties.getProperty(key);
+ PropertyBean propertyBean = new PropertyBean();
+ propertyBean.setName(key);
+ propertyBean.setValue(value);
+ propertyBeans.add(propertyBean);
+ }
+ }
+ return propertyBeans;
+ }
+
+ public static AutoscalePolicy[] populateAutoscalePojos(org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy[]
+ autoscalePolicies) {
+
+ AutoscalePolicy[] autoscalePolicyBeans;
+ if (autoscalePolicies == null) {
+ autoscalePolicyBeans = new AutoscalePolicy[0];
+ return autoscalePolicyBeans;
+ }
+
+ autoscalePolicyBeans = new AutoscalePolicy[autoscalePolicies.length];
+ for (int i = 0; i < autoscalePolicies.length; i++) {
+ autoscalePolicyBeans[i] = populateAutoscalePojo(autoscalePolicies[i]);
+ }
+ return autoscalePolicyBeans;
+ }
+
+ public static AutoscalePolicy populateAutoscalePojo(org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy
+ autoscalePolicy) {
+ if (autoscalePolicy == null) {
+ return null;
+ }
+
+ AutoscalePolicy autoscalePolicyBean = new AutoscalePolicy();
+ autoscalePolicyBean.setId(autoscalePolicy.getId());
+ autoscalePolicyBean.setDescription(autoscalePolicy.getDescription());
+ autoscalePolicyBean.setIsPublic(autoscalePolicy.getIsPublic());
+ autoscalePolicyBean.setDisplayName(autoscalePolicy.getDisplayName());
+ autoscalePolicyBean.setDescription(autoscalePolicy.getDescription());
+ autoscalePolicyBean.setInstanceRoundingFactor(autoscalePolicy.getInstanceRoundingFactor());
+ if (autoscalePolicy.getLoadThresholds() != null) {
+ autoscalePolicyBean.setLoadThresholds(populateLoadThresholds(autoscalePolicy.getLoadThresholds()));
+ }
+
+ return autoscalePolicyBean;
+ }
+
+ private static LoadThresholds populateLoadThresholds(org.apache.stratos.autoscaler.stub.autoscale.policy.LoadThresholds
+ loadThresholds) {
+
+ LoadThresholds loadThresholdBean = new LoadThresholds();
+ if (loadThresholds.getLoadAverage() != null) {
+ LoadAverageThresholds loadAverage = new LoadAverageThresholds();
+ loadAverage.setThreshold(loadThresholds.getLoadAverage().getUpperLimit());
+ loadAverage.setLowerLimit(loadThresholds.getLoadAverage().getLowerLimit());
+ loadThresholdBean.setLoadAverage(loadAverage);
+ }
+ if (loadThresholds.getMemoryConsumption() != null) {
+ MemoryConsumptionThresholds memoryConsumption = new MemoryConsumptionThresholds();
+ memoryConsumption.setThreshold(loadThresholds.getMemoryConsumption().getUpperLimit());
+ memoryConsumption.setLowerLimit(loadThresholds.getMemoryConsumption().getLowerLimit());
+ loadThresholdBean.setMemoryConsumption(memoryConsumption);
+ }
+ if (loadThresholds.getRequestsInFlight() != null) {
+ RequestsInFlightThresholds requestsInFlight = new RequestsInFlightThresholds();
+ requestsInFlight.setThreshold(loadThresholds.getRequestsInFlight().getUpperLimit());
+ requestsInFlight.setLowerLimit(loadThresholds.getRequestsInFlight().getLowerLimit());
+ loadThresholdBean.setRequestsInFlight(requestsInFlight);
+ }
+
+ return loadThresholdBean;
+ }
+
+ public static DeploymentPolicy[] populateDeploymentPolicyPojos(org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy[]
+ deploymentPolicies) {
+ DeploymentPolicy[] deploymentPolicyBeans;
+ if (deploymentPolicies == null) {
+ return null;
+ }
+
+ deploymentPolicyBeans = new DeploymentPolicy[deploymentPolicies.length];
+ for (int i = 0; i < deploymentPolicies.length; i++) {
+ deploymentPolicyBeans[i] = populateDeploymentPolicyPojo(deploymentPolicies[i]);
+ }
+
+ return deploymentPolicyBeans;
+ }
+
+ public static DeploymentPolicy populateDeploymentPolicyPojo(org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy
+ deploymentPolicy) {
+
+ DeploymentPolicy deploymentPolicyBean = new DeploymentPolicy();
+ if (deploymentPolicy == null) {
+ return deploymentPolicyBean;
+ }
+
+ deploymentPolicyBean.setDescription(deploymentPolicy.getDescription());
+ deploymentPolicyBean.setPublic(deploymentPolicy.getIsPublic());
+//TODO populate the Network partition based on new policy structure
+// if (deploymentPolicy.getApplicationLevelNetworkPartition() != null && deploymentPolicy.getApplicationLevelNetworkPartition().length > 0) {
+// deploymentPolicyBean.setPartitionGroup(Arrays.asList(populatePartitionGroupPojos(deploymentPolicy.getApplicationLevelNetworkPartition())));
+// }
+
+ /*if (deploymentPolicy.getAllPartitions() != null && deploymentPolicy.getAllPartitions().length > 0) {
+ deploymentPolicyBean.partition = Arrays.asList(populatePartitionPojos(deploymentPolicy.getAllPartitions()));
+ }*/
+
+ return deploymentPolicyBean;
+ }
+
+ public static ApplicationLevelNetworkPartition populatePartitionGroupPojo(org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition
+ partitionGroup) {
+
+ ApplicationLevelNetworkPartition networkPartitionBean = new ApplicationLevelNetworkPartition();
+ if (partitionGroup == null) {
+ return networkPartitionBean;
+ }
+
+ networkPartitionBean.setId(partitionGroup.getId());
+ //FIXME update with new deployment policy pattern
+// networkPartitionBean.partitionAlgo = partitionGroup.getPartitionAlgo();
+// if (partitionGroup.getPartitions() != null && partitionGroup.getPartitions().length > 0) {
+// partitionGroupBean.partition = getPartitionList(partitionGroup.getPartitions());
+// }
+
+ return networkPartitionBean;
+ }
+
+ public static ApplicationLevelNetworkPartition[] populatePartitionGroupPojos(org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition[] partitionGroups) {
+
+ ApplicationLevelNetworkPartition[] networkPartitionGroupsBeans;
+ if (partitionGroups == null) {
+ networkPartitionGroupsBeans = new ApplicationLevelNetworkPartition[0];
+ return networkPartitionGroupsBeans;
+ }
+
+ networkPartitionGroupsBeans = new ApplicationLevelNetworkPartition[partitionGroups.length];
+
+ for (int i = 0; i < partitionGroups.length; i++) {
+ networkPartitionGroupsBeans[i] = populatePartitionGroupPojo(partitionGroups[i]);
+ }
+
+ return networkPartitionGroupsBeans;
+ }
+
+ private static List<Partition> getPartitionList(org.apache.stratos.cloud.controller.stub.domain.Partition[]
+ partitions) {
+
+ List<Partition> partitionList = new ArrayList<Partition>();
+ for (int i = 0; i < partitions.length; i++) {
+ Partition partition = new Partition();
+ partition.setId(partitions[i].getId());
+ partition.setProvider(partitions[i].getProvider());
+ /*partition.partitionMin = partitions[i].getPartitionMin();
+ partition.partitionMax = partitions[i].getPartitionMax();*/
+ if (partitions[i].getProperties() != null) {
+ partition.setProperty(getPropertyBeans(partitions[i].getProperties()));
+ }
+ partitionList.add(partition);
+ }
+
+ return partitionList;
+ }
+
+ public static ServiceDefinitionBean convertToServiceDefinitionBean(Service service) {
+
+ ServiceDefinitionBean serviceDefinitionBean = new ServiceDefinitionBean();
+ serviceDefinitionBean.setCartridgeType(service.getType());
+ serviceDefinitionBean.setTenantRange(service.getTenantRange());
+ serviceDefinitionBean.setClusterDomain(service.getClusterId());
+ serviceDefinitionBean.setIsPublic(service.getIsPublic());
+ serviceDefinitionBean.setAutoscalingPolicyName(service.getAutoscalingPolicyName());
+ serviceDefinitionBean.setDeploymentPolicyName(service.getDeploymentPolicyName());
+
+ return serviceDefinitionBean;
+ }
+
+ public static List<ServiceDefinitionBean> convertToServiceDefinitionBeans(Collection<Service> services) {
+
+ List<ServiceDefinitionBean> serviceDefinitionBeans = new ArrayList<ServiceDefinitionBean>();
+
+ for (Service service : services) {
+ serviceDefinitionBeans.add(convertToServiceDefinitionBean(service));
+ }
+ return serviceDefinitionBeans;
+ }
+
+ public static org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesGroup convertToCCKubernetesGroupPojo(KubernetesGroup kubernetesGroupBean) {
+
+ org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesGroup kubernetesGroup = new
+ org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesGroup();
+
+ kubernetesGroup.setGroupId(kubernetesGroupBean.getGroupId());
+ kubernetesGroup.setDescription(kubernetesGroupBean.getDescription());
+ kubernetesGroup.setKubernetesMaster(convertToCCKubernetesMasterPojo(kubernetesGroupBean.getKubernetesMaster()));
+ kubernetesGroup.setPortRange(convertToASPortRange(kubernetesGroupBean.getPortRange()));
+ kubernetesGroup.setKubernetesHosts(convertToASKubernetesHostsPojo(kubernetesGroupBean.getKubernetesHosts()));
+ kubernetesGroup.setProperties((getCCProperties(kubernetesGroupBean.getProperty())));
+
+ return kubernetesGroup;
+ }
+
+ private static org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost[] convertToASKubernetesHostsPojo(List<KubernetesHost> kubernetesHosts) {
+ if (kubernetesHosts == null || kubernetesHosts.isEmpty()) {
+ return null;
+ }
+ int kubernetesHostCount = kubernetesHosts.size();
+ org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost[]
+ kubernetesHostsArr = new org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost[kubernetesHostCount];
+ for (int i = 0; i < kubernetesHostCount; i++) {
+ KubernetesHost kubernetesHostBean = kubernetesHosts.get(i);
+ kubernetesHostsArr[i] = convertToCCKubernetesHostPojo(kubernetesHostBean);
+ }
+ return kubernetesHostsArr;
+ }
+
+
+ private static org.apache.stratos.cloud.controller.stub.kubernetes.PortRange convertToASPortRange(PortRange portRangeBean) {
+ if (portRangeBean == null) {
+ return null;
+ }
+ org.apache.stratos.cloud.controller.stub.kubernetes.PortRange
+ portRange = new org.apache.stratos.cloud.controller.stub.kubernetes.PortRange();
+ portRange.setLower(portRangeBean.getLower());
+ portRange.setUpper(portRangeBean.getUpper());
+ return portRange;
+ }
+
+ public static org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost convertToCCKubernetesHostPojo(KubernetesHost kubernetesHostBean) {
+ if (kubernetesHostBean == null) {
+ return null;
+ }
+
+ org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost
+ kubernetesHost = new org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost();
+ kubernetesHost.setHostId(kubernetesHostBean.getHostId());
+ kubernetesHost.setHostIpAddress(kubernetesHostBean.getHostIpAddress());
+ kubernetesHost.setHostname(kubernetesHostBean.getHostname());
+ kubernetesHost.setProperties(getCCProperties(kubernetesHostBean.getProperty()));
+
+ return kubernetesHost;
+ }
+
+ public static org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesMaster convertToCCKubernetesMasterPojo(KubernetesMaster kubernetesMasterBean) {
+ if (kubernetesMasterBean == null) {
+ return null;
+ }
+
+ org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesMaster
+ kubernetesMaster = new org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesMaster();
+ kubernetesMaster.setHostId(kubernetesMasterBean.getHostId());
+ kubernetesMaster.setHostIpAddress(kubernetesMasterBean.getHostIpAddress());
+ kubernetesMaster.setHostname(kubernetesMasterBean.getHostname());
+ kubernetesMaster.setEndpoint(kubernetesMasterBean.getEndpoint());
+ kubernetesMaster.setProperties(getCCProperties(kubernetesMasterBean.getProperty()));
+
+ return kubernetesMaster;
+ }
+
+ public static KubernetesGroup[] populateKubernetesGroupsPojo(org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesGroup[] kubernetesGroups) {
+
+ if (kubernetesGroups == null) {
+ return null;
+ }
+ KubernetesGroup[] kubernetesGroupsBean = new KubernetesGroup[kubernetesGroups.length];
+ for (int i = 0; i < kubernetesGroups.length; i++) {
+ kubernetesGroupsBean[i] = populateKubernetesGroupPojo(kubernetesGroups[i]);
+ }
+ return kubernetesGroupsBean;
+ }
+
+ public static KubernetesGroup populateKubernetesGroupPojo(org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesGroup kubernetesGroup) {
+ if (kubernetesGroup == null) {
+ return null;
+ }
+ KubernetesGroup kubernetesGroupBean = new KubernetesGroup();
+ kubernetesGroupBean.setGroupId(kubernetesGroup.getGroupId());
+ kubernetesGroupBean.setDescription(kubernetesGroup.getDescription());
+ kubernetesGroupBean.setPortRange(populatePortRangePojo(kubernetesGroup.getPortRange()));
+ kubernetesGroupBean.setKubernetesHosts(populateKubernetesHostsPojo(kubernetesGroup.getKubernetesHosts()));
+ kubernetesGroupBean.setKubernetesMaster(populateKubernetesMasterPojo(kubernetesGroup.getKubernetesMaster()));
+ kubernetesGroupBean.setProperty(populateCCProperties(kubernetesGroup.getProperties()));
+ return kubernetesGroupBean;
+ }
+
+ public static KubernetesMaster populateKubernetesMasterPojo(org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesMaster kubernetesMaster) {
+ if (kubernetesMaster == null) {
+ return null;
+ }
+ KubernetesMaster kubernetesMasterBean = new KubernetesMaster();
+ kubernetesMasterBean.setHostId(kubernetesMaster.getHostId());
+ kubernetesMasterBean.setHostname(kubernetesMaster.getHostname());
+ kubernetesMasterBean.setHostIpAddress(kubernetesMaster.getHostIpAddress());
+ kubernetesMasterBean.setProperty(populateCCProperties(kubernetesMaster.getProperties()));
+ kubernetesMasterBean.setEndpoint(kubernetesMaster.getEndpoint());
+ return kubernetesMasterBean;
+ }
+
+ public static List<KubernetesHost> populateKubernetesHostsPojo(org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost[] kubernetesHosts) {
+ if (kubernetesHosts == null) {
+ return null;
+ }
+ List<KubernetesHost> kubernetesHostList = new ArrayList<KubernetesHost>();
+ for (int i = 0; i < kubernetesHosts.length; i++) {
+ kubernetesHostList.add(populateKubernetesHostPojo(kubernetesHosts[i]));
+ }
+ return kubernetesHostList;
+ }
+
+ private static KubernetesHost populateKubernetesHostPojo(org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost kubernetesHost) {
+ if (kubernetesHost == null) {
+ return null;
+ }
+ KubernetesHost kubernetesHostBean = new KubernetesHost();
+ kubernetesHostBean.setHostId(kubernetesHost.getHostId());
+ kubernetesHostBean.setHostname(kubernetesHost.getHostname());
+ kubernetesHostBean.setHostIpAddress(kubernetesHost.getHostIpAddress());
+ kubernetesHostBean.setProperty(populateCCProperties(kubernetesHost.getProperties()));
+ return kubernetesHostBean;
+ }
+
+ private static List<PropertyBean> populateASProperties(org.apache.stratos.autoscaler.stub.Properties properties) {
+ if (properties == null || properties.getProperties() == null) {
+ return null;
+ }
+ List<PropertyBean> propertyBeanList = new ArrayList<PropertyBean>();
+ for (int i = 0; i < properties.getProperties().length; i++) {
+ propertyBeanList.add(populateASProperty(properties.getProperties()[i]));
+ }
+ return propertyBeanList;
+ }
+
+ private static List<PropertyBean> populateCCProperties(org.apache.stratos.cloud.controller.stub.Properties properties) {
+ if (properties == null || properties.getProperties() == null) {
+ return null;
+ }
+ List<PropertyBean> propertyBeanList = new ArrayList<PropertyBean>();
+ for (int i = 0; i < properties.getProperties().length; i++) {
+ propertyBeanList.add(populateCCProperty(properties.getProperties()[i]));
+ }
+ return propertyBeanList;
+ }
+
+ private static PropertyBean populateASProperty(org.apache.stratos.autoscaler.stub.Property propertyE) {
+ if (propertyE == null) {
+ return null;
+ }
+ PropertyBean propertyBean = new PropertyBean();
+ propertyBean.setName(propertyE.getName());
+ propertyBean.setValue(propertyE.getValue());
+ return propertyBean;
+ }
+
+ private static PropertyBean populateCCProperty(org.apache.stratos.cloud.controller.stub.Property propertyE) {
+ if (propertyE == null) {
+ return null;
+ }
+ PropertyBean propertyBean = new PropertyBean();
+ propertyBean.setName(propertyE.getName());
+ propertyBean.setValue(propertyE.getValue());
+ return propertyBean;
+ }
+
+ private static PortRange populatePortRangePojo(org.apache.stratos.cloud.controller.stub.kubernetes.PortRange portRange) {
+ if (portRange == null) {
+ return null;
+ }
+ PortRange portRangeBean = new PortRange();
+ portRangeBean.setUpper(portRange.getUpper());
+ portRangeBean.setLower(portRange.getLower());
+ return portRangeBean;
+ }
+
+ public static ApplicationContext convertApplicationBeanToApplicationContext(ApplicationDefinition compositeAppDefinition) {
+
+ org.apache.stratos.autoscaler.stub.pojo.ApplicationContext applicationContext =
+ new org.apache.stratos.autoscaler.stub.pojo.ApplicationContext();
+ applicationContext.setApplicationId(compositeAppDefinition.getApplicationId());
+ applicationContext.setAlias(compositeAppDefinition.getAlias());
+ //applicationContext.setDeploymentPolicy(compositeAppDefinition.getDeploymentPolicy());
+
+ // convert and set components
+ if (compositeAppDefinition.getComponents() != null) {
+ org.apache.stratos.autoscaler.stub.pojo.ComponentContext componentContext =
+ new org.apache.stratos.autoscaler.stub.pojo.ComponentContext();
+
+ // top level Groups
+ if (compositeAppDefinition.getComponents().getGroups() != null) {
+ componentContext.setGroupContexts(getgroupContextArrayFromGroupDefinitions(compositeAppDefinition.getComponents().getGroups()));
+ }
+ // top level dependency information
+ if (compositeAppDefinition.getComponents().getDependencies() != null) {
+ componentContext.setDependencyContext(getDependencyContextFromDependencyDefinition(compositeAppDefinition.getComponents().getDependencies()));
+ }
+ // top level cartridge context information
+ if (compositeAppDefinition.getComponents().getCartridges() != null) {
+ componentContext.setCartridgeContexts(getCartridgeContextArrayFromCartridgeDefinition(compositeAppDefinition.getComponents().getCartridges()));
+ }
+
+ applicationContext.setComponents(componentContext);
+ }
+
+
+ return applicationContext;
+ }
+
+ private static CartridgeContext[] getCartridgeContextArrayFromCartridgeDefinition(
+ List<CartridgeDefinition> cartridges) {
+
+ CartridgeContext[] cartridgeContextArray = new CartridgeContext[cartridges.size()];
+ int i = 0;
+ for (CartridgeDefinition cartridgeDefinition : cartridges) {
+ CartridgeContext context = new CartridgeContext();
+ context.setCartridgeMax(cartridgeDefinition.getCartridgeMax());
+ context.setCartridgeMin(cartridgeDefinition.getCartridgeMin());
+ context.setType(cartridgeDefinition.getType());
+ context.setSubscribableInfoContext(convertSubscribableInfo(cartridgeDefinition.getSubscribableInfo()));
+ cartridgeContextArray[i++] = context;
+ }
+
+ return cartridgeContextArray;
+ }
+
+ private static SubscribableInfoContext convertSubscribableInfo(
+ SubscribableInfo subscribableInfo) {
+ SubscribableInfoContext infoContext = new SubscribableInfoContext();
+ infoContext.setAlias(subscribableInfo.getAlias());
+ infoContext.setAutoscalingPolicy(subscribableInfo.getAutoscalingPolicy());
+ infoContext.setDependencyAliases(subscribableInfo.getDependencyAliases());
+ infoContext.setDeploymentPolicy(subscribableInfo.getDeploymentPolicy());
+ infoContext.setMaxMembers(subscribableInfo.getMaxMembers());
+ infoContext.setMinMembers(subscribableInfo.getMinMembers());
+ //infoContext.setPrivateRepo(subscribableInfo.getpr);
+ infoContext.setRepoPassword(subscribableInfo.getRepoPassword());
+ infoContext.setRepoUrl(subscribableInfo.getRepoUrl());
+ infoContext.setRepoUsername(subscribableInfo.getRepoUsername());
+ infoContext.setProperties(convertProperties(subscribableInfo.getProperty()));
+
+ return infoContext;
+ }
+
+ private static org.apache.stratos.autoscaler.stub.Properties convertProperties(
+ List<org.apache.stratos.manager.composite.application.beans.PropertyBean> property) {
+ org.apache.stratos.autoscaler.stub.Properties prop = new org.apache.stratos.autoscaler.stub.Properties();
+ if (property != null) {
+ for (org.apache.stratos.manager.composite.application.beans.PropertyBean propertyBean : property) {
+ org.apache.stratos.autoscaler.stub.Property p = new org.apache.stratos.autoscaler.stub.Property();
+ p.setName(propertyBean.getName());
+ p.setValue(propertyBean.getValue());
+ prop.addProperties(p);
+ }
+ }
+ return prop;
+ }
+
+
+ private static DependencyContext getDependencyContextFromDependencyDefinition(DependencyDefinitions dependencyDefinitions) {
+
+ DependencyContext dependencyContext = new DependencyContext();
+ dependencyContext.setTerminationBehaviour(dependencyDefinitions.getTerminationBehaviour());
+
+ if (dependencyDefinitions != null){
+
+ if(dependencyDefinitions.getStartupOrders() != null) {
+ String[] startupOrders = new String[dependencyDefinitions.getStartupOrders().size()];
+ startupOrders = dependencyDefinitions.getStartupOrders().toArray(startupOrders);
+ dependencyContext.setStartupOrdersContexts(startupOrders);
+ }
+ if (dependencyDefinitions.getScalingDependants() != null) {
+ String[] scalingDependents = new String[dependencyDefinitions.getScalingDependants().size()];
+ scalingDependents = dependencyDefinitions.getScalingDependants().toArray(scalingDependents);
+ dependencyContext.setScalingDependents(scalingDependents);
+ }
+ }
+
+
+
+ return dependencyContext;
+ }
+
+ private static org.apache.stratos.autoscaler.stub.pojo.GroupContext[]
+ getgroupContextArrayFromGroupDefinitions(List<GroupDefinition> groupDefinitions) {
+
+ GroupContext[] groupContexts = new GroupContext[groupDefinitions.size()];
+ int i = 0;
+ for (GroupDefinition groupDefinition : groupDefinitions) {
+ GroupContext groupContext = new GroupContext();
+ groupContext.setName(groupDefinition.getName());
+ groupContext.setAlias(groupDefinition.getAlias());
+ groupContext.setGroupMaxInstances(groupDefinition.getGroupMaxInstances());
+ groupContext.setGroupMinInstances(groupDefinition.getGroupMinInstances());
+ groupContext.setGroupScalingEnabled(groupDefinition.isGroupScalingEnabled);
+
+ // Groups
+ if (groupDefinition.getGroups() != null) {
+ groupContext.setGroupContexts(getgroupContextArrayFromGroupDefinitions(groupDefinition.getGroups()));
+ }
+
+ groupContext.setCartridgeContexts(getCartridgeContextArrayFromCartridgeDefinition(groupDefinition.getCartridges()));
+ groupContexts[i++] = groupContext;
+ }
+
+ return groupContexts;
+ }
+
+
+ public static ApplicationBean applicationToBean(Application application) {
+ if (application == null) {
+ return null;
+ }
+
+ ApplicationBean applicationBean = new ApplicationBean();
+ applicationBean.setId(application.getUniqueIdentifier());
+ applicationBean.setTenantDomain(application.getTenantDomain());
+ applicationBean.setTenantAdminUsername(application.getTenantAdminUserName());
+ applicationBean.setInstances(setApplicationInstances(application));
+ return applicationBean;
+ }
+
+ private static List<Instance> setApplicationInstances(
+ Application application) {
+ List<Instance> applicationInstanceList = new ArrayList<Instance>();
+ Collection<ApplicationInstance> applicationInstancesInTopology =
+ application.getInstanceIdToInstanceContextMap().values();
+
+ if(applicationInstancesInTopology != null) {
+ for (ApplicationInstance applicationInstance : applicationInstancesInTopology) {
+ Instance instance = new Instance();
+ instance.setInstanceId(applicationInstance.getInstanceId());
+ instance.setStatus(applicationInstance.getStatus().toString());
+ applicationInstanceList.add(instance);
+ }
+ }
+
+ return applicationInstanceList;
+ }
+
+ public static GroupBean toGroupBean(Group group) {
+ if (group == null) {
+ return null;
+ }
+
+ GroupBean groupBean = new GroupBean();
+ groupBean.setInstances(setGroupInstances(group));
+ groupBean.setAlias(group.getUniqueIdentifier());
+ groupBean.setAutoScalingPolicy(group.getAutoscalingPolicy());
+ return groupBean;
+ }
+
+ private static List<Instance> setGroupInstances(Group group) {
+ List<Instance> instanceList = new ArrayList<Instance>();
+ Collection<GroupInstance> instancesInTopology = group.getInstanceIdToInstanceContextMap().values();
+ if(instancesInTopology != null) {
+ for (GroupInstance groupInstance : instancesInTopology) {
+ Instance instance = new Instance();
+ instance.setStatus(groupInstance.getStatus().toString());
+ instance.setInstanceId(groupInstance.getInstanceId());
+ instanceList.add(instance);
+ }
+ }
+
+ return instanceList;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/list/ListType.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/list/ListType.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/list/ListType.java
new file mode 100644
index 0000000..4d567fd
--- /dev/null
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/list/ListType.java
@@ -0,0 +1,39 @@
+/*
+ * 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.rest.endpoint.util.type.list;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement(name = "List")
+public class ListType<T> {
+
+ private List<T> list;
+
+ @XmlElement(name="Item")
+ public List<T> getList() {
+ return list;
+ }
+
+ public void setList(List<T> list) {
+ this.list = list;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/map/MapAdapter.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/map/MapAdapter.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/map/MapAdapter.java
new file mode 100644
index 0000000..cf701e8
--- /dev/null
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/map/MapAdapter.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.rest.endpoint.util.type.map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import java.util.HashMap;
+import java.util.Map;
+
+public class MapAdapter<S, T> extends XmlAdapter<MapType,Map<S, T>> {
+
+ @Override
+ public MapType marshal(Map<S, T> v) throws Exception {
+
+ MapType mapType = new MapType();
+
+ for(Map.Entry entry : v.entrySet()) {
+ MapEntryType myMapEntryType = new MapEntryType();
+ myMapEntryType.key = entry.getKey();
+ myMapEntryType.value = entry.getValue();
+ mapType.entry.add(myMapEntryType);
+ }
+ return mapType;
+ }
+
+ @Override
+ public Map<S, T> unmarshal(MapType v) throws Exception {
+
+ Map hashMap = new HashMap();
+
+ for(MapEntryType mapEntryType : v.entry) {
+ hashMap.put(mapEntryType.key, mapEntryType.value);
+ }
+ return hashMap;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/map/MapEntryType.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/map/MapEntryType.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/map/MapEntryType.java
new file mode 100644
index 0000000..7d88a2d
--- /dev/null
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/map/MapEntryType.java
@@ -0,0 +1,32 @@
+/*
+ * 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.rest.endpoint.util.type.map;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlValue;
+
+public class MapEntryType <S,T> {
+
+ @XmlAttribute
+ public S key;
+
+ @XmlValue
+ public T value;
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/map/MapType.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/map/MapType.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/map/MapType.java
new file mode 100644
index 0000000..6cfe010
--- /dev/null
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/type/map/MapType.java
@@ -0,0 +1,28 @@
+/*
+ * 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.rest.endpoint.util.type.map;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MapType {
+
+ public List<MapEntryType> entry = new ArrayList<MapEntryType>();
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/cxf-servlet.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/cxf-servlet.xml b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/cxf-servlet.xml
index 83cb477..b528eb8 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/cxf-servlet.xml
+++ b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/cxf-servlet.xml
@@ -42,7 +42,7 @@
<bean class="org.apache.cxf.jaxrs.provider.json.JSONProvider">
<property name="dropRootElement" value="true"/>
<property name="supportUnwrapped" value="true"/>
- </bean>>
+ </bean>
<ref bean="exceptionHandler"/>
</jaxrs:providers>
</jaxrs:server>
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/cxf-servlet.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/cxf-servlet.xml b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/cxf-servlet.xml
index 9ff0275..002f034 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/cxf-servlet.xml
+++ b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/cxf-servlet.xml
@@ -99,9 +99,9 @@
<property name="oauthValidationEndpoint" value="https://localhost:9443/services/"/>
</bean>
<bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider">
- <!-- property name="schemaHandler" ref="schemaHolder"/-->
<property name="supportUnwrapped" value="true"/>
<property name="serializeAsArray" value="true"/>
+ <property name="dropCollectionWrapperElement" value="true"/>
<property name="arrayKeys">
<list>
<value>partitions</value>
@@ -139,5 +139,4 @@
<util:list id="theSchemas">
<value>classpath:/WEB-INF/schemas/schema.xsd</value>
</util:list>
-
</beans>
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/services/TenantMgtAdminService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/services/TenantMgtAdminService.java b/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/services/TenantMgtAdminService.java
index 730796c..df08008 100644
--- a/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/services/TenantMgtAdminService.java
+++ b/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/services/TenantMgtAdminService.java
@@ -41,9 +41,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
/**
* This is the admin Web service which is used for managing tenants
[6/7] stratos git commit: Moving rest api domain model to stratos
common component to be reused by the cli
Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/RequestsInFlight.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/RequestsInFlight.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/RequestsInFlight.java
deleted file mode 100644
index 4d7bb2c..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/RequestsInFlight.java
+++ /dev/null
@@ -1,33 +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.beans.autoscaler.policy.autoscale;
-
-public class RequestsInFlight {
-
- public float average;
-
- public float secondDerivative;
-
- public float gradient;
-
- public float scaleDownMarginOfGradient;
-
- public float scaleDownMarginOfSecondDerivative;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/deployment/DeploymentPolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/deployment/DeploymentPolicy.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/deployment/DeploymentPolicy.java
deleted file mode 100644
index abcc3f3..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/deployment/DeploymentPolicy.java
+++ /dev/null
@@ -1,78 +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.beans.autoscaler.policy.deployment;
-
-import org.apache.stratos.cli.beans.autoscaler.partition.NetworkPartition;
-import org.apache.stratos.cli.beans.autoscaler.partition.Partition;
-
-import java.util.List;
-
-public class DeploymentPolicy {
- private String id;
-
- private String description;
-
- private boolean isPublic;
-
- //partition groups
- private List<NetworkPartition> networkPartition;
-
- //partitions
- private List<Partition> partition;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public List<NetworkPartition> getNetworkPartition() {
- return networkPartition;
- }
-
- public void setNetworkPartition(List<NetworkPartition> networkPartition) {
- this.networkPartition = networkPartition;
- }
-
- public List<Partition> getPartition() {
- return partition;
- }
-
- public void setPartition(List<Partition> partition) {
- this.partition = partition;
- }
-
- public boolean getIsPublic() {
- return isPublic;
- }
-
- public void setIsPublic(boolean isPublic) {
- this.isPublic = isPublic;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/Cartridge.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/Cartridge.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/Cartridge.java
deleted file mode 100644
index 671ddb1..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/Cartridge.java
+++ /dev/null
@@ -1,274 +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.beans.cartridge;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Arrays;
-
-
-@XmlRootElement
-public class Cartridge implements Comparable<Cartridge> {
-
- private String displayName;
- private String description;
- private boolean isPublic;
- 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 dbHost;
- private String publicIp;
- private String lbClusterId;
- private boolean loadBalancer;
-
- private String[] accessURLs;
- private PortMapping[] portMappings;
- private String serviceGroup;
-
- 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) {
- if(accessURLs == null) {
- this.accessURLs = new String[0];
- } else {
- this.accessURLs = Arrays.copyOf(accessURLs, accessURLs.length);
- }
- }
-
- public void setDbUserName(String dbUserName) {
- this.dbUserName = dbUserName;
- }
-
- public String getMappedDomain() {
- return mappedDomain;
- }
-
- public void setMappedDomain(String mappedDomain) {
- this.mappedDomain = mappedDomain;
- }
-
- public PortMapping[] getPortMappings() {
- return portMappings;
- }
-
- public void setPortMappings(PortMapping[] portMappings) {
- if(portMappings == null) {
- this.portMappings = new PortMapping[0];
- } else {
- this.portMappings = Arrays.copyOf(portMappings, portMappings.length);
- }
- }
-
- public String getDbHost() {
- return dbHost;
- }
-
- public void setDbHost(String dbHost) {
- this.dbHost = dbHost;
- }
-
- public String getPublicIp() {
- return publicIp;
- }
-
- public void setPublicIp(String publicIp) {
- this.publicIp = publicIp;
- }
-
- 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;
- }
-
- public String getLbClusterId() {
- return lbClusterId;
- }
-
- public void setLbClusterId(String lbClusterId) {
- this.lbClusterId = lbClusterId;
- }
-
- public boolean isLoadBalancer() {
- return loadBalancer;
- }
-
- public void setLoadBalancer(boolean isLoadBalancer) {
- this.loadBalancer = isLoadBalancer;
- }
-
- public boolean getIsPublic() {
- return isPublic;
- }
-
- public void setIsPublic(boolean isPublic) {
- this.isPublic = isPublic;
- }
-
- public String getServiceGroup() {
- return serviceGroup;
- }
-
- public void setServiceGroup(String serviceGroup) {
- this.serviceGroup = serviceGroup;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/CartridgeInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/CartridgeInfoBean.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/CartridgeInfoBean.java
deleted file mode 100644
index 9e23120..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/CartridgeInfoBean.java
+++ /dev/null
@@ -1,151 +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.beans.cartridge;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class CartridgeInfoBean {
- String cartridgeType;
- String alias;
- String policy;
- String repoURL;
- String repoUsername;
- String repoPassword;
- private String autoscalePolicy;
- private String deploymentPolicy;
- private String size;
- private String volumeId;
- boolean privateRepo;
- private boolean removeOnTermination;
- private boolean persistanceRequired;
- private boolean commitsEnabled;
-
- 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 getAutoscalePolicy() {
- return autoscalePolicy;
- }
-
- public void setAutoscalePolicy(String autoscalePolicy) {
- this.autoscalePolicy = autoscalePolicy;
- }
-
- public String getDeploymentPolicy() {
- return deploymentPolicy;
- }
-
- public void setDeploymentPolicy(String deploymentPolicy) {
- this.deploymentPolicy = deploymentPolicy;
- }
-
- public String getSize() {
- return size;
- }
-
- public void setSize(String size) {
- this.size = size;
- }
-
- public boolean isRemoveOnTermination() {
- return removeOnTermination;
- }
-
- public void setRemoveOnTermination(boolean removeOnTermination) {
- this.removeOnTermination = removeOnTermination;
- }
-
- public boolean isPersistanceRequired() {
- return persistanceRequired;
- }
-
- public void setPersistanceRequired(boolean persistanceRequired) {
- this.persistanceRequired = persistanceRequired;
- }
-
- public boolean isCommitsEnabled() {
- return commitsEnabled;
- }
-
- public void setCommitsEnabled(boolean commitsEnabled) {
- this.commitsEnabled = commitsEnabled;
- }
-
- public String getVolumeId() {
- return volumeId;
- }
-
- public void setVolumeId(String volumeId) {
- this.volumeId = volumeId;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/PortMapping.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/PortMapping.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/PortMapping.java
deleted file mode 100644
index 136f22f..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/PortMapping.java
+++ /dev/null
@@ -1,68 +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.beans.cartridge;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class PortMapping {
-
- private String protocol;
- private String port;
- private String proxyPort;
-
- public PortMapping(){
-
- }
-
- public PortMapping(String protocol, String port, String proxyPort){
- this.protocol = protocol;
- this.port = port;
- this.proxyPort = proxyPort;
- }
-
- public String getProtocol() {
- return protocol;
- }
-
- public void setProtocol(String protocol) {
- this.protocol = protocol;
- }
-
- public String getPort() {
- return port;
- }
-
- public void setPort(String port) {
- this.port = port;
- }
-
- public String getProxyPort() {
- return proxyPort;
- }
-
- public void setProxyPort(String proxyPort) {
- this.proxyPort = proxyPort;
- }
-
- public String toString () {
-
- return "Protocol: " + protocol + ", Port: " + port + ", Proxy Port: " + proxyPort;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/ServiceDefinitionBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/ServiceDefinitionBean.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/ServiceDefinitionBean.java
deleted file mode 100644
index 656f411..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/ServiceDefinitionBean.java
+++ /dev/null
@@ -1,95 +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.beans.cartridge;
-
-public class ServiceDefinitionBean {
- private String serviceName;
- private boolean isPublic;
- private String cartridgeType;
- private String deploymentPolicyName;
- private String autoscalingPolicyName;
- private String clusterDomain;
- private String clusterSubDomain;
- private String tenantRange;
-
- public String getServiceName() {
- return serviceName;
- }
-
- public void setServiceName(String serviceName) {
- this.serviceName = serviceName;
- }
-
- public String getCartridgeType() {
- return cartridgeType;
- }
-
- public void setCartridgeType(String cartridgeType) {
- this.cartridgeType = cartridgeType;
- }
-
- public String getDeploymentPolicyName() {
- return deploymentPolicyName;
- }
-
- public void setDeploymentPolicyName(String deploymentPolicyName) {
- this.deploymentPolicyName = deploymentPolicyName;
- }
-
- public String getAutoscalingPolicyName() {
- return autoscalingPolicyName;
- }
-
- public void setAutoscalingPolicyName(String autoscalingPolicyName) {
- this.autoscalingPolicyName = autoscalingPolicyName;
- }
-
- public String getClusterDomain() {
- return clusterDomain;
- }
-
- public void setClusterDomain(String clusterDomain) {
- this.clusterDomain = clusterDomain;
- }
-
- public String getClusterSubDomain() {
- return clusterSubDomain;
- }
-
- public void setClusterSubDomain(String clusterSubDomain) {
- this.clusterSubDomain = clusterSubDomain;
- }
-
- public String getTenantRange() {
- return tenantRange;
- }
-
- public void setTenantRange(String tenantRange) {
- this.tenantRange = tenantRange;
- }
-
- public boolean getIsPublic() {
- return isPublic;
- }
-
- public void setIsPublic(boolean isPublic) {
- this.isPublic = isPublic;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Application.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Application.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Application.java
deleted file mode 100644
index e014eac..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Application.java
+++ /dev/null
@@ -1,70 +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.beans.grouping.applications;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Application
-{
- private String id;
- private String tenantDomain;
- private String tenantAdminUsername;
- public List<Group> groups = null;
- public List<Cluster> clusters = null;
- private List<Instance> instances;
-
- public Application(){
- this.groups = new ArrayList<Group>();
- this.clusters = new ArrayList<Cluster>();
- }
- public void addGroup(Group groupBean) {
- this.groups.add(groupBean);
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public void setTenantDomain(String tenantDomain) {
- this.tenantDomain = tenantDomain;
- }
-
- public void setTenantAdminUsername(String tenantAdminUsername) {
- this.tenantAdminUsername = tenantAdminUsername;
- }
-
- public String getId() {
- return id;
- }
-
- public String getTenantDomain() {
- return tenantDomain;
- }
-
- public String getTenantAdminUsername() {
- return tenantAdminUsername;
- }
- public List<Instance> getInstances() {
- return instances;
- }
- public void setInstances(List<Instance> instances) {
- this.instances = instances;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Cluster.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Cluster.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Cluster.java
deleted file mode 100644
index eea8f08..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Cluster.java
+++ /dev/null
@@ -1,56 +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.beans.grouping.applications;
-
-import java.util.List;
-
-public class Cluster {
- public String alias;
-
- public String serviceName;
-
- public String clusterId;
-
- public List<Member> member;
-
- public String tenantRange;
-
- public List<String> hostNames;
-
- public boolean isLbCluster;
-
- public List<Property> property;
-
- private List<Instance> instances;
-
- public List<Instance> getInstances() {
- return instances;
- }
-
- public void setInstances(List<Instance> instances) {
- this.instances = instances;
- }
-
- @Override
- public String toString() {
- return "Cluster [serviceName=" + serviceName + ", clusterId=" + clusterId + ", member=" + member
- + ", tenantRange=" + tenantRange + ", hostNames=" + hostNames + ", isLbCluster=" + isLbCluster
- + ", property=" + property + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Group.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Group.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Group.java
deleted file mode 100644
index bfc4615..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Group.java
+++ /dev/null
@@ -1,92 +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.beans.grouping.applications;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Group
-{
- private List<Group> subGroups = null;
- private List<Cluster> clusters = null;
- private String alias;
- private String deploymentPolicy;
- private String autoScalingPolicy;
- private List<Instance> instances;
-
- public Group(){
- this.setClusters(new ArrayList<Cluster>());
- this.setSubGroups(new ArrayList<Group>());
- }
-
- public void addGroup(Group groupBean){
- getSubGroups().add(groupBean);
- }
- public void addCluster(Cluster cluster){
- getClusters().add(cluster);
- }
-
- public List<Group> getSubGroups() {
- return subGroups;
- }
-
- public void setSubGroups(List<Group> subGroups) {
- this.subGroups = subGroups;
- }
-
- public List<Cluster> getClusters() {
- return clusters;
- }
-
- public void setClusters(List<Cluster> clusters) {
- this.clusters = clusters;
- }
-
- public void setAlias(String alias) {
- this.alias = alias;
- }
-
- public void setDeploymentPolicy(String deploymentPolicy) {
- this.deploymentPolicy = deploymentPolicy;
- }
-
- public void setAutoScalingPolicy(String autoScalingPolicy) {
- this.autoScalingPolicy = autoScalingPolicy;
- }
-
- public String getAlias() {
- return alias;
- }
-
- public String getDeploymentPolicy() {
- return deploymentPolicy;
- }
-
- public String getAutoScalingPolicy() {
- return autoScalingPolicy;
- }
-
- public List<Instance> getInstances() {
- return instances;
- }
-
- public void setInstances(List<Instance> instances) {
- this.instances = instances;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Instance.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Instance.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Instance.java
deleted file mode 100644
index decea07..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Instance.java
+++ /dev/null
@@ -1,26 +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.beans.grouping.applications;
-
-public class Instance {
- public String status;
-
- public String instanceId;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Member.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Member.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Member.java
deleted file mode 100644
index 0cbb087..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Member.java
+++ /dev/null
@@ -1,130 +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.beans.grouping.applications;
-
-public class Member
-{
- private String networkPartitionId;
-
- private String memberPublicIp;
-
- private String status;
-
- private Property[] property;
-
- private String memberId;
-
- private String partitionId;
-
- private String clusterId;
-
- private String memberIp;
-
- private String serviceName;
-
- public String getNetworkPartitionId ()
- {
- return networkPartitionId;
- }
-
- public void setNetworkPartitionId (String networkPartitionId)
- {
- this.networkPartitionId = networkPartitionId;
- }
-
- public String getMemberPublicIp ()
- {
- return memberPublicIp;
- }
-
- public void setMemberPublicIp (String memberPublicIp)
- {
- this.memberPublicIp = memberPublicIp;
- }
-
- public String getStatus ()
- {
- return status;
- }
-
- public void setStatus (String status)
- {
- this.status = status;
- }
-
- public Property[] getProperty ()
- {
- return property;
- }
-
- public void setProperty (Property[] property)
- {
- this.property = property;
- }
-
- public String getMemberId ()
- {
- return memberId;
- }
-
- public void setMemberId (String memberId)
- {
- this.memberId = memberId;
- }
-
- public String getPartitionId ()
- {
- return partitionId;
- }
-
- public void setPartitionId (String partitionId)
- {
- this.partitionId = partitionId;
- }
-
- public String getClusterId ()
- {
- return clusterId;
- }
-
- public void setClusterId (String clusterId)
- {
- this.clusterId = clusterId;
- }
-
- public String getMemberIp ()
- {
- return memberIp;
- }
-
- public void setMemberIp (String memberIp)
- {
- this.memberIp = memberIp;
- }
-
- public String getServiceName ()
- {
- return serviceName;
- }
-
- public void setServiceName (String serviceName)
- {
- this.serviceName = serviceName;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Property.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Property.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Property.java
deleted file mode 100644
index cd7dda3..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/Property.java
+++ /dev/null
@@ -1,46 +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.beans.grouping.applications;
-
-public class Property
-{
- 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/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/SubGroup.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/SubGroup.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/SubGroup.java
deleted file mode 100644
index d3567eb..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/applications/SubGroup.java
+++ /dev/null
@@ -1,70 +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.beans.grouping.applications;
-
-public class SubGroup
-{
- private String deploymentPolicy;
-
- private Cluster cluster;
-
- private String alias;
-
- private String autoScalingPolicy;
-
- public String getDeploymentPolicy ()
- {
- return deploymentPolicy;
- }
-
- public void setDeploymentPolicy (String deploymentPolicy)
- {
- this.deploymentPolicy = deploymentPolicy;
- }
-
- public Cluster getCluster()
- {
- return cluster;
- }
-
- public void setCluster(Cluster cluster)
- {
- this.cluster = cluster;
- }
-
- public String getAlias ()
- {
- return alias;
- }
-
- public void setAlias (String alias)
- {
- this.alias = alias;
- }
-
- public String getAutoScalingPolicy ()
- {
- return autoScalingPolicy;
- }
-
- public void setAutoScalingPolicy (String autoScalingPolicy)
- {
- this.autoScalingPolicy = autoScalingPolicy;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/Dependencies.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/Dependencies.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/Dependencies.java
deleted file mode 100644
index 6364e4b..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/Dependencies.java
+++ /dev/null
@@ -1,46 +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.beans.grouping.serviceGroups;
-
-public class Dependencies
-{
- private String terminationBehaviour;
-
- private String[] startupOrders;
-
- public String getTerminationBehaviour ()
- {
- return terminationBehaviour;
- }
-
- public void setTerminationBehaviour (String terminationBehaviour)
- {
- this.terminationBehaviour = terminationBehaviour;
- }
-
- public String[] getStartupOrders ()
- {
- return startupOrders;
- }
-
- public void setStartupOrders (String[] startupOrders)
- {
- this.startupOrders = startupOrders;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupBean.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupBean.java
deleted file mode 100644
index b7dcafb..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupBean.java
+++ /dev/null
@@ -1,33 +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.beans.grouping.serviceGroups;
-
-public class ServiceGroupBean {
- private ServiceGroupDefinition serviceGroup;
-
- public ServiceGroupDefinition getServiceGroupDefinition ()
- {
- return serviceGroup;
- }
-
- public void setServiceGroupDefinition (ServiceGroupDefinition serviceGroupDefinition)
- {
- this.serviceGroup = serviceGroupDefinition;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupDefinition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupDefinition.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupDefinition.java
deleted file mode 100644
index 71eb544..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupDefinition.java
+++ /dev/null
@@ -1,70 +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.beans.grouping.serviceGroups;
-
-public class ServiceGroupDefinition
-{
- private Dependencies dependencies;
-
- private String name;
-
- private String[] subGroups;
-
- private String[] cartridges;
-
- public Dependencies getDependencies ()
- {
- return dependencies;
- }
-
- public void setDependencies (Dependencies dependencies)
- {
- this.dependencies = dependencies;
- }
-
- public String getName ()
- {
- return name;
- }
-
- public void setName (String name)
- {
- this.name = name;
- }
-
- public String[] getSubGroups ()
- {
- return subGroups;
- }
-
- public void setSubGroups (String[] subGroups)
- {
- this.subGroups = subGroups;
- }
-
- public String[] getCartridges ()
- {
- return cartridges;
- }
-
- public void setCartridges (String[] cartridges)
- {
- this.cartridges = cartridges;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesGroup.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesGroup.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesGroup.java
deleted file mode 100644
index 2eda746..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesGroup.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.beans.kubernetes;
-
-/**
- * Kubernetes group.
- */
-public class KubernetesGroup {
- private String groupId;
- private String description;
-
- public String getGroupId() {
- return groupId;
- }
-
- public void setGroupId(String groupId) {
- this.groupId = groupId;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesGroupList.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesGroupList.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesGroupList.java
deleted file mode 100644
index 4ca23b5..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesGroupList.java
+++ /dev/null
@@ -1,37 +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.beans.kubernetes;
-
-import java.util.ArrayList;
-
-/**
- * Kubernetes group list.
- */
-public class KubernetesGroupList {
- private ArrayList<KubernetesGroup> kubernetesGroup;
-
- public ArrayList<KubernetesGroup> getKubernetesGroup() {
- return kubernetesGroup;
- }
-
- public void setKubernetesGroup(ArrayList<KubernetesGroup> kubernetesGroup) {
- this.kubernetesGroup = kubernetesGroup;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesHost.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesHost.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesHost.java
deleted file mode 100644
index 06e7311..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesHost.java
+++ /dev/null
@@ -1,53 +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.beans.kubernetes;
-
-/**
- * Kubernetes host.
- */
-public class KubernetesHost {
- private String hostId;
- private String hostname;
- private String hostIpAddress;
-
- public String getHostId() {
- return hostId;
- }
-
- public void setHostId(String hostId) {
- this.hostId = hostId;
- }
-
- public String getHostname() {
- return hostname;
- }
-
- public void setHostname(String hostname) {
- this.hostname = hostname;
- }
-
- public String getHostIpAddress() {
- return hostIpAddress;
- }
-
- public void setHostIpAddress(String hostIpAddress) {
- this.hostIpAddress = hostIpAddress;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesHostList.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesHostList.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesHostList.java
deleted file mode 100644
index 029b21d..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/kubernetes/KubernetesHostList.java
+++ /dev/null
@@ -1,37 +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.beans.kubernetes;
-
-import java.util.ArrayList;
-
-/**
- * Kubernetes group list.
- */
-public class KubernetesHostList {
- private ArrayList<KubernetesHost> kubernetesHost;
-
- public ArrayList<KubernetesHost> getKubernetesHost() {
- return kubernetesHost;
- }
-
- public void setKubernetesHost(ArrayList<KubernetesHost> kubernetesHost) {
- this.kubernetesHost = kubernetesHost;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/Cluster.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/Cluster.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/Cluster.java
deleted file mode 100644
index 065841c..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/Cluster.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.apache.stratos.cli.beans.topology;
-/*
- *
- * 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.
- *
-*/
-
-
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.stratos.cli.beans.autoscaler.partition.PropertyBean;
-
-public class Cluster {
- private String serviceName;
-
- private String clusterId;
-
- private List<Member> member;
-
- private String tenantRange;
-
- private List<String> hostNames;
-
- private boolean isLbCluster;
-
- private List<PropertyBean> property;
-
- 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 List<Member> getMember() {
- return member;
- }
-
- public void addMember(Member member) {
- this.member.add(member);
- }
-
- public void removeMember(Member member) {
- this.member.remove(member);
- }
-
- public void setMember(List<Member> member) {
- this.member = member;
- }
-
- public String getTenantRange() {
- return tenantRange;
- }
-
- public void setTenantRange(String tenantRange) {
- this.tenantRange = tenantRange;
- }
-
- public List<String> getHostNames() {
- return hostNames;
- }
-
- public void setHostNames(List<String> hostNames) {
- this.hostNames = hostNames;
- }
-
- public void addHostNames(String hostName) {
- this.hostNames.add(hostName);
- }
-
- public void removeHostNames(String hostName) {
- this.hostNames.remove(hostName);
- }
-
- public boolean isLbCluster() {
- return isLbCluster;
- }
-
- public void setLbCluster(boolean lbCluster) {
- isLbCluster = lbCluster;
- }
-
- public List<PropertyBean> getProperty() {
- return property;
- }
-
- public void setProperty(List<PropertyBean> property) {
- this.property = property;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/Member.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/Member.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/Member.java
deleted file mode 100644
index 897e7b3..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/Member.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.apache.stratos.cli.beans.topology;
-
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.stratos.cli.beans.autoscaler.partition.PropertyBean;
-
-/*
- *
- * 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.
- *
-*/
-
-
-public class Member {
- private String serviceName;
- private String clusterId;
- private String networkPartitionId;
- private String partitionId;
- private String memberId;
-
- private String status;
- private String memberIp;
- private String lbClusterId;
- private String memberPublicIp;
- private List<PropertyBean> property;
-
- 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 getNetworkPartitionId() {
- return networkPartitionId;
- }
-
- public void setNetworkPartitionId(String networkPartitionId) {
- this.networkPartitionId = networkPartitionId;
- }
-
- public String getPartitionId() {
- return partitionId;
- }
-
- public void setPartitionId(String partitionId) {
- this.partitionId = partitionId;
- }
-
- public String getMemberId() {
- return memberId;
- }
-
- public void setMemberId(String memberId) {
- this.memberId = memberId;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getMemberIp() {
- return memberIp;
- }
-
- public void setMemberIp(String memberIp) {
- this.memberIp = memberIp;
- }
-
- public String getLbClusterId() {
- return lbClusterId;
- }
-
- public void setLbClusterId(String lbClusterId) {
- this.lbClusterId = lbClusterId;
- }
-
- public String getMemberPublicIp() {
- return memberPublicIp;
- }
-
- public void setMemberPublicIp(String memberPublicIp) {
- this.memberPublicIp = memberPublicIp;
- }
-
- public List<PropertyBean> getProperty() {
- return property;
- }
-
- public void setProperty(List<PropertyBean> property) {
- this.property = property;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/MemberStatus.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/MemberStatus.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/MemberStatus.java
deleted file mode 100644
index 6535ff9..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/MemberStatus.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.apache.stratos.cli.beans.topology;
-/*
- *
- * 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.
- *
-*/
-
-
-public enum MemberStatus {
- Created, Starting, Activated, Suspended, ReadyToShutDown, ShuttingDown, Terminated
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/Port.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/Port.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/Port.java
deleted file mode 100644
index 398c3cd..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/topology/Port.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package org.apache.stratos.cli.beans.topology;
-/*
- *
- * 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.
- *
-*/
-
-
-public class Port {
- private static final long serialVersionUID = -2530288421360188256L;
- private String protocol;
- private int value;
- private int proxy;
-
- public Port(String protocol, int value, int proxy) {
- setProtocol(protocol);
- setValue(value);
- setProxy(proxy);
- }
-
- public String getProtocol() {
- return protocol;
- }
-
- public void setProtocol(String protocol) {
- this.protocol = protocol;
- }
-
- public int getValue() {
- return value;
- }
-
- public void setValue(int value) {
- this.value = value;
- }
-
- public int getProxy() {
- return proxy;
- }
-
- public void setProxy(int proxy) {
- this.proxy = proxy;
- }
-
- @Override
- public String toString() {
- return "Port [protocol=" + protocol + ", value=" + value + ", proxy=" + proxy + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribePartitionCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribePartitionCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribePartitionCommand.java
deleted file mode 100644
index 3709f4d..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/DescribePartitionCommand.java
+++ /dev/null
@@ -1,70 +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.commands;
-
-import org.apache.commons.cli.Options;
-import org.apache.stratos.cli.Command;
-import org.apache.stratos.cli.RestCommandLineService;
-import org.apache.stratos.cli.StratosCommandContext;
-import org.apache.stratos.cli.exception.CommandException;
-import org.apache.stratos.cli.utils.CliConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DescribePartitionCommand implements Command<StratosCommandContext> {
- private static final Logger logger = LoggerFactory.getLogger(DescribePartitionCommand.class);
-
- @Override
- public String getName() {
- return CliConstants.DESCRIBE_PARTITION;
- }
-
- @Override
- public String getDescription() {
- return "Describing the partition";
- }
-
- @Override
- public String getArgumentSyntax() {
- return "[Id]";
- }
-
- @Override
- public Options getOptions() {
- return null;
- }
-
- @Override
- public int execute(StratosCommandContext context, String[] args) throws CommandException {
- if (logger.isDebugEnabled()) {
- logger.debug("Executing {} command...", getName());
- }
- if (args != null && args.length == 1) {
- String id = args[0];
- if (logger.isDebugEnabled()) {
- logger.debug("Getting Partition info {}", id);
- }
- RestCommandLineService.getInstance().describePartition(id);
- return CliConstants.COMMAND_SUCCESSFULL;
- } else {
- context.getStratosApplication().printUsage(getName());
- return CliConstants.COMMAND_FAILED;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgeSubscriptionsCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgeSubscriptionsCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgeSubscriptionsCommand.java
deleted file mode 100644
index 01ff583..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/ListCartridgeSubscriptionsCommand.java
+++ /dev/null
@@ -1,120 +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.commands;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.GnuParser;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.stratos.cli.RestCommandLineService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.stratos.cli.Command;
-import org.apache.stratos.cli.StratosCommandContext;
-import org.apache.stratos.cli.exception.CommandException;
-import org.apache.stratos.cli.utils.CliConstants;
-
-@Deprecated
-public class ListCartridgeSubscriptionsCommand implements Command<StratosCommandContext> {
-
- private static final Logger logger = LoggerFactory.getLogger(ListCartridgeSubscriptionsCommand.class);
-
- private final Options options;
-
- public ListCartridgeSubscriptionsCommand() {
- options = constructOptions();
- }
-
- /**
- * Construct Options.
- *
- * @return Options expected from command-line.
- */
- private Options constructOptions() {
- final Options options = new Options();
- Option fullOption = new Option(CliConstants.FULL_OPTION, CliConstants.FULL_LONG_OPTION, false,
- "Display extra details");
- options.addOption(fullOption);
- return options;
- }
-
- public String getName() {
- return "list-cartridge-subscriptions";
- }
-
- public String getDescription() {
- return "List cartridge subscriptions";
- }
-
- public String getArgumentSyntax() {
- return null;
- }
-
- public int execute(StratosCommandContext context, String[] args) throws CommandException {
- if (logger.isDebugEnabled()) {
- logger.debug("Executing {} command...", getName());
- }
- if (args == null || args.length == 0) {
- RestCommandLineService.getInstance().listCartridgeSubscriptions(false);
- //CommandLineService.getInstance().listCartridgeSubscriptions(false);
- return CliConstants.COMMAND_SUCCESSFULL;
- } else if (args != null && args.length > 0) {
- String[] remainingArgs = null;
- boolean full = false;
- final CommandLineParser parser = new GnuParser();
- CommandLine commandLine;
- try {
- commandLine = parser.parse(options, args);
- remainingArgs = commandLine.getArgs();
- if (!(remainingArgs == null || remainingArgs.length == 0)) {
- context.getStratosApplication().printUsage(getName());
- return CliConstants.COMMAND_FAILED;
- }
-
- if (commandLine.hasOption(CliConstants.FULL_OPTION)) {
- if (logger.isTraceEnabled()) {
- logger.trace("Full option is passed");
- }
- full = true;
- }
- if (logger.isDebugEnabled()) {
- logger.debug("Listing subscribed cartridges, Full Option: {}", full);
- }
- RestCommandLineService.getInstance().listCartridgeSubscriptions(full);
- return CliConstants.COMMAND_SUCCESSFULL;
- } catch (ParseException e) {
- if (logger.isErrorEnabled()) {
- logger.error("Error parsing arguments", e);
- }
- System.out.println(e.getMessage());
- return CliConstants.COMMAND_FAILED;
- }
- } else {
- context.getStratosApplication().printUsage(getName());
- return CliConstants.COMMAND_FAILED;
- }
- }
-
- public Options getOptions() {
- return options;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/ApplicationBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/ApplicationBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/ApplicationBean.java
new file mode 100644
index 0000000..7eb94e5
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/ApplicationBean.java
@@ -0,0 +1,75 @@
+package org.apache.stratos.common.beans;
+
+import org.apache.stratos.common.beans.topology.Cluster;
+import org.apache.stratos.common.beans.topology.Instance;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@XmlRootElement(name="applications")
+public class ApplicationBean {
+ private String id;
+ private String tenantDomain;
+ private String tenantAdminUsername;
+ private List<GroupBean> groups = null;
+ private List<Cluster> clusters = null;
+ private List<Instance> instances;
+
+
+ public ApplicationBean(){
+ this.setGroups(new ArrayList<GroupBean>());
+ this.setClusters(new ArrayList<Cluster>());
+ }
+ public void addGroup(GroupBean groupBean) {
+ this.getGroups().add(groupBean);
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public void setTenantDomain(String tenantDomain) {
+ this.tenantDomain = tenantDomain;
+ }
+
+ public void setTenantAdminUsername(String tenantAdminUsername) {
+ this.tenantAdminUsername = tenantAdminUsername;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getTenantDomain() {
+ return tenantDomain;
+ }
+
+ public String getTenantAdminUsername() {
+ return tenantAdminUsername;
+ }
+ public List<Instance> getInstances() {
+ return instances;
+ }
+ public void setInstances(List<Instance> instances) {
+ this.instances = instances;
+ }
+
+
+ public List<GroupBean> getGroups() {
+ return groups;
+ }
+
+ public void setGroups(List<GroupBean> groups) {
+ this.groups = groups;
+ }
+
+ public List<Cluster> getClusters() {
+ return clusters;
+ }
+
+ public void setClusters(List<Cluster> clusters) {
+ this.clusters = clusters;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/CartridgeInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/CartridgeInfoBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/CartridgeInfoBean.java
new file mode 100644
index 0000000..0d3af03
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/CartridgeInfoBean.java
@@ -0,0 +1,167 @@
+/**
+ * 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.common.beans;
+
+import org.apache.stratos.common.beans.cartridge.definition.PersistenceBean;
+import org.apache.stratos.common.beans.cartridge.definition.PropertyBean;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
+
+@XmlRootElement
+public class CartridgeInfoBean {
+ String cartridgeType;
+ String alias;
+ String autoscalePolicy;
+ String deploymentPolicy;
+ String repoURL;
+ boolean privateRepo;
+ String repoUsername;
+ String repoPassword;
+ String dataCartridgeType;
+ String dataCartridgeAlias;
+ boolean commitsEnabled;
+
+ private String serviceGroup;
+
+ private PersistenceBean persistence;
+
+ private List<PropertyBean> property;
+
+ private List<String> domains;
+
+ public CartridgeInfoBean() {
+ this.domains = new ArrayList<String>();
+ }
+
+ 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 getAutoscalePolicy() {
+ return autoscalePolicy;
+ }
+
+ public void setAutoscalePolicy(String autoscalePolicy) {
+ this.autoscalePolicy = autoscalePolicy;
+ }
+
+ 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 getDeploymentPolicy() {
+ return deploymentPolicy;
+ }
+
+ public void setDeploymentPolicy(String deploymentPolicy) {
+ this.deploymentPolicy = deploymentPolicy;
+ }
+
+ public boolean isCommitsEnabled() {
+ return commitsEnabled;
+ }
+
+ public void setCommitsEnabled(boolean commitsEnabled) {
+ this.commitsEnabled = commitsEnabled;
+ }
+
+ public String getServiceGroup() {
+ return serviceGroup;
+ }
+
+ public void setServiceGroup(String serviceGroup) {
+ this.serviceGroup = serviceGroup;
+ }
+
+ public PersistenceBean getPersistence() {
+ return persistence;
+ }
+
+ public void setPersistence(PersistenceBean persistence) {
+ this.persistence = persistence;
+ }
+
+ public List<PropertyBean> getProperty() {
+ return property;
+ }
+
+ public void setProperty(List<PropertyBean> property) {
+ this.property = property;
+ }
+ public List<String> getDomains() { return domains; }
+
+ public void setDomains(List<String> domains) { this.domains = domains; }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/Error.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/Error.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/Error.java
new file mode 100644
index 0000000..568c7e0
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/Error.java
@@ -0,0 +1,45 @@
+/*
+ *
+ * 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.common.beans;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "error")
+public class Error {
+ private int errorCode;
+ private String errorMessage;
+
+ public int getErrorCode() {
+ return errorCode;
+ }
+
+ public void setErrorCode(int errorCode) {
+ this.errorCode = errorCode;
+ }
+
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ public void setErrorMessage(String errorMessage) {
+ this.errorMessage = errorMessage;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/GroupBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/GroupBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/GroupBean.java
new file mode 100644
index 0000000..7ed3cd4
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/GroupBean.java
@@ -0,0 +1,99 @@
+/*
+ * 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.common.beans;
+
+import org.apache.stratos.common.beans.topology.Cluster;
+import org.apache.stratos.common.beans.topology.Instance;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@XmlRootElement(name="groups")
+public class GroupBean {
+ private List<GroupBean> subGroups = null;
+ private List<Cluster> clusters = null;
+ private String alias;
+ private String deploymentPolicy;
+ private String autoScalingPolicy;
+ private List<Instance> instances;
+
+ public GroupBean(){
+ this.setClusters(new ArrayList<Cluster>());
+ this.setSubGroups(new ArrayList<GroupBean>());
+ }
+
+ public void addGroup(GroupBean groupBean){
+ getSubGroups().add(groupBean);
+ }
+ public void addCluster(Cluster cluster){
+ getClusters().add(cluster);
+ }
+
+ public List<GroupBean> getSubGroups() {
+ return subGroups;
+ }
+
+ public void setSubGroups(List<GroupBean> subGroups) {
+ this.subGroups = subGroups;
+ }
+
+ public List<Cluster> getClusters() {
+ return clusters;
+ }
+
+ public void setClusters(List<Cluster> clusters) {
+ this.clusters = clusters;
+ }
+
+ public void setAlias(String alias) {
+ this.alias = alias;
+ }
+
+ public void setDeploymentPolicy(String deploymentPolicy) {
+ this.deploymentPolicy = deploymentPolicy;
+ }
+
+ public void setAutoScalingPolicy(String autoScalingPolicy) {
+ this.autoScalingPolicy = autoScalingPolicy;
+ }
+
+ public String getAlias() {
+ return alias;
+ }
+
+ public String getDeploymentPolicy() {
+ return deploymentPolicy;
+ }
+
+ public String getAutoScalingPolicy() {
+ return autoScalingPolicy;
+ }
+
+ public List<Instance> getInstances() {
+ return instances;
+ }
+
+ public void setInstances(List<Instance> instances) {
+ this.instances = instances;
+ }
+
+
+}
[2/7] stratos git commit: Moving rest api domain model to stratos
common component to be reused by the cli
Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/converter/PojoConverter.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/converter/PojoConverter.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/converter/PojoConverter.java
deleted file mode 100644
index 036ccf7..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/converter/PojoConverter.java
+++ /dev/null
@@ -1,1255 +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.rest.endpoint.bean.util.converter;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.List;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.stratos.autoscaler.stub.deployment.partition.ChildLevelNetworkPartition;
-import org.apache.stratos.autoscaler.stub.deployment.partition.ChildLevelPartition;
-import org.apache.stratos.autoscaler.stub.deployment.policy.ChildPolicy;
-import org.apache.stratos.autoscaler.stub.pojo.ApplicationContext;
-import org.apache.stratos.autoscaler.stub.pojo.CartridgeContext;
-import org.apache.stratos.autoscaler.stub.pojo.DependencyContext;
-import org.apache.stratos.autoscaler.stub.pojo.GroupContext;
-import org.apache.stratos.autoscaler.stub.pojo.SubscribableInfoContext;
-import org.apache.stratos.cloud.controller.stub.domain.CartridgeConfig;
-import org.apache.stratos.cloud.controller.stub.domain.Container;
-import org.apache.stratos.cloud.controller.stub.domain.FloatingNetwork;
-import org.apache.stratos.cloud.controller.stub.domain.FloatingNetworks;
-import org.apache.stratos.cloud.controller.stub.domain.IaasConfig;
-import org.apache.stratos.cloud.controller.stub.domain.LoadbalancerConfig;
-import org.apache.stratos.cloud.controller.stub.domain.NetworkInterface;
-import org.apache.stratos.cloud.controller.stub.domain.NetworkInterfaces;
-import org.apache.stratos.cloud.controller.stub.domain.Persistence;
-import org.apache.stratos.cloud.controller.stub.domain.PortMapping;
-import org.apache.stratos.cloud.controller.stub.domain.ServiceGroup;
-import org.apache.stratos.cloud.controller.stub.domain.Volume;
-import org.apache.stratos.common.Properties;
-import org.apache.stratos.common.Property;
-import org.apache.stratos.manager.composite.application.beans.ApplicationDefinition;
-import org.apache.stratos.manager.composite.application.beans.CartridgeDefinition;
-import org.apache.stratos.manager.composite.application.beans.GroupDefinition;
-import org.apache.stratos.manager.composite.application.beans.SubscribableInfo;
-import org.apache.stratos.manager.deploy.service.Service;
-import org.apache.stratos.manager.grouping.definitions.DependencyDefinitions;
-import org.apache.stratos.manager.grouping.definitions.ServiceGroupDefinition;
-import org.apache.stratos.manager.subscription.SubscriptionDomain;
-import org.apache.stratos.messaging.domain.applications.Application;
-import org.apache.stratos.messaging.domain.applications.Group;
-import org.apache.stratos.messaging.domain.instance.ApplicationInstance;
-import org.apache.stratos.messaging.domain.instance.ClusterInstance;
-import org.apache.stratos.messaging.domain.instance.GroupInstance;
-import org.apache.stratos.messaging.domain.topology.Cluster;
-import org.apache.stratos.rest.endpoint.bean.ApplicationBean;
-import org.apache.stratos.rest.endpoint.bean.GroupBean;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.ApplicationLevelNetworkPartition;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.Partition;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.AutoscalePolicy;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.LoadAverageThresholds;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.LoadThresholds;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.MemoryConsumptionThresholds;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.RequestsInFlightThresholds;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.CartridgeDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.ContainerBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.FloatingNetworkBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.IaasProviderBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.LoadBalancerBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.NetworkInterfaceBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PersistenceBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PortMappingBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PropertyBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.ServiceDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.VolumeBean;
-import org.apache.stratos.rest.endpoint.bean.kubernetes.KubernetesGroup;
-import org.apache.stratos.rest.endpoint.bean.kubernetes.KubernetesHost;
-import org.apache.stratos.rest.endpoint.bean.kubernetes.KubernetesMaster;
-import org.apache.stratos.rest.endpoint.bean.kubernetes.PortRange;
-import org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean;
-import org.apache.stratos.rest.endpoint.bean.topology.Instance;
-import org.apache.stratos.rest.endpoint.bean.topology.Member;
-
-public class PojoConverter {
-
- public static CartridgeConfig populateCartridgeConfigPojo(CartridgeDefinitionBean cartridgeDefinitionBean) {
-
- CartridgeConfig cartridgeConfig = new CartridgeConfig();
-
- cartridgeConfig.setType(cartridgeDefinitionBean.getType());
- cartridgeConfig.setHostName(cartridgeDefinitionBean.getHost());
- cartridgeConfig.setProvider(cartridgeDefinitionBean.getProvider());
- cartridgeConfig.setCategory(cartridgeDefinitionBean.getCategory());
- cartridgeConfig.setVersion(cartridgeDefinitionBean.getVersion());
- cartridgeConfig.setMultiTenant(cartridgeDefinitionBean.isMultiTenant());
- cartridgeConfig.setIsPublic(cartridgeDefinitionBean.isPublic());
- cartridgeConfig.setDisplayName(cartridgeDefinitionBean.getDisplayName());
- cartridgeConfig.setDescription(cartridgeDefinitionBean.getDescription());
- cartridgeConfig.setDefaultAutoscalingPolicy(cartridgeDefinitionBean.getDefaultAutoscalingPolicy());
- cartridgeConfig.setDefaultDeploymentPolicy(cartridgeDefinitionBean.getDefaultDeploymentPolicy());
- cartridgeConfig.setServiceGroup(cartridgeDefinitionBean.getServiceGroup());
- cartridgeConfig.setDeployerType(cartridgeDefinitionBean.getDeployerType());
-
-
- //deployment information
- if (cartridgeDefinitionBean.getDeployment() != null) {
- cartridgeConfig.setBaseDir(cartridgeDefinitionBean.getDeployment().baseDir);
- if (cartridgeDefinitionBean.getDeployment().dir != null && !cartridgeDefinitionBean.getDeployment().dir.isEmpty()) {
- cartridgeConfig.setDeploymentDirs(cartridgeDefinitionBean.getDeployment().dir.
- toArray(new String[cartridgeDefinitionBean.getDeployment().dir.size()]));
- }
- }
- //port mapping
- if (cartridgeDefinitionBean.getPortMapping() != null && !cartridgeDefinitionBean.getPortMapping().isEmpty()) {
- cartridgeConfig.setPortMappings(getPortMappingsAsArray(cartridgeDefinitionBean.getPortMapping()));
- }
-
- //persistance mapping
- if (cartridgeDefinitionBean.getPersistence() != null) {
- cartridgeConfig.setPersistence(getPersistence(cartridgeDefinitionBean.getPersistence()));
- }
-
- //IaaS
- if (cartridgeDefinitionBean.getIaasProvider() != null && !cartridgeDefinitionBean.getIaasProvider().isEmpty()) {
- cartridgeConfig.setIaasConfigs(getIaasConfigsAsArray(cartridgeDefinitionBean.getIaasProvider()));
- }
- //Properties
- if (cartridgeDefinitionBean.getProperty() != null && !cartridgeDefinitionBean.getProperty().isEmpty()) {
- cartridgeConfig.setProperties(getCCProperties(cartridgeDefinitionBean.getProperty()));
- }
-
- if (cartridgeDefinitionBean.getExportingProperties() != null) {
- cartridgeConfig.setExportingProperties(cartridgeDefinitionBean.getExportingProperties());
- }
-
- if (cartridgeDefinitionBean.getContainer() != null) {
- cartridgeConfig.setContainer(getContainer(cartridgeDefinitionBean.getContainer()));
- }
-
- return cartridgeConfig;
- }
-
- public static ServiceGroup populateServiceGroupPojo(ServiceGroupDefinition serviceGroupDefinition) {
- ServiceGroup servicegroup = new ServiceGroup();
-
- return servicegroup;
- }
-
- private static Container getContainer(ContainerBean container) {
- Container cn = new Container();
- cn.setDockerFileRepo(container.dockerfileRepo);
- cn.setImageName(container.imageName);
- //cn.setProperties(getProperties(container.property));
- return cn;
- }
-
- private static LoadbalancerConfig getLBConfig(LoadBalancerBean loadBalancer) {
- LoadbalancerConfig lbConfig = new LoadbalancerConfig();
- lbConfig.setType(loadBalancer.type);
- if (loadBalancer.property != null && !loadBalancer.property.isEmpty()) {
- lbConfig.setProperties(getCCProperties(loadBalancer.property));
- }
- return lbConfig;
- }
-
- private static PortMapping[] getPortMappingsAsArray(List<PortMappingBean> portMappingBeans) {
-
- //convert to an array
- PortMappingBean[] portMappingBeanArray = new PortMappingBean[portMappingBeans.size()];
- portMappingBeans.toArray(portMappingBeanArray);
- PortMapping[] portMappingArray = new PortMapping[portMappingBeanArray.length];
-
- for (int i = 0; i < portMappingBeanArray.length; i++) {
- PortMapping portMapping = new PortMapping();
- portMapping.setProtocol(portMappingBeanArray[i].protocol);
- portMapping.setPort(Integer.toString(portMappingBeanArray[i].port));
- portMapping.setProxyPort(Integer.toString(portMappingBeanArray[i].proxyPort));
- portMappingArray[i] = portMapping;
- }
-
- return portMappingArray;
- }
-
- private static IaasConfig[] getIaasConfigsAsArray(List<IaasProviderBean> iaasProviderBeans) {
-
- //convert to an array
- IaasProviderBean[] iaasProviderBeansArray = new IaasProviderBean[iaasProviderBeans.size()];
- iaasProviderBeans.toArray(iaasProviderBeansArray);
- IaasConfig[] iaasConfigsArray = new IaasConfig[iaasProviderBeansArray.length];
-
- for (int i = 0; i < iaasProviderBeansArray.length; i++) {
- IaasConfig iaasConfig = new IaasConfig();
- iaasConfig.setType(iaasProviderBeansArray[i].type);
- iaasConfig.setImageId(iaasProviderBeansArray[i].imageId);
- iaasConfig.setMaxInstanceLimit(iaasProviderBeansArray[i].maxInstanceLimit);
- iaasConfig.setName(iaasProviderBeansArray[i].name);
- iaasConfig.setClassName(iaasProviderBeansArray[i].className);
- iaasConfig.setCredential(iaasProviderBeansArray[i].credential);
- iaasConfig.setIdentity(iaasProviderBeansArray[i].identity);
- iaasConfig.setProvider(iaasProviderBeansArray[i].provider);
-
- if (iaasProviderBeansArray[i].property != null && !iaasProviderBeansArray[i].property.isEmpty()) {
- //set the Properties instance to IaasConfig instance
- iaasConfig.setProperties(getCCProperties(iaasProviderBeansArray[i].property));
- }
-
- if (iaasProviderBeansArray[i].networkInterfaces != null && !iaasProviderBeansArray[i].networkInterfaces.isEmpty()) {
- iaasConfig.setNetworkInterfaces(PojoConverter.getNetworkInterfaces(iaasProviderBeansArray[i].networkInterfaces));
- }
-
- iaasConfigsArray[i] = iaasConfig;
- }
- return iaasConfigsArray;
- }
-
- public static Persistence getPersistence(PersistenceBean persistenceBean) {
- Persistence persistence = new Persistence();
- persistence.setPersistanceRequired(persistenceBean.isRequired());
- VolumeBean[] volumeBean = new VolumeBean[persistenceBean.getVolume().size()];
- persistenceBean.getVolume().toArray(volumeBean);
- Volume[] volumes = new Volume[persistenceBean.getVolume().size()];
- for (int i = 0; i < volumes.length; i++) {
- Volume volume = new Volume();
- volume.setId(volumeBean[i].getId());
- volume.setVolumeId(volumeBean[i].getVolumeId());
- if (StringUtils.isEmpty(volume.getVolumeId())) {
- volume.setSize(Integer.parseInt(volumeBean[i].getSize()));
- }
-
- volume.setDevice(volumeBean[i].getDevice());
- volume.setRemoveOntermination(volumeBean[i].isRemoveOnTermination());
- volume.setMappingPath(volumeBean[i].getMappingPath());
- volume.setSnapshotId(volumeBean[i].getSnapshotId());
-
- volumes[i] = volume;
- }
- persistence.setVolumes(volumes);
- return persistence;
-
- }
-
- public static Properties getProperties(List<PropertyBean> propertyBeans) {
-
- //convert to an array
- PropertyBean[] propertyBeansArray = new PropertyBean[propertyBeans.size()];
- propertyBeans.toArray(propertyBeansArray);
- Property[] propertyArray = new Property[propertyBeansArray.length];
-
- for (int j = 0; j < propertyBeansArray.length; j++) {
- Property property = new Property();
- property.setName(propertyBeansArray[j].name);
- property.setValue(propertyBeansArray[j].value);
- propertyArray[j] = property;
- }
-
- Properties properties = new Properties();
- properties.setProperties(propertyArray);
- return properties;
- }
-
- public static org.apache.stratos.cloud.controller.stub.Properties getCCProperties(List<PropertyBean> propertyBeans) {
-
- //convert to an array
- PropertyBean[] propertyBeansArray = new PropertyBean[propertyBeans.size()];
- propertyBeans.toArray(propertyBeansArray);
- org.apache.stratos.cloud.controller.stub.Property[] propertyArray = new org.apache.stratos.cloud.controller.stub.Property[propertyBeansArray.length];
-
- for (int j = 0; j < propertyBeansArray.length; j++) {
- org.apache.stratos.cloud.controller.stub.Property property = new org.apache.stratos.cloud.controller.stub.Property();
- property.setName(propertyBeansArray[j].name);
- property.setValue(propertyBeansArray[j].value);
- propertyArray[j] = property;
- }
-
- org.apache.stratos.cloud.controller.stub.Properties properties = new org.apache.stratos.cloud.controller.stub.Properties();
- properties.setProperties(propertyArray);
- return properties;
- }
-
-
- public static org.apache.stratos.autoscaler.stub.Properties getASProperties(List<PropertyBean> propertyBeans) {
- if (propertyBeans == null || propertyBeans.isEmpty()) {
- return null;
- }
-
- //convert to an array
- PropertyBean[] propertyBeansArray = new PropertyBean[propertyBeans.size()];
- propertyBeans.toArray(propertyBeansArray);
- org.apache.stratos.autoscaler.stub.Property[] propertyArray = new org.apache.stratos.autoscaler.stub.Property[propertyBeansArray.length];
-
- for (int j = 0; j < propertyBeansArray.length; j++) {
- org.apache.stratos.autoscaler.stub.Property property = new org.apache.stratos.autoscaler.stub.Property();
- property.setName(propertyBeansArray[j].name);
- property.setValue(propertyBeansArray[j].value);
- propertyArray[j] = property;
- }
-
- org.apache.stratos.autoscaler.stub.Properties properties = new org.apache.stratos.autoscaler.stub.Properties();
- properties.setProperties(propertyArray);
- return properties;
- }
-
- private static NetworkInterfaces getNetworkInterfaces(List<NetworkInterfaceBean> networkInterfaceBeans) {
- NetworkInterface[] networkInterfacesArray = new NetworkInterface[networkInterfaceBeans.size()];
-
- int i = 0;
- for (NetworkInterfaceBean nib : networkInterfaceBeans) {
- NetworkInterface networkInterface = new NetworkInterface();
- networkInterface.setNetworkUuid(nib.networkUuid);
- networkInterface.setFixedIp(nib.fixedIp);
- networkInterface.setPortUuid(nib.portUuid);
- if (nib.floatingNetworks != null && !nib.floatingNetworks.isEmpty()) {
- networkInterface.setFloatingNetworks(PojoConverter.getFloatingNetworks(nib.floatingNetworks));
- }
-
- networkInterfacesArray[i++] = networkInterface;
- }
-
- NetworkInterfaces networkInterfaces = new NetworkInterfaces();
- networkInterfaces.setNetworkInterfaces(networkInterfacesArray);
- return networkInterfaces;
- }
-
- private static FloatingNetworks getFloatingNetworks(List<FloatingNetworkBean> floatingNetworkBeans) {
-
- FloatingNetwork[] floatingNetworksArray = new FloatingNetwork[floatingNetworkBeans.size()];
-
- int i =0;
- for (FloatingNetworkBean floatingNetworkBean : floatingNetworkBeans) {
- FloatingNetwork floatingNetwork = new FloatingNetwork();
- floatingNetwork.setName(floatingNetworkBean.name);
- floatingNetwork.setNetworkUuid(floatingNetworkBean.networkUuid);
- floatingNetwork.setFloatingIP(floatingNetworkBean.floatingIP);
- floatingNetworksArray[i++] = floatingNetwork;
- }
-
- FloatingNetworks floatingNetworks = new FloatingNetworks();
- floatingNetworks.setFloatingNetworks(floatingNetworksArray);
- return floatingNetworks;
- }
-
- public static org.apache.stratos.autoscaler.stub.deployment.partition.Partition convertToCCPartitionPojo
- (Partition partitionBean) {
-
- org.apache.stratos.autoscaler.stub.deployment.partition.Partition partition = new
- org.apache.stratos.autoscaler.stub.deployment.partition.Partition();
-
- partition.setId(partitionBean.id);
- partition.setDescription(partitionBean.description);
- partition.setIsPublic(partitionBean.isPublic);
- partition.setProvider(partitionBean.provider);
-
- if (partitionBean.property != null && !partitionBean.property.isEmpty()) {
- partition.setProperties(getASProperties(partitionBean.property));
- }
-
- return partition;
- }
-
- public static org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy convertToCCAutoscalerPojo(AutoscalePolicy
- autoscalePolicyBean) {
-
- org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy autoscalePolicy = new
- org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy();
-
- autoscalePolicy.setId(autoscalePolicyBean.getId());
- autoscalePolicy.setDescription(autoscalePolicyBean.getDescription());
- autoscalePolicy.setIsPublic(autoscalePolicyBean.getIsPublic());
- autoscalePolicy.setDisplayName(autoscalePolicyBean.getDisplayName());
- autoscalePolicy.setInstanceRoundingFactor(autoscalePolicyBean.getInstanceRoundingFactor());
-
- if (autoscalePolicyBean.getLoadThresholds() != null) {
-
- org.apache.stratos.autoscaler.stub.autoscale.policy.LoadThresholds loadThresholds = new
- org.apache.stratos.autoscaler.stub.autoscale.policy.LoadThresholds();
-
- if (autoscalePolicyBean.getLoadThresholds().loadAverage != null) {
-
- //set load average information
- org.apache.stratos.autoscaler.stub.autoscale.policy.LoadAverageThresholds loadAverage = new
- org.apache.stratos.autoscaler.stub.autoscale.policy.LoadAverageThresholds();
- loadAverage.setUpperLimit(autoscalePolicyBean.getLoadThresholds().loadAverage.threshold);
- loadAverage.setLowerLimit(autoscalePolicyBean.getLoadThresholds().loadAverage.lowerLimit);
- //set load average
- loadThresholds.setLoadAverage(loadAverage);
- }
- if (autoscalePolicyBean.getLoadThresholds().requestsInFlight != null) {
-
- org.apache.stratos.autoscaler.stub.autoscale.policy.RequestsInFlightThresholds requestsInFlight = new
- org.apache.stratos.autoscaler.stub.autoscale.policy.RequestsInFlightThresholds();
- //set request in flight information
- requestsInFlight.setUpperLimit(autoscalePolicyBean.getLoadThresholds().requestsInFlight.threshold);
- requestsInFlight.setLowerLimit(autoscalePolicyBean.getLoadThresholds().requestsInFlight.lowerLimit);
- //set request in flight
- loadThresholds.setRequestsInFlight(requestsInFlight);
- }
- if (autoscalePolicyBean.getLoadThresholds().memoryConsumption != null) {
-
- org.apache.stratos.autoscaler.stub.autoscale.policy.MemoryConsumptionThresholds memoryConsumption = new
- org.apache.stratos.autoscaler.stub.autoscale.policy.MemoryConsumptionThresholds();
-
- //set memory consumption information
- memoryConsumption.setUpperLimit(autoscalePolicyBean.getLoadThresholds().memoryConsumption.threshold);
- memoryConsumption.setLowerLimit(autoscalePolicyBean.getLoadThresholds().memoryConsumption.lowerLimit);
- //set memory consumption
- loadThresholds.setMemoryConsumption(memoryConsumption);
- }
-
- autoscalePolicy.setLoadThresholds(loadThresholds);
- }
-
- return autoscalePolicy;
- }
-
- public static org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy convetToASDeploymentPolicyPojo(
- DeploymentPolicy deploymentPolicyBean) {
-
- org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy deploymentPolicy =
- new org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy();
-
- deploymentPolicy.setId(deploymentPolicyBean.id);
- deploymentPolicy.setDescription(deploymentPolicyBean.description);
- deploymentPolicy.setIsPublic(deploymentPolicyBean.isPublic);
- if (deploymentPolicyBean.applicationPolicy != null
- && deploymentPolicyBean.applicationPolicy.networkPartition != null
- && !deploymentPolicyBean.applicationPolicy.networkPartition.isEmpty()) {
- deploymentPolicy
- .setApplicationLevelNetworkPartitions(convertToCCPartitionGroup(deploymentPolicyBean.applicationPolicy.networkPartition));
- deploymentPolicy.setApplicationId(deploymentPolicyBean.applicationPolicy.applicationId);
- }
-
- if (deploymentPolicyBean.childPolicies != null && !deploymentPolicyBean.childPolicies.isEmpty()) {
- deploymentPolicy.setChildPolicies(convertToCCChildPolicy(deploymentPolicyBean.childPolicies));
- }
-
- return deploymentPolicy;
- }
-
- private static org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition[] convertToCCPartitionGroup(List<ApplicationLevelNetworkPartition> networkPartitionBeans) {
-
- org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition[]
- appNWPartitions = new
- org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition
- [networkPartitionBeans.size()];
-
- for (int i = 0; i < networkPartitionBeans.size(); i++) {
- org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition appNWPartition = new
- org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition();
- appNWPartition.setId(networkPartitionBeans.get(i).id);
- appNWPartition.setActiveByDefault(networkPartitionBeans.get(i).activeByDefault);
- if (networkPartitionBeans.get(i).partitions != null && !networkPartitionBeans.get(i).partitions.isEmpty()) {
- appNWPartition.setPartitions(convertToCCPartitionPojos(networkPartitionBeans.get(i).partitions));
- }
-
- appNWPartitions[i] = appNWPartition;
- }
-
- return appNWPartitions;
- }
-
- private static ChildPolicy[] convertToCCChildPolicy(List<org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.ChildPolicy> childPolicies) {
-
- ChildPolicy[] childPolicies1 = new ChildPolicy[childPolicies.size()];
-
- for (int i = 0; i < childPolicies.size(); i++) {
- ChildPolicy childPolicy = new ChildPolicy();
- childPolicy.setId(childPolicies.get(i).childId);
- childPolicy.setChildLevelNetworkPartitions(convertToCCChildNetworkPartition(childPolicies.get(i).networkPartition));
-
-
- childPolicies1[i] = childPolicy;
- }
-
- return childPolicies1;
- }
-
- private static ChildLevelNetworkPartition[] convertToCCChildNetworkPartition(List<org.apache.stratos.rest.endpoint.bean.autoscaler.partition.ChildLevelNetworkPartition> networkPartitions) {
-
- ChildLevelNetworkPartition[] childLevelNetworkPartitions = new ChildLevelNetworkPartition[networkPartitions.size()];
-
- for (int i = 0; i < networkPartitions.size(); i++) {
- ChildLevelNetworkPartition childLevelNetworkPartition = new ChildLevelNetworkPartition();
- childLevelNetworkPartition.setId(networkPartitions.get(i).id);
- childLevelNetworkPartition.setPartitionAlgo(networkPartitions.get(i).partitionAlgo);
- childLevelNetworkPartition.setChildLevelPartitions(convertToCCChildPartitionPojos(networkPartitions.get(i).partitions));
-
- childLevelNetworkPartitions[i] = childLevelNetworkPartition;
- }
-
- return childLevelNetworkPartitions;
- }
-
- public static org.apache.stratos.rest.endpoint.bean.topology.Cluster populateClusterPojos(Cluster cluster, String alias) {
- org.apache.stratos.rest.endpoint.bean.topology.Cluster cluster1 = new
- org.apache.stratos.rest.endpoint.bean.topology.Cluster();
- cluster1.alias = alias;
- cluster1.serviceName = cluster.getServiceName();
- cluster1.clusterId = cluster.getClusterId();
- cluster1.isLbCluster = cluster.isLbCluster();
- cluster1.tenantRange = cluster.getTenantRange();
- cluster1.property = getPropertyBeans(cluster.getProperties());
- cluster1.member = new ArrayList<Member>();
- cluster1.hostNames = new ArrayList<String>();
- Collection<ClusterInstance> clusterInstances = cluster.getClusterInstances();
- List<org.apache.stratos.rest.endpoint.bean.topology.Instance> instancesList =
- new ArrayList<org.apache.stratos.rest.endpoint.bean.topology.Instance>();
- if (clusterInstances != null) {
- for (ClusterInstance clusterInstance : clusterInstances) {
- org.apache.stratos.rest.endpoint.bean.topology.Instance instance =
- new org.apache.stratos.rest.endpoint.bean.topology.Instance();
- instance.instanceId = clusterInstance.getInstanceId();
- instance.status = clusterInstance.getStatus().toString();
- instancesList.add(instance);
- }
- cluster1.setInstances(instancesList);
- }
-
- for (org.apache.stratos.messaging.domain.topology.Member tmp : cluster.getMembers()) {
- Member member = new Member();
- member.clusterId = tmp.getClusterId();
- member.lbClusterId = tmp.getLbClusterId();
- member.networkPartitionId = tmp.getNetworkPartitionId();
- member.partitionId = tmp.getPartitionId();
- member.memberId = tmp.getMemberId();
- if (tmp.getMemberIp() == null) {
- member.memberIp = "NULL";
- } else {
- member.memberIp = tmp.getMemberIp();
- }
- if (tmp.getMemberPublicIp() == null) {
- member.memberPublicIp = "NULL";
- } else {
- member.memberPublicIp = tmp.getMemberPublicIp();
- }
- member.serviceName = tmp.getServiceName();
- member.status = tmp.getStatus().toString();
- member.property = getPropertyBeans(tmp.getProperties());
- cluster1.member.add(member);
- }
-
- for (String tmp1 : cluster.getHostNames()) {
- cluster1.hostNames.add(tmp1);
- }
-
- return cluster1;
- }
-
- private static org.apache.stratos.autoscaler.stub.deployment.partition.Partition[] convertToCCPartitionPojos
- (List<Partition> partitionList) {
-
- org.apache.stratos.autoscaler.stub.deployment.partition.Partition[] partitions =
- new org.apache.stratos.autoscaler.stub.deployment.partition.Partition[partitionList.size()];
- for (int i = 0; i < partitionList.size(); i++) {
- partitions[i] = convertToCCPartitionPojo(partitionList.get(i));
- }
-
- return partitions;
- }
-
- private static ChildLevelPartition[] convertToCCChildPartitionPojos
- (List<org.apache.stratos.rest.endpoint.bean.autoscaler.partition.ChildLevelPartition> partitionList) {
-
- ChildLevelPartition[] childLevelPartitions = new ChildLevelPartition[partitionList.size()];
- for (int i = 0; i < partitionList.size(); i++) {
- ChildLevelPartition childLevelPartition = new ChildLevelPartition();
- childLevelPartition.setPartitionId(partitionList.get(i).id);
- childLevelPartition.setMax(partitionList.get(i).max);
-
- childLevelPartitions[i] = childLevelPartition;
- }
-
- return childLevelPartitions;
- }
-
- public static Partition[] populatePartitionPojos(org.apache.stratos.cloud.controller.stub.domain.Partition[]
- partitions) {
-
- Partition[] partitionBeans;
- if (partitions == null) {
- partitionBeans = new Partition[0];
- return partitionBeans;
- }
-
- partitionBeans = new Partition[partitions.length];
- for (int i = 0; i < partitions.length; i++) {
- partitionBeans[i] = populatePartitionPojo(partitions[i]);
- }
- return partitionBeans;
- }
-
- public static Partition populatePartitionPojo(org.apache.stratos.cloud.controller.stub.domain.Partition
- partition) {
-
- Partition partitionBeans = new Partition();
- if (partition == null) {
- return partitionBeans;
- }
-
- partitionBeans.id = partition.getId();
- partitionBeans.description = partition.getDescription();
- partitionBeans.isPublic = partition.getIsPublic();
- partitionBeans.provider = partition.getProvider();
- /*partitionBeans.partitionMin = partition.getPartitionMin();
- partitionBeans.partitionMax = partition.getPartitionMax();*/
- //properties
- if (partition.getProperties() != null) {
- List<PropertyBean> propertyBeans = getPropertyBeans(partition.getProperties());
- partitionBeans.property = propertyBeans;
- }
-
- return partitionBeans;
- }
-
- public static List<SubscriptionDomainBean> populateSubscriptionDomainPojos(List<SubscriptionDomain> subscriptionDomains) {
-
- List<SubscriptionDomainBean> subscriptionDomainBeans = new ArrayList<SubscriptionDomainBean>();
-
- if (subscriptionDomains == null) {
- return subscriptionDomainBeans;
- }
-
- for (SubscriptionDomain subscriptionDomain : subscriptionDomains) {
- subscriptionDomainBeans.add(populateSubscriptionDomainPojo(subscriptionDomain));
- }
-
- return subscriptionDomainBeans;
- }
-
- public static SubscriptionDomainBean populateSubscriptionDomainPojo(SubscriptionDomain subscriptionDomain) {
-
- SubscriptionDomainBean subscriptionDomainBean = new SubscriptionDomainBean();
-
- if (subscriptionDomain == null) {
- return subscriptionDomainBean;
- }
- subscriptionDomainBean.domainName = subscriptionDomain.getDomainName();
- subscriptionDomainBean.applicationContext = subscriptionDomain.getApplicationContext();
-
- return subscriptionDomainBean;
- }
-
- private static List<PropertyBean> getPropertyBeans(Properties properties) {
-
- List<PropertyBean> propertyBeans = null;
- if (properties.getProperties() != null && properties.getProperties().length != 0) {
- Property[] propertyArr = properties.getProperties();
- propertyBeans = new ArrayList<PropertyBean>();
- for (int i = 0; i < propertyArr.length; i++) {
- PropertyBean propertyBean = new PropertyBean();
- propertyBean.name = propertyArr[i].getName();
- propertyBean.value = propertyArr[i].getValue();
- propertyBeans.add(propertyBean);
- }
- }
- return propertyBeans;
- }
-
- private static List<PropertyBean> getPropertyBeans(org.apache.stratos.cloud.controller.stub.Properties properties) {
-
- List<PropertyBean> propertyBeans = null;
- if (properties.getProperties() != null && properties.getProperties().length != 0) {
- org.apache.stratos.cloud.controller.stub.Property[] propertyArr = properties.getProperties();
- propertyBeans = new ArrayList<PropertyBean>();
- for (int i = 0; i < propertyArr.length; i++) {
- PropertyBean propertyBean = new PropertyBean();
- propertyBean.name = propertyArr[i].getName();
- propertyBean.value = propertyArr[i].getValue();
- propertyBeans.add(propertyBean);
- }
- }
- return propertyBeans;
- }
-
- private static List<PropertyBean> getPropertyBeans(java.util.Properties properties) {
-
- List<PropertyBean> propertyBeans = null;
- if (properties != null && !properties.isEmpty()) {
- Enumeration<?> e = properties.propertyNames();
- propertyBeans = new ArrayList<PropertyBean>();
-
- while (e.hasMoreElements()) {
- String key = (String) e.nextElement();
- String value = properties.getProperty(key);
- PropertyBean propertyBean = new PropertyBean();
- propertyBean.name = key;
- propertyBean.value = value;
- propertyBeans.add(propertyBean);
- }
- }
- return propertyBeans;
- }
-
- public static AutoscalePolicy[] populateAutoscalePojos(org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy[]
- autoscalePolicies) {
-
- AutoscalePolicy[] autoscalePolicyBeans;
- if (autoscalePolicies == null) {
- autoscalePolicyBeans = new AutoscalePolicy[0];
- return autoscalePolicyBeans;
- }
-
- autoscalePolicyBeans = new AutoscalePolicy[autoscalePolicies.length];
- for (int i = 0; i < autoscalePolicies.length; i++) {
- autoscalePolicyBeans[i] = populateAutoscalePojo(autoscalePolicies[i]);
- }
- return autoscalePolicyBeans;
- }
-
- public static AutoscalePolicy populateAutoscalePojo(org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy
- autoscalePolicy) {
- if (autoscalePolicy == null) {
- return null;
- }
-
- AutoscalePolicy autoscalePolicyBean = new AutoscalePolicy();
- autoscalePolicyBean.setId(autoscalePolicy.getId());
- autoscalePolicyBean.setDescription(autoscalePolicy.getDescription());
- autoscalePolicyBean.setIsPublic(autoscalePolicy.getIsPublic());
- autoscalePolicyBean.setDisplayName(autoscalePolicy.getDisplayName());
- autoscalePolicyBean.setDescription(autoscalePolicy.getDescription());
- autoscalePolicyBean.setInstanceRoundingFactor(autoscalePolicy.getInstanceRoundingFactor());
- if (autoscalePolicy.getLoadThresholds() != null) {
- autoscalePolicyBean.setLoadThresholds(populateLoadThresholds(autoscalePolicy.getLoadThresholds()));
- }
-
- return autoscalePolicyBean;
- }
-
- private static LoadThresholds populateLoadThresholds(org.apache.stratos.autoscaler.stub.autoscale.policy.LoadThresholds
- loadThresholds) {
-
- LoadThresholds loadThresholdBean = new LoadThresholds();
- if (loadThresholds.getLoadAverage() != null) {
- LoadAverageThresholds loadAverage = new LoadAverageThresholds();
- loadAverage.threshold = loadThresholds.getLoadAverage().getUpperLimit();
- loadAverage.lowerLimit = loadThresholds.getLoadAverage().getLowerLimit();
- loadThresholdBean.loadAverage = loadAverage;
- }
- if (loadThresholds.getMemoryConsumption() != null) {
- MemoryConsumptionThresholds memoryConsumption = new MemoryConsumptionThresholds();
- memoryConsumption.threshold = loadThresholds.getMemoryConsumption().getUpperLimit();
- memoryConsumption.lowerLimit = loadThresholds.getMemoryConsumption().getLowerLimit();
- loadThresholdBean.memoryConsumption = memoryConsumption;
- }
- if (loadThresholds.getRequestsInFlight() != null) {
- RequestsInFlightThresholds requestsInFlight = new RequestsInFlightThresholds();
- requestsInFlight.threshold = loadThresholds.getRequestsInFlight().getUpperLimit();
- requestsInFlight.lowerLimit = loadThresholds.getRequestsInFlight().getLowerLimit();
- loadThresholdBean.requestsInFlight = requestsInFlight;
- }
-
- return loadThresholdBean;
- }
-
- public static DeploymentPolicy[] populateDeploymentPolicyPojos(org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy[]
- deploymentPolicies) {
- DeploymentPolicy[] deploymentPolicyBeans;
- if (deploymentPolicies == null) {
- return null;
- }
-
- deploymentPolicyBeans = new DeploymentPolicy[deploymentPolicies.length];
- for (int i = 0; i < deploymentPolicies.length; i++) {
- deploymentPolicyBeans[i] = populateDeploymentPolicyPojo(deploymentPolicies[i]);
- }
-
- return deploymentPolicyBeans;
- }
-
- public static DeploymentPolicy populateDeploymentPolicyPojo(org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy
- deploymentPolicy) {
-
- DeploymentPolicy deploymentPolicyBean = new DeploymentPolicy();
- if (deploymentPolicy == null) {
- return deploymentPolicyBean;
- }
-
- deploymentPolicyBean.description = deploymentPolicy.getDescription();
- deploymentPolicyBean.isPublic = deploymentPolicy.getIsPublic();
-//TODO populate the Network partition based on new policy structure
-// if (deploymentPolicy.getApplicationLevelNetworkPartition() != null && deploymentPolicy.getApplicationLevelNetworkPartition().length > 0) {
-// deploymentPolicyBean.setPartitionGroup(Arrays.asList(populatePartitionGroupPojos(deploymentPolicy.getApplicationLevelNetworkPartition())));
-// }
-
- /*if (deploymentPolicy.getAllPartitions() != null && deploymentPolicy.getAllPartitions().length > 0) {
- deploymentPolicyBean.partition = Arrays.asList(populatePartitionPojos(deploymentPolicy.getAllPartitions()));
- }*/
-
- return deploymentPolicyBean;
- }
-
- public static ApplicationLevelNetworkPartition populatePartitionGroupPojo(org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition
- partitionGroup) {
-
- ApplicationLevelNetworkPartition networkPartitionBean = new ApplicationLevelNetworkPartition();
- if (partitionGroup == null) {
- return networkPartitionBean;
- }
-
- networkPartitionBean.id = partitionGroup.getId();
- //FIXME update with new deployment policy pattern
-// networkPartitionBean.partitionAlgo = partitionGroup.getPartitionAlgo();
-// if (partitionGroup.getPartitions() != null && partitionGroup.getPartitions().length > 0) {
-// partitionGroupBean.partition = getPartitionList(partitionGroup.getPartitions());
-// }
-
- return networkPartitionBean;
- }
-
- public static ApplicationLevelNetworkPartition[] populatePartitionGroupPojos(org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition[] partitionGroups) {
-
- ApplicationLevelNetworkPartition[] networkPartitionGroupsBeans;
- if (partitionGroups == null) {
- networkPartitionGroupsBeans = new ApplicationLevelNetworkPartition[0];
- return networkPartitionGroupsBeans;
- }
-
- networkPartitionGroupsBeans = new ApplicationLevelNetworkPartition[partitionGroups.length];
-
- for (int i = 0; i < partitionGroups.length; i++) {
- networkPartitionGroupsBeans[i] = populatePartitionGroupPojo(partitionGroups[i]);
- }
-
- return networkPartitionGroupsBeans;
- }
-
- private static List<Partition> getPartitionList(org.apache.stratos.cloud.controller.stub.domain.Partition[]
- partitions) {
-
- List<Partition> partitionList = new ArrayList<Partition>();
- for (int i = 0; i < partitions.length; i++) {
- Partition partition = new Partition();
- partition.id = partitions[i].getId();
- partition.provider = partitions[i].getProvider();
- /*partition.partitionMin = partitions[i].getPartitionMin();
- partition.partitionMax = partitions[i].getPartitionMax();*/
- if (partitions[i].getProperties() != null) {
- partition.property = getPropertyBeans(partitions[i].getProperties());
- }
- partitionList.add(partition);
- }
-
- return partitionList;
- }
-
- public static ServiceDefinitionBean convertToServiceDefinitionBean(Service service) {
-
- ServiceDefinitionBean serviceDefinitionBean = new ServiceDefinitionBean();
- serviceDefinitionBean.setCartridgeType(service.getType());
- serviceDefinitionBean.setTenantRange(service.getTenantRange());
- serviceDefinitionBean.setClusterDomain(service.getClusterId());
- serviceDefinitionBean.setIsPublic(service.getIsPublic());
- serviceDefinitionBean.setAutoscalingPolicyName(service.getAutoscalingPolicyName());
- serviceDefinitionBean.setDeploymentPolicyName(service.getDeploymentPolicyName());
-
- return serviceDefinitionBean;
- }
-
- public static List<ServiceDefinitionBean> convertToServiceDefinitionBeans(Collection<Service> services) {
-
- List<ServiceDefinitionBean> serviceDefinitionBeans = new ArrayList<ServiceDefinitionBean>();
-
- for (Service service : services) {
- serviceDefinitionBeans.add(convertToServiceDefinitionBean(service));
- }
- return serviceDefinitionBeans;
- }
-
- public static org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesGroup convertToCCKubernetesGroupPojo(KubernetesGroup kubernetesGroupBean) {
-
- org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesGroup kubernetesGroup = new
- org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesGroup();
-
- kubernetesGroup.setGroupId(kubernetesGroupBean.getGroupId());
- kubernetesGroup.setDescription(kubernetesGroupBean.getDescription());
- kubernetesGroup.setKubernetesMaster(convertToCCKubernetesMasterPojo(kubernetesGroupBean.getKubernetesMaster()));
- kubernetesGroup.setPortRange(convertToASPortRange(kubernetesGroupBean.getPortRange()));
- kubernetesGroup.setKubernetesHosts(convertToASKubernetesHostsPojo(kubernetesGroupBean.getKubernetesHosts()));
- kubernetesGroup.setProperties((getCCProperties(kubernetesGroupBean.getProperty())));
-
- return kubernetesGroup;
- }
-
- private static org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost[] convertToASKubernetesHostsPojo(List<KubernetesHost> kubernetesHosts) {
- if (kubernetesHosts == null || kubernetesHosts.isEmpty()) {
- return null;
- }
- int kubernetesHostCount = kubernetesHosts.size();
- org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost[]
- kubernetesHostsArr = new org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost[kubernetesHostCount];
- for (int i = 0; i < kubernetesHostCount; i++) {
- KubernetesHost kubernetesHostBean = kubernetesHosts.get(i);
- kubernetesHostsArr[i] = convertToCCKubernetesHostPojo(kubernetesHostBean);
- }
- return kubernetesHostsArr;
- }
-
-
- private static org.apache.stratos.cloud.controller.stub.kubernetes.PortRange convertToASPortRange(PortRange portRangeBean) {
- if (portRangeBean == null) {
- return null;
- }
- org.apache.stratos.cloud.controller.stub.kubernetes.PortRange
- portRange = new org.apache.stratos.cloud.controller.stub.kubernetes.PortRange();
- portRange.setLower(portRangeBean.getLower());
- portRange.setUpper(portRangeBean.getUpper());
- return portRange;
- }
-
- public static org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost convertToCCKubernetesHostPojo(KubernetesHost kubernetesHostBean) {
- if (kubernetesHostBean == null) {
- return null;
- }
-
- org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost
- kubernetesHost = new org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost();
- kubernetesHost.setHostId(kubernetesHostBean.getHostId());
- kubernetesHost.setHostIpAddress(kubernetesHostBean.getHostIpAddress());
- kubernetesHost.setHostname(kubernetesHostBean.getHostname());
- kubernetesHost.setProperties(getCCProperties(kubernetesHostBean.getProperty()));
-
- return kubernetesHost;
- }
-
- public static org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesMaster convertToCCKubernetesMasterPojo(KubernetesMaster kubernetesMasterBean) {
- if (kubernetesMasterBean == null) {
- return null;
- }
-
- org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesMaster
- kubernetesMaster = new org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesMaster();
- kubernetesMaster.setHostId(kubernetesMasterBean.getHostId());
- kubernetesMaster.setHostIpAddress(kubernetesMasterBean.getHostIpAddress());
- kubernetesMaster.setHostname(kubernetesMasterBean.getHostname());
- kubernetesMaster.setEndpoint(kubernetesMasterBean.getEndpoint());
- kubernetesMaster.setProperties(getCCProperties(kubernetesMasterBean.getProperty()));
-
- return kubernetesMaster;
- }
-
- public static KubernetesGroup[] populateKubernetesGroupsPojo(org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesGroup[] kubernetesGroups) {
-
- if (kubernetesGroups == null) {
- return null;
- }
- KubernetesGroup[] kubernetesGroupsBean = new KubernetesGroup[kubernetesGroups.length];
- for (int i = 0; i < kubernetesGroups.length; i++) {
- kubernetesGroupsBean[i] = populateKubernetesGroupPojo(kubernetesGroups[i]);
- }
- return kubernetesGroupsBean;
- }
-
- public static KubernetesGroup populateKubernetesGroupPojo(org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesGroup kubernetesGroup) {
- if (kubernetesGroup == null) {
- return null;
- }
- KubernetesGroup kubernetesGroupBean = new KubernetesGroup();
- kubernetesGroupBean.setGroupId(kubernetesGroup.getGroupId());
- kubernetesGroupBean.setDescription(kubernetesGroup.getDescription());
- kubernetesGroupBean.setPortRange(populatePortRangePojo(kubernetesGroup.getPortRange()));
- kubernetesGroupBean.setKubernetesHosts(populateKubernetesHostsPojo(kubernetesGroup.getKubernetesHosts()));
- kubernetesGroupBean.setKubernetesMaster(populateKubernetesMasterPojo(kubernetesGroup.getKubernetesMaster()));
- kubernetesGroupBean.setProperty(populateCCProperties(kubernetesGroup.getProperties()));
- return kubernetesGroupBean;
- }
-
- public static KubernetesMaster populateKubernetesMasterPojo(org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesMaster kubernetesMaster) {
- if (kubernetesMaster == null) {
- return null;
- }
- KubernetesMaster kubernetesMasterBean = new KubernetesMaster();
- kubernetesMasterBean.setHostId(kubernetesMaster.getHostId());
- kubernetesMasterBean.setHostname(kubernetesMaster.getHostname());
- kubernetesMasterBean.setHostIpAddress(kubernetesMaster.getHostIpAddress());
- kubernetesMasterBean.setProperty(populateCCProperties(kubernetesMaster.getProperties()));
- kubernetesMasterBean.setEndpoint(kubernetesMaster.getEndpoint());
- return kubernetesMasterBean;
- }
-
- public static List<KubernetesHost> populateKubernetesHostsPojo(org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost[] kubernetesHosts) {
- if (kubernetesHosts == null) {
- return null;
- }
- List<KubernetesHost> kubernetesHostList = new ArrayList<KubernetesHost>();
- for (int i = 0; i < kubernetesHosts.length; i++) {
- kubernetesHostList.add(populateKubernetesHostPojo(kubernetesHosts[i]));
- }
- return kubernetesHostList;
- }
-
- private static KubernetesHost populateKubernetesHostPojo(org.apache.stratos.cloud.controller.stub.kubernetes.KubernetesHost kubernetesHost) {
- if (kubernetesHost == null) {
- return null;
- }
- KubernetesHost kubernetesHostBean = new KubernetesHost();
- kubernetesHostBean.setHostId(kubernetesHost.getHostId());
- kubernetesHostBean.setHostname(kubernetesHost.getHostname());
- kubernetesHostBean.setHostIpAddress(kubernetesHost.getHostIpAddress());
- kubernetesHostBean.setProperty(populateCCProperties(kubernetesHost.getProperties()));
- return kubernetesHostBean;
- }
-
- private static List<PropertyBean> populateASProperties(org.apache.stratos.autoscaler.stub.Properties properties) {
- if (properties == null || properties.getProperties() == null) {
- return null;
- }
- List<PropertyBean> propertyBeanList = new ArrayList<PropertyBean>();
- for (int i = 0; i < properties.getProperties().length; i++) {
- propertyBeanList.add(populateASProperty(properties.getProperties()[i]));
- }
- return propertyBeanList;
- }
-
- private static List<PropertyBean> populateCCProperties(org.apache.stratos.cloud.controller.stub.Properties properties) {
- if (properties == null || properties.getProperties() == null) {
- return null;
- }
- List<PropertyBean> propertyBeanList = new ArrayList<PropertyBean>();
- for (int i = 0; i < properties.getProperties().length; i++) {
- propertyBeanList.add(populateCCProperty(properties.getProperties()[i]));
- }
- return propertyBeanList;
- }
-
- private static PropertyBean populateASProperty(org.apache.stratos.autoscaler.stub.Property propertyE) {
- if (propertyE == null) {
- return null;
- }
- PropertyBean propertyBean = new PropertyBean();
- propertyBean.name = propertyE.getName();
- propertyBean.value = propertyE.getValue();
- return propertyBean;
- }
-
- private static PropertyBean populateCCProperty(org.apache.stratos.cloud.controller.stub.Property propertyE) {
- if (propertyE == null) {
- return null;
- }
- PropertyBean propertyBean = new PropertyBean();
- propertyBean.name = propertyE.getName();
- propertyBean.value = propertyE.getValue();
- return propertyBean;
- }
-
- private static PortRange populatePortRangePojo(org.apache.stratos.cloud.controller.stub.kubernetes.PortRange portRange) {
- if (portRange == null) {
- return null;
- }
- PortRange portRangeBean = new PortRange();
- portRangeBean.setUpper(portRange.getUpper());
- portRangeBean.setLower(portRange.getLower());
- return portRangeBean;
- }
-
- public static ApplicationContext convertApplicationBeanToApplicationContext(ApplicationDefinition compositeAppDefinition) {
-
- org.apache.stratos.autoscaler.stub.pojo.ApplicationContext applicationContext =
- new org.apache.stratos.autoscaler.stub.pojo.ApplicationContext();
- applicationContext.setApplicationId(compositeAppDefinition.getApplicationId());
- applicationContext.setAlias(compositeAppDefinition.getAlias());
- //applicationContext.setDeploymentPolicy(compositeAppDefinition.getDeploymentPolicy());
-
- // convert and set components
- if (compositeAppDefinition.getComponents() != null) {
- org.apache.stratos.autoscaler.stub.pojo.ComponentContext componentContext =
- new org.apache.stratos.autoscaler.stub.pojo.ComponentContext();
-
- // top level Groups
- if (compositeAppDefinition.getComponents().getGroups() != null) {
- componentContext.setGroupContexts(getgroupContextArrayFromGroupDefinitions(compositeAppDefinition.getComponents().getGroups()));
- }
- // top level dependency information
- if (compositeAppDefinition.getComponents().getDependencies() != null) {
- componentContext.setDependencyContext(getDependencyContextFromDependencyDefinition(compositeAppDefinition.getComponents().getDependencies()));
- }
- // top level cartridge context information
- if (compositeAppDefinition.getComponents().getCartridges() != null) {
- componentContext.setCartridgeContexts(getCartridgeContextArrayFromCartridgeDefinition(compositeAppDefinition.getComponents().getCartridges()));
- }
-
- applicationContext.setComponents(componentContext);
- }
-
-
- return applicationContext;
- }
-
- private static CartridgeContext[] getCartridgeContextArrayFromCartridgeDefinition(
- List<CartridgeDefinition> cartridges) {
-
- CartridgeContext[] cartridgeContextArray = new CartridgeContext[cartridges.size()];
- int i = 0;
- for (CartridgeDefinition cartridgeDefinition : cartridges) {
- CartridgeContext context = new CartridgeContext();
- context.setCartridgeMax(cartridgeDefinition.getCartridgeMax());
- context.setCartridgeMin(cartridgeDefinition.getCartridgeMin());
- context.setType(cartridgeDefinition.getType());
- context.setSubscribableInfoContext(convertSubscribableInfo(cartridgeDefinition.getSubscribableInfo()));
- cartridgeContextArray[i++] = context;
- }
-
- return cartridgeContextArray;
- }
-
- private static SubscribableInfoContext convertSubscribableInfo(
- SubscribableInfo subscribableInfo) {
- SubscribableInfoContext infoContext = new SubscribableInfoContext();
- infoContext.setAlias(subscribableInfo.getAlias());
- infoContext.setAutoscalingPolicy(subscribableInfo.getAutoscalingPolicy());
- infoContext.setDependencyAliases(subscribableInfo.getDependencyAliases());
- infoContext.setDeploymentPolicy(subscribableInfo.getDeploymentPolicy());
- infoContext.setMaxMembers(subscribableInfo.getMaxMembers());
- infoContext.setMinMembers(subscribableInfo.getMinMembers());
- //infoContext.setPrivateRepo(subscribableInfo.getpr);
- infoContext.setRepoPassword(subscribableInfo.getRepoPassword());
- infoContext.setRepoUrl(subscribableInfo.getRepoUrl());
- infoContext.setRepoUsername(subscribableInfo.getRepoUsername());
- infoContext.setProperties(convertProperties(subscribableInfo.getProperty()));
-
- return infoContext;
- }
-
- private static org.apache.stratos.autoscaler.stub.Properties convertProperties(
- List<org.apache.stratos.manager.composite.application.beans.PropertyBean> property) {
- org.apache.stratos.autoscaler.stub.Properties prop = new org.apache.stratos.autoscaler.stub.Properties();
- if (property != null) {
- for (org.apache.stratos.manager.composite.application.beans.PropertyBean propertyBean : property) {
- org.apache.stratos.autoscaler.stub.Property p = new org.apache.stratos.autoscaler.stub.Property();
- p.setName(propertyBean.getName());
- p.setValue(propertyBean.getValue());
- prop.addProperties(p);
- }
- }
- return prop;
- }
-
-
- private static DependencyContext getDependencyContextFromDependencyDefinition(DependencyDefinitions dependencyDefinitions) {
-
- DependencyContext dependencyContext = new DependencyContext();
- dependencyContext.setTerminationBehaviour(dependencyDefinitions.getTerminationBehaviour());
-
- if (dependencyDefinitions != null){
-
- if(dependencyDefinitions.getStartupOrders() != null) {
- String[] startupOrders = new String[dependencyDefinitions.getStartupOrders().size()];
- startupOrders = dependencyDefinitions.getStartupOrders().toArray(startupOrders);
- dependencyContext.setStartupOrdersContexts(startupOrders);
- }
- if (dependencyDefinitions.getScalingDependants() != null) {
- String[] scalingDependents = new String[dependencyDefinitions.getScalingDependants().size()];
- scalingDependents = dependencyDefinitions.getScalingDependants().toArray(scalingDependents);
- dependencyContext.setScalingDependents(scalingDependents);
- }
- }
-
-
-
- return dependencyContext;
- }
-
- private static org.apache.stratos.autoscaler.stub.pojo.GroupContext[]
- getgroupContextArrayFromGroupDefinitions(List<GroupDefinition> groupDefinitions) {
-
- GroupContext[] groupContexts = new GroupContext[groupDefinitions.size()];
- int i = 0;
- for (GroupDefinition groupDefinition : groupDefinitions) {
- GroupContext groupContext = new GroupContext();
- groupContext.setName(groupDefinition.getName());
- groupContext.setAlias(groupDefinition.getAlias());
- groupContext.setGroupMaxInstances(groupDefinition.getGroupMaxInstances());
- groupContext.setGroupMinInstances(groupDefinition.getGroupMinInstances());
- groupContext.setGroupScalingEnabled(groupDefinition.isGroupScalingEnabled);
-
- // Groups
- if (groupDefinition.getGroups() != null) {
- groupContext.setGroupContexts(getgroupContextArrayFromGroupDefinitions(groupDefinition.getGroups()));
- }
-
- groupContext.setCartridgeContexts(getCartridgeContextArrayFromCartridgeDefinition(groupDefinition.getCartridges()));
- groupContexts[i++] = groupContext;
- }
-
- return groupContexts;
- }
-
-
- public static ApplicationBean applicationToBean(Application application) {
- if (application == null) {
- return null;
- }
-
- ApplicationBean applicationBean = new ApplicationBean();
- applicationBean.setId(application.getUniqueIdentifier());
- applicationBean.setTenantDomain(application.getTenantDomain());
- applicationBean.setTenantAdminUsername(application.getTenantAdminUserName());
- applicationBean.setInstances(setApplicationInstances(application));
- return applicationBean;
- }
-
- private static List<Instance> setApplicationInstances(
- Application application) {
- List<Instance> applicationInstanceList = new ArrayList<Instance>();
- Collection<ApplicationInstance> applicationInstancesInTopology =
- application.getInstanceIdToInstanceContextMap().values();
-
- if(applicationInstancesInTopology != null) {
- for (ApplicationInstance applicationInstance : applicationInstancesInTopology) {
- Instance instance = new Instance();
- instance.instanceId = applicationInstance.getInstanceId();
- instance.status = applicationInstance.getStatus().toString();
- applicationInstanceList.add(instance);
- }
- }
-
- return applicationInstanceList;
- }
-
- public static GroupBean toGroupBean(Group group) {
- if (group == null) {
- return null;
- }
-
- GroupBean groupBean = new GroupBean();
- groupBean.setInstances(setGroupInstances(group));
- groupBean.setAlias(group.getUniqueIdentifier());
- groupBean.setAutoScalingPolicy(group.getAutoscalingPolicy());
- return groupBean;
- }
-
- private static List<Instance> setGroupInstances(Group group) {
- List<Instance> instanceList = new ArrayList<Instance>();
- Collection<GroupInstance> instancesInTopology = group.getInstanceIdToInstanceContextMap().values();
- if(instancesInTopology != null) {
- for (GroupInstance groupInstance : instancesInTopology) {
- Instance instance = new Instance();
- instance.status = groupInstance.getStatus().toString();
- instance.instanceId = groupInstance.getInstanceId();
- instanceList.add(instance);
- }
- }
-
- return instanceList;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/list/ListType.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/list/ListType.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/list/ListType.java
deleted file mode 100644
index 36b0930..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/list/ListType.java
+++ /dev/null
@@ -1,39 +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.rest.endpoint.bean.util.type.list;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement(name = "List")
-public class ListType<T> {
-
- private List<T> list;
-
- @XmlElement(name="Item")
- public List<T> getList() {
- return list;
- }
-
- public void setList(List<T> list) {
- this.list = list;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/map/MapAdapter.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/map/MapAdapter.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/map/MapAdapter.java
deleted file mode 100644
index 9545a5a..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/map/MapAdapter.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.rest.endpoint.bean.util.type.map;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import java.util.HashMap;
-import java.util.Map;
-
-public class MapAdapter<S, T> extends XmlAdapter<MapType,Map<S, T>> {
-
- @Override
- public MapType marshal(Map<S, T> v) throws Exception {
-
- MapType mapType = new MapType();
-
- for(Map.Entry entry : v.entrySet()) {
- MapEntryType myMapEntryType = new MapEntryType();
- myMapEntryType.key = entry.getKey();
- myMapEntryType.value = entry.getValue();
- mapType.entry.add(myMapEntryType);
- }
- return mapType;
- }
-
- @Override
- public Map<S, T> unmarshal(MapType v) throws Exception {
-
- Map hashMap = new HashMap();
-
- for(MapEntryType mapEntryType : v.entry) {
- hashMap.put(mapEntryType.key, mapEntryType.value);
- }
- return hashMap;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/map/MapEntryType.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/map/MapEntryType.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/map/MapEntryType.java
deleted file mode 100644
index e9bb344..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/map/MapEntryType.java
+++ /dev/null
@@ -1,32 +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.rest.endpoint.bean.util.type.map;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlValue;
-
-public class MapEntryType <S,T> {
-
- @XmlAttribute
- public S key;
-
- @XmlValue
- public T value;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/map/MapType.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/map/MapType.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/map/MapType.java
deleted file mode 100644
index 3fdd63f..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/util/type/map/MapType.java
+++ /dev/null
@@ -1,28 +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.rest.endpoint.bean.util.type.map;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class MapType {
-
- public List<MapEntryType> entry = new ArrayList<MapEntryType>();
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/MockContext.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/MockContext.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/MockContext.java
index 87323f8..4e4269f 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/MockContext.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/MockContext.java
@@ -22,19 +22,19 @@ import org.apache.stratos.common.beans.TenantInfoBean;
import org.apache.stratos.manager.dto.Cartridge;
import org.apache.stratos.manager.dto.SubscriptionInfo;
import org.apache.stratos.manager.subscription.SubscriptionDomain;
-import org.apache.stratos.manager.user.mgt.beans.UserInfoBean;
-import org.apache.stratos.rest.endpoint.bean.CartridgeInfoBean;
-import org.apache.stratos.rest.endpoint.bean.StratosApiResponse;
-import org.apache.stratos.rest.endpoint.bean.SubscriptionDomainRequest;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.ApplicationLevelNetworkPartition;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.Partition;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.AutoscalePolicy;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.CartridgeDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.ServiceDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean;
-import org.apache.stratos.rest.endpoint.bean.topology.Cluster;
-import org.apache.stratos.rest.endpoint.bean.util.converter.PojoConverter;
+import org.apache.stratos.common.beans.UserInfoBean;
+import org.apache.stratos.common.beans.CartridgeInfoBean;
+import org.apache.stratos.common.beans.StratosApiResponse;
+import org.apache.stratos.common.beans.SubscriptionDomainRequest;
+import org.apache.stratos.common.beans.autoscaler.partition.ApplicationLevelNetworkPartition;
+import org.apache.stratos.common.beans.autoscaler.partition.Partition;
+import org.apache.stratos.common.beans.autoscaler.policy.autoscale.AutoscalePolicy;
+import org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy;
+import org.apache.stratos.common.beans.cartridge.definition.CartridgeDefinitionBean;
+import org.apache.stratos.common.beans.cartridge.definition.ServiceDefinitionBean;
+import org.apache.stratos.common.beans.subscription.domain.SubscriptionDomainBean;
+import org.apache.stratos.common.beans.topology.Cluster;
+import org.apache.stratos.rest.endpoint.util.converter.PojoConverter;
import org.apache.stratos.rest.endpoint.exception.RestAPIException;
import org.wso2.carbon.context.CarbonContext;
import java.util.*;
@@ -493,7 +493,7 @@ public class MockContext {
int tenantId = getTenantId();
Map<String,Partition> partitions;
- if(!partition.isPublic){
+ if(!partition.isPublic()){
if (partitionMap.containsKey(tenantId)){
partitions = partitionMap.get(tenantId);
}
@@ -512,7 +512,7 @@ public class MockContext {
}
}
- partitions.put(partition.id, partition);
+ partitions.put(partition.getId(), partition);
StratosApiResponse stratosApiResponse = new StratosApiResponse();
stratosApiResponse.setMessage("Successfully deployed partition");
return stratosApiResponse;
@@ -551,7 +551,7 @@ public class MockContext {
int tenantId = getTenantId();
Map<String,DeploymentPolicy> policies;
- if(!deploymentPolicy.isPublic){
+ if(!deploymentPolicy.isPublic()){
if (deploymentPolicyMap.containsKey(tenantId)){
policies = deploymentPolicyMap.get(tenantId);
}
@@ -570,7 +570,7 @@ public class MockContext {
}
}
- policies.put(deploymentPolicy.applicationPolicy.applicationId+UUID.randomUUID().getLeastSignificantBits(),deploymentPolicy);
+ policies.put(deploymentPolicy.getApplicationPolicy().getApplicationId() +UUID.randomUUID().getLeastSignificantBits(),deploymentPolicy);
StratosApiResponse stratosApiResponse = new StratosApiResponse();
stratosApiResponse.setMessage("Successfully deployed deployment policy definition");
return stratosApiResponse;
@@ -622,7 +622,7 @@ public class MockContext {
if(!(deploymentPolicyMap.get(PUBLIC_DEFINITION)).containsKey(deploymentPolicyId)){
throw new RestAPIException(Status.NO_CONTENT,"There is no deployment policy with id: " + deploymentPolicyId);
}
- return (deploymentPolicyMap.get(PUBLIC_DEFINITION)).get(deploymentPolicyId).applicationPolicy.networkPartition.get(0).partitions.toArray(new Partition[0]);
+ return (deploymentPolicyMap.get(PUBLIC_DEFINITION)).get(deploymentPolicyId).getApplicationPolicy().getNetworkPartition().get(0).getPartitions().toArray(new Partition[0]);
}
}
@@ -631,7 +631,7 @@ public class MockContext {
}
//FIXME to parse thr all the NW partitions
return (deploymentPolicyMap.get(tenantId)).
- get(deploymentPolicyId).applicationPolicy.networkPartition.get(0).partitions.toArray(new Partition[0]);
+ get(deploymentPolicyId).getApplicationPolicy().getNetworkPartition().get(0).getPartitions().toArray(new Partition[0]);
}
public ApplicationLevelNetworkPartition[] getPartitionGroups(String deploymentPolicyId) throws RestAPIException{
@@ -644,14 +644,14 @@ public class MockContext {
if(!(deploymentPolicyMap.get(PUBLIC_DEFINITION)).containsKey(deploymentPolicyId)){
throw new RestAPIException(Status.NO_CONTENT,"There is no deployment policy with id: " + deploymentPolicyId);
}
- return (deploymentPolicyMap.get(PUBLIC_DEFINITION)).get(deploymentPolicyId).applicationPolicy.networkPartition.toArray(new ApplicationLevelNetworkPartition[0]);
+ return (deploymentPolicyMap.get(PUBLIC_DEFINITION)).get(deploymentPolicyId).getApplicationPolicy().getNetworkPartition().toArray(new ApplicationLevelNetworkPartition[0]);
}
}
if(!(deploymentPolicyMap.get(tenantId)).containsKey(deploymentPolicyId)){
throw new RestAPIException(Status.NO_CONTENT,"There is no deployment policy with id: " + deploymentPolicyId);
}
- return (deploymentPolicyMap.get(tenantId)).get(deploymentPolicyId).applicationPolicy.networkPartition.toArray(new ApplicationLevelNetworkPartition[0]);
+ return (deploymentPolicyMap.get(tenantId)).get(deploymentPolicyId).getApplicationPolicy().getNetworkPartition().toArray(new ApplicationLevelNetworkPartition[0]);
}
public AutoscalePolicy[] getAutoscalePolicies() throws RestAPIException{
@@ -813,9 +813,9 @@ public class MockContext {
}
Partition[] partitions = null;
- for(ApplicationLevelNetworkPartition networkPartition : deploymentPolicy.applicationPolicy.networkPartition){
- if(networkPartition.id.equals(partitionGroupId)){
- partitions = networkPartition.partitions.toArray(new Partition[0]);
+ for(ApplicationLevelNetworkPartition networkPartition : deploymentPolicy.getApplicationPolicy().getNetworkPartition()){
+ if(networkPartition.getId().equals(partitionGroupId)){
+ partitions = networkPartition.getPartitions().toArray(new Partition[0]);
}
}
if(partitions == null){
@@ -861,9 +861,9 @@ public class MockContext {
} else {
list = new ArrayList<SubscriptionDomain>();
}
- for (org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean bean : request.domains) {
+ for (org.apache.stratos.common.beans.subscription.domain.SubscriptionDomainBean bean : request.getDomains()) {
- SubscriptionDomain subscriptionDomain = new SubscriptionDomain(bean.domainName, bean.applicationContext);
+ SubscriptionDomain subscriptionDomain = new SubscriptionDomain(bean.getDomainName(), bean.getApplicationContext());
list.add(subscriptionDomain);
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/StratosApiV40Mock.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/StratosApiV40Mock.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/StratosApiV40Mock.java
index 6cfc2d7..f2578de 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/StratosApiV40Mock.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/mock/StratosApiV40Mock.java
@@ -27,21 +27,21 @@ import org.apache.stratos.common.beans.TenantInfoBean;
import org.apache.stratos.manager.dto.Cartridge;
import org.apache.stratos.manager.dto.SubscriptionInfo;
import org.apache.stratos.manager.exception.ADCException;
-import org.apache.stratos.manager.user.mgt.beans.UserInfoBean;
+import org.apache.stratos.common.beans.UserInfoBean;
import org.apache.stratos.rest.endpoint.Utils;
import org.apache.stratos.rest.endpoint.annotation.AuthorizationAction;
import org.apache.stratos.rest.endpoint.annotation.SuperTenantService;
-import org.apache.stratos.rest.endpoint.bean.CartridgeInfoBean;
-import org.apache.stratos.rest.endpoint.bean.StratosApiResponse;
-import org.apache.stratos.rest.endpoint.bean.SubscriptionDomainRequest;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.ApplicationLevelNetworkPartition;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.Partition;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.AutoscalePolicy;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.CartridgeDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.ServiceDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean;
-import org.apache.stratos.rest.endpoint.bean.topology.Cluster;
+import org.apache.stratos.common.beans.CartridgeInfoBean;
+import org.apache.stratos.common.beans.StratosApiResponse;
+import org.apache.stratos.common.beans.SubscriptionDomainRequest;
+import org.apache.stratos.common.beans.autoscaler.partition.ApplicationLevelNetworkPartition;
+import org.apache.stratos.common.beans.autoscaler.partition.Partition;
+import org.apache.stratos.common.beans.autoscaler.policy.autoscale.AutoscalePolicy;
+import org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy;
+import org.apache.stratos.common.beans.cartridge.definition.CartridgeDefinitionBean;
+import org.apache.stratos.common.beans.cartridge.definition.ServiceDefinitionBean;
+import org.apache.stratos.common.beans.subscription.domain.SubscriptionDomainBean;
+import org.apache.stratos.common.beans.topology.Cluster;
import org.apache.stratos.rest.endpoint.exception.RestAPIException;
import java.util.List;
[5/7] stratos git commit: Moving rest api domain model to stratos
common component to be reused by the cli
Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/StratosApiResponse.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/StratosApiResponse.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/StratosApiResponse.java
new file mode 100644
index 0000000..38fabb6
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/StratosApiResponse.java
@@ -0,0 +1,36 @@
+/*
+ * 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.common.beans;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class StratosApiResponse {
+
+ private String message;
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/SubscriptionDomainRequest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/SubscriptionDomainRequest.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/SubscriptionDomainRequest.java
new file mode 100644
index 0000000..7ef9147
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/SubscriptionDomainRequest.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.common.beans;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.stratos.common.beans.subscription.domain.SubscriptionDomainBean;
+
+/**
+ * Defines subscription domain post request.
+ */
+@XmlRootElement
+public class SubscriptionDomainRequest {
+ private List<SubscriptionDomainBean> domains;
+
+ public List<SubscriptionDomainBean> getDomains() {
+ return domains;
+ }
+
+ public void setDomains(List<SubscriptionDomainBean> domains) {
+ this.domains = domains;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/TenantInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/TenantInfoBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/TenantInfoBean.java
index 71b7b7b..63276a0 100755
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/TenantInfoBean.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/TenantInfoBean.java
@@ -37,7 +37,7 @@ public class TenantInfoBean {
private String email;
private boolean active;
private String successKey;
- Calendar createdDate;
+ private Calendar createdDate;
private String originatedService;
private String usagePlan;
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/UserInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/UserInfoBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/UserInfoBean.java
new file mode 100644
index 0000000..68af2bd
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/UserInfoBean.java
@@ -0,0 +1,103 @@
+/*
+ * 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.common.beans;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class UserInfoBean {
+
+ private String userName;
+ private String credential;
+ private String role;
+ private String firstName;
+ private String lastName;
+ private String email;
+ private String profileName;
+
+ public UserInfoBean(){}
+
+ public UserInfoBean(UserInfoBean userInfoBean) {
+ this.userName = userInfoBean.getUserName();
+ this.credential = userInfoBean.getCredential();
+ this.role = userInfoBean.getRole();
+ this.firstName = userInfoBean.getFirstName();
+ this.lastName = userInfoBean.getLastName();
+ this.email = userInfoBean.getEmail();
+ this.profileName = userInfoBean.getProfileName();
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public String getCredential() {
+ return credential;
+ }
+
+ public void setCredential(String credential) {
+ this.credential = credential;
+ }
+
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(String role) {
+ this.role = role;
+ }
+
+ 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 getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getProfileName() {
+ return profileName;
+ }
+
+ public void setProfileName(String profileName) {
+ this.profileName = profileName;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/ApplicationLevelNetworkPartition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/ApplicationLevelNetworkPartition.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/ApplicationLevelNetworkPartition.java
new file mode 100644
index 0000000..0ddbb69
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/ApplicationLevelNetworkPartition.java
@@ -0,0 +1,58 @@
+/*
+ * 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.common.beans.autoscaler.partition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement
+public class ApplicationLevelNetworkPartition {
+
+ private String id;
+
+ private boolean activeByDefault;
+
+ //partition Ids
+ private List<Partition> partitions;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public boolean isActiveByDefault() {
+ return activeByDefault;
+ }
+
+ public void setActiveByDefault(boolean activeByDefault) {
+ this.activeByDefault = activeByDefault;
+ }
+
+ public List<Partition> getPartitions() {
+ return partitions;
+ }
+
+ public void setPartitions(List<Partition> partitions) {
+ this.partitions = partitions;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/ChildLevelNetworkPartition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/ChildLevelNetworkPartition.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/ChildLevelNetworkPartition.java
new file mode 100644
index 0000000..d537554
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/ChildLevelNetworkPartition.java
@@ -0,0 +1,55 @@
+/*
+ * 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.common.beans.autoscaler.partition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement
+public class ChildLevelNetworkPartition {
+ private String id;
+
+ private String partitionAlgo;
+
+ private List<ChildLevelPartition> partitions;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getPartitionAlgo() {
+ return partitionAlgo;
+ }
+
+ public void setPartitionAlgo(String partitionAlgo) {
+ this.partitionAlgo = partitionAlgo;
+ }
+
+ public List<ChildLevelPartition> getPartitions() {
+ return partitions;
+ }
+
+ public void setPartitions(List<ChildLevelPartition> partitions) {
+ this.partitions = partitions;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/ChildLevelPartition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/ChildLevelPartition.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/ChildLevelPartition.java
new file mode 100644
index 0000000..012c3ad
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/ChildLevelPartition.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.common.beans.autoscaler.partition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class ChildLevelPartition {
+ private String id;
+
+ private int max;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public int getMax() {
+ return max;
+ }
+
+ public void setMax(int max) {
+ this.max = max;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/Partition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/Partition.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/Partition.java
new file mode 100644
index 0000000..c14b752
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/partition/Partition.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.common.beans.autoscaler.partition;
+
+import org.apache.stratos.common.beans.cartridge.definition.PropertyBean;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement
+public class Partition {
+
+ private String id;
+
+ private String description;
+
+ private boolean isPublic;
+
+ private String provider;
+
+ private List<PropertyBean> property;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getProvider() {
+ return provider;
+ }
+
+ public void setProvider(String provider) {
+ this.provider = provider;
+ }
+
+ public boolean getIsPublic() {
+ return isPublic();
+ }
+
+ public boolean isPublic() {
+ return isPublic;
+ }
+
+ public void setPublic(boolean isPublic) {
+ this.isPublic = isPublic;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public List<PropertyBean> getProperty() {
+ return property;
+ }
+
+ public void setProperty(List<PropertyBean> property) {
+ this.property = property;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/AutoscalePolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/AutoscalePolicy.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/AutoscalePolicy.java
new file mode 100644
index 0000000..a3aa3be
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/AutoscalePolicy.java
@@ -0,0 +1,87 @@
+/*
+ * 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.common.beans.autoscaler.policy.autoscale;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class AutoscalePolicy {
+
+ private String id;
+
+ private String displayName;
+
+ private String description;
+
+ private LoadThresholds loadThresholds;
+
+ private boolean isPublic;
+
+ private float instanceRoundingFactor;
+
+ 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;
+ }
+
+ public boolean getIsPublic() {
+ return isPublic;
+ }
+
+ public void setIsPublic(boolean isPublic) {
+ this.isPublic = isPublic;
+ }
+
+
+ public LoadThresholds getLoadThresholds() {
+ return loadThresholds;
+ }
+
+ public void setLoadThresholds(LoadThresholds loadThresholds) {
+ this.loadThresholds = loadThresholds;
+ }
+
+ public float getInstanceRoundingFactor() {
+ return instanceRoundingFactor;
+ }
+
+ public void setInstanceRoundingFactor(float instanceRoundingFactor) {
+ this.instanceRoundingFactor = instanceRoundingFactor;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/LoadAverageThresholds.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/LoadAverageThresholds.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/LoadAverageThresholds.java
new file mode 100644
index 0000000..6505870
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/LoadAverageThresholds.java
@@ -0,0 +1,46 @@
+/*
+ * 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.common.beans.autoscaler.policy.autoscale;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class LoadAverageThresholds {
+
+ private float threshold;
+
+ private float lowerLimit;
+
+ public float getThreshold() {
+ return threshold;
+ }
+
+ public void setThreshold(float threshold) {
+ this.threshold = threshold;
+ }
+
+ public float getLowerLimit() {
+ return lowerLimit;
+ }
+
+ public void setLowerLimit(float lowerLimit) {
+ this.lowerLimit = lowerLimit;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/LoadThresholds.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/LoadThresholds.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/LoadThresholds.java
new file mode 100644
index 0000000..b14e890
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/LoadThresholds.java
@@ -0,0 +1,54 @@
+/*
+ * 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.common.beans.autoscaler.policy.autoscale;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class LoadThresholds {
+
+ private RequestsInFlightThresholds requestsInFlight;
+ private MemoryConsumptionThresholds memoryConsumption;
+ private LoadAverageThresholds loadAverage;
+
+ public RequestsInFlightThresholds getRequestsInFlight() {
+ return requestsInFlight;
+ }
+
+ public void setRequestsInFlight(RequestsInFlightThresholds requestsInFlight) {
+ this.requestsInFlight = requestsInFlight;
+ }
+
+ public MemoryConsumptionThresholds getMemoryConsumption() {
+ return memoryConsumption;
+ }
+
+ public void setMemoryConsumption(MemoryConsumptionThresholds memoryConsumption) {
+ this.memoryConsumption = memoryConsumption;
+ }
+
+ public LoadAverageThresholds getLoadAverage() {
+ return loadAverage;
+ }
+
+ public void setLoadAverage(LoadAverageThresholds loadAverage) {
+ this.loadAverage = loadAverage;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/MemoryConsumptionThresholds.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/MemoryConsumptionThresholds.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/MemoryConsumptionThresholds.java
new file mode 100644
index 0000000..d44ce7e
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/MemoryConsumptionThresholds.java
@@ -0,0 +1,46 @@
+/*
+ * 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.common.beans.autoscaler.policy.autoscale;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class MemoryConsumptionThresholds {
+
+ private float threshold;
+
+ private float lowerLimit;
+
+ public float getThreshold() {
+ return threshold;
+ }
+
+ public void setThreshold(float threshold) {
+ this.threshold = threshold;
+ }
+
+ public float getLowerLimit() {
+ return lowerLimit;
+ }
+
+ public void setLowerLimit(float lowerLimit) {
+ this.lowerLimit = lowerLimit;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/RequestsInFlightThresholds.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/RequestsInFlightThresholds.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/RequestsInFlightThresholds.java
new file mode 100644
index 0000000..7433f31
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/autoscale/RequestsInFlightThresholds.java
@@ -0,0 +1,46 @@
+/*
+ * 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.common.beans.autoscaler.policy.autoscale;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class RequestsInFlightThresholds {
+
+ private float threshold;
+
+ private float lowerLimit;
+
+ public float getThreshold() {
+ return threshold;
+ }
+
+ public void setThreshold(float threshold) {
+ this.threshold = threshold;
+ }
+
+ public float getLowerLimit() {
+ return lowerLimit;
+ }
+
+ public void setLowerLimit(float lowerLimit) {
+ this.lowerLimit = lowerLimit;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/deployment/ApplicationPolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/deployment/ApplicationPolicy.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/deployment/ApplicationPolicy.java
new file mode 100644
index 0000000..416b911
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/deployment/ApplicationPolicy.java
@@ -0,0 +1,49 @@
+/*
+ * 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.common.beans.autoscaler.policy.deployment;
+
+import org.apache.stratos.common.beans.autoscaler.partition.ApplicationLevelNetworkPartition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement
+public class ApplicationPolicy {
+ //partition groups
+ private String applicationId;
+
+ private List<ApplicationLevelNetworkPartition> networkPartition;
+
+
+ public String getApplicationId() {
+ return applicationId;
+ }
+
+ public void setApplicationId(String applicationId) {
+ this.applicationId = applicationId;
+ }
+
+ public List<ApplicationLevelNetworkPartition> getNetworkPartition() {
+ return networkPartition;
+ }
+
+ public void setNetworkPartition(List<ApplicationLevelNetworkPartition> networkPartition) {
+ this.networkPartition = networkPartition;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/deployment/ChildPolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/deployment/ChildPolicy.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/deployment/ChildPolicy.java
new file mode 100644
index 0000000..688d57a
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/deployment/ChildPolicy.java
@@ -0,0 +1,47 @@
+/*
+ * 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.common.beans.autoscaler.policy.deployment;
+
+import org.apache.stratos.common.beans.autoscaler.partition.ChildLevelNetworkPartition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement
+public class ChildPolicy {
+ private String childId;
+
+ private List<ChildLevelNetworkPartition> networkPartition;
+
+ public String getChildId() {
+ return childId;
+ }
+
+ public void setChildId(String childId) {
+ this.childId = childId;
+ }
+
+ public List<ChildLevelNetworkPartition> getNetworkPartition() {
+ return networkPartition;
+ }
+
+ public void setNetworkPartition(List<ChildLevelNetworkPartition> networkPartition) {
+ this.networkPartition = networkPartition;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/deployment/DeploymentPolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/deployment/DeploymentPolicy.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/deployment/DeploymentPolicy.java
new file mode 100644
index 0000000..9a87399
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/autoscaler/policy/deployment/DeploymentPolicy.java
@@ -0,0 +1,82 @@
+/*
+ * 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.common.beans.autoscaler.policy.deployment;
+
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement
+public class DeploymentPolicy {
+
+ private String id;
+
+ private String description;
+
+ private boolean isPublic;
+
+ private ApplicationPolicy applicationPolicy;
+
+ private List<ChildPolicy> childPolicies;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public boolean getIsPublic() {
+ return isPublic();
+ }
+
+ public boolean isPublic() {
+ return isPublic;
+ }
+
+ public void setPublic(boolean isPublic) {
+ this.isPublic = isPublic;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public ApplicationPolicy getApplicationPolicy() {
+ return applicationPolicy;
+ }
+
+ public void setApplicationPolicy(ApplicationPolicy applicationPolicy) {
+ this.applicationPolicy = applicationPolicy;
+ }
+
+ public List<ChildPolicy> getChildPolicies() {
+ return childPolicies;
+ }
+
+ public void setChildPolicies(List<ChildPolicy> childPolicies) {
+ this.childPolicies = childPolicies;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/CartridgeDefinitionBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/CartridgeDefinitionBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/CartridgeDefinitionBean.java
new file mode 100644
index 0000000..35e3b98
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/CartridgeDefinitionBean.java
@@ -0,0 +1,280 @@
+/*
+ * 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.common.beans.cartridge.definition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import java.util.List;
+
+@XmlRootElement(name = "cartridgeDefinitionBean")
+public class CartridgeDefinitionBean {
+
+ private String type;
+
+ private String host;
+
+ private String provider;
+
+ //Four types - Application,Framework,Data,LB
+ private String category;
+
+ private String displayName;
+
+ private String description;
+
+ private String version;
+
+ private boolean multiTenant;
+
+ private boolean isPublic;
+
+ private DeploymentBean deployment;
+
+ private List<PortMappingBean> portMapping;
+
+ private PersistenceBean persistence;
+
+ private List<IaasProviderBean> iaasProvider;
+
+ private List<PropertyBean> property;
+
+ private String defaultAutoscalingPolicy;
+
+ private String defaultDeploymentPolicy;
+
+ private String serviceGroup;
+
+ private ContainerBean container;
+
+ private String deployerType;
+
+ private String[] exportingProperties;
+
+ public String toString () {
+
+ return "Type: " + getType() + ", Provider: " + getProvider() + ", Category: " + getCategory() + ", Host: " + getHost() + ", Display Name: " + getDisplayName() +
+ ", Description: " + getDescription() + ", Version: " + getVersion() + ", Multitenant " + isMultiTenant() +", Public " + isPublic() + "\n" +
+ getDeploymentDetails() + "\n PortMapping: " + getPortMappings() + "\n IaaS: " + getIaasProviders() +
+ "\n Properties: " + getProperties() +"\n VolumeBean mappings "+ getPersistence().toString()
+ + "\n Exports " + getExportingProperties().toString();
+ }
+
+ private String getDeploymentDetails () {
+
+ if(getDeployment() != null) {
+ return getDeployment().toString();
+ }
+ return null;
+ }
+
+ private String getPortMappings () {
+
+ StringBuilder portMappingBuilder = new StringBuilder();
+ if(getPortMapping() != null && !getPortMapping().isEmpty()) {
+ for(PortMappingBean portMappingBean : getPortMapping()) {
+ portMappingBuilder.append(portMappingBean.toString());
+ }
+ }
+ return portMappingBuilder.toString();
+ }
+
+ private String getIaasProviders () {
+
+ StringBuilder iaasBuilder = new StringBuilder();
+ if(getIaasProvider() != null && !getIaasProvider().isEmpty()) {
+ for(IaasProviderBean iaasProviderBean : getIaasProvider()) {
+ iaasBuilder.append(iaasProviderBean.toString());
+ }
+ }
+ return iaasBuilder.toString();
+ }
+
+ private String getProperties () {
+
+ StringBuilder propertyBuilder = new StringBuilder();
+ if(getProperty() != null) {
+ for(PropertyBean propertyBean : getProperty()) {
+ propertyBuilder.append(propertyBean.getName() + " : " + propertyBean.getValue() + " | ");
+ }
+ }
+ return propertyBuilder.toString();
+ }
+
+ public String[] getExportingProperties() {
+ return exportingProperties;
+ }
+
+ public void setExportingProperties(String[] exportingProperties) {
+ this.exportingProperties = exportingProperties;
+ }
+
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ public void setHost(String host) {
+ this.host = host;
+ }
+
+ public String getProvider() {
+ return provider;
+ }
+
+ public void setProvider(String provider) {
+ this.provider = provider;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ 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 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 boolean isPublic() {
+ return isPublic;
+ }
+
+ public void setPublic(boolean isPublic) {
+ this.isPublic = isPublic;
+ }
+
+ public DeploymentBean getDeployment() {
+ return deployment;
+ }
+
+ public void setDeployment(DeploymentBean deployment) {
+ this.deployment = deployment;
+ }
+
+ public List<PortMappingBean> getPortMapping() {
+ return portMapping;
+ }
+
+ public void setPortMapping(List<PortMappingBean> portMapping) {
+ this.portMapping = portMapping;
+ }
+
+ public PersistenceBean getPersistence() {
+ return persistence;
+ }
+
+ public void setPersistence(PersistenceBean persistence) {
+ this.persistence = persistence;
+ }
+
+ public List<IaasProviderBean> getIaasProvider() {
+ return iaasProvider;
+ }
+
+ public void setIaasProvider(List<IaasProviderBean> iaasProvider) {
+ this.iaasProvider = iaasProvider;
+ }
+
+ public List<PropertyBean> getProperty() {
+ return property;
+ }
+
+ public void setProperty(List<PropertyBean> property) {
+ this.property = property;
+ }
+
+ public String getDefaultAutoscalingPolicy() {
+ return defaultAutoscalingPolicy;
+ }
+
+ public void setDefaultAutoscalingPolicy(String defaultAutoscalingPolicy) {
+ this.defaultAutoscalingPolicy = defaultAutoscalingPolicy;
+ }
+
+ public String getDefaultDeploymentPolicy() {
+ return defaultDeploymentPolicy;
+ }
+
+ public void setDefaultDeploymentPolicy(String defaultDeploymentPolicy) {
+ this.defaultDeploymentPolicy = defaultDeploymentPolicy;
+ }
+
+ public String getServiceGroup() {
+ return serviceGroup;
+ }
+
+ public void setServiceGroup(String serviceGroup) {
+ this.serviceGroup = serviceGroup;
+ }
+
+ public ContainerBean getContainer() {
+ return container;
+ }
+
+ public void setContainer(ContainerBean container) {
+ this.container = container;
+ }
+
+ public String getDeployerType() {
+ return deployerType;
+ }
+
+ public void setDeployerType(String deployerType) {
+ this.deployerType = deployerType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/ContainerBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/ContainerBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/ContainerBean.java
new file mode 100644
index 0000000..ff27b87
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/ContainerBean.java
@@ -0,0 +1,38 @@
+package org.apache.stratos.common.beans.cartridge.definition;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+
+@XmlRootElement(name = "container")
+public class ContainerBean {
+
+ private String imageName;
+ private String dockerfileRepo;
+ private List<PropertyBean> property;
+
+ public String getImageName() {
+ return imageName;
+ }
+
+ public void setImageName(String imageName) {
+ this.imageName = imageName;
+ }
+
+ public String getDockerfileRepo() {
+ return dockerfileRepo;
+ }
+
+ public void setDockerfileRepo(String dockerfileRepo) {
+ this.dockerfileRepo = dockerfileRepo;
+ }
+
+ public List<PropertyBean> getProperty() {
+ return property;
+ }
+
+ public void setProperty(List<PropertyBean> property) {
+ this.property = property;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/DeploymentBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/DeploymentBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/DeploymentBean.java
new file mode 100644
index 0000000..3c94ee7
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/DeploymentBean.java
@@ -0,0 +1,62 @@
+/*
+ * 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.common.beans.cartridge.definition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement(name = "deployment")
+public class DeploymentBean {
+
+ private String baseDir;
+
+ private List<String> dir;
+
+ private String getDirectories () {
+
+ StringBuilder directoryBuilder = new StringBuilder();
+ if(getDir() != null) {
+ for(String directory : getDir()) {
+ directoryBuilder.append(directory + " | ");
+ }
+ }
+ return directoryBuilder.toString();
+ }
+
+ public String getBaseDir() {
+ return baseDir;
+ }
+
+ public void setBaseDir(String baseDir) {
+ this.baseDir = baseDir;
+ }
+
+ public List<String> getDir() {
+ return dir;
+ }
+
+ public void setDir(List<String> dir) {
+ this.dir = dir;
+ }
+
+ public String toString () {
+ return " Base Directory: " + getBaseDir() + " Directories: " + getDirectories();
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/FloatingNetworkBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/FloatingNetworkBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/FloatingNetworkBean.java
new file mode 100644
index 0000000..38eaa94
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/FloatingNetworkBean.java
@@ -0,0 +1,72 @@
+/*
+ * 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.common.beans.cartridge.definition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement (name = "floatingNetworks")
+public class FloatingNetworkBean {
+ private String name;
+ private String networkUuid;
+ private String floatingIP;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getNetworkUuid() {
+ return networkUuid;
+ }
+
+ public void setNetworkUuid(String networkUuid) {
+ this.networkUuid = networkUuid;
+ }
+
+ public String getFloatingIP() {
+ return floatingIP;
+ }
+
+ public void setFloatingIP(String floatingIP) {
+ this.floatingIP = floatingIP;
+ }
+
+ public String toString () {
+ StringBuilder sb = new StringBuilder('{');
+ String delimeter = "";
+ if (getName() != null) {
+ sb.append(delimeter).append("name : ").append(getName());
+ delimeter = ", ";
+ }
+ if (getNetworkUuid() != null) {
+ sb.append(delimeter).append("networkUuid : ").append(getNetworkUuid());
+ delimeter = ", ";
+ }
+ if (getFloatingIP() != null) {
+ sb.append(delimeter).append("floatingIP : ").append(getFloatingIP());
+ delimeter = ", ";
+ }
+ sb.append('}');
+ return sb.toString();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/IaasProviderBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/IaasProviderBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/IaasProviderBean.java
new file mode 100644
index 0000000..7d05ccb
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/IaasProviderBean.java
@@ -0,0 +1,159 @@
+/*
+ * 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.common.beans.cartridge.definition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement (name = "iaasProvider")
+public class IaasProviderBean {
+
+ private String type;
+
+ private String name;
+
+ private String className;
+
+ private String imageId;
+
+ private int maxInstanceLimit;
+
+ private String provider;
+
+ private String identity;
+
+ private String credential;
+
+ private List<PropertyBean> property;
+
+ private List<NetworkInterfaceBean> networkInterfaces;
+
+ public List<NetworkInterfaceBean> getNetworkInterfaces() {
+ return networkInterfaces;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getClassName() {
+ return className;
+ }
+
+ public void setClassName(String className) {
+ this.className = className;
+ }
+
+ public String getImageId() {
+ return imageId;
+ }
+
+ public void setImageId(String imageId) {
+ this.imageId = imageId;
+ }
+
+ public int getMaxInstanceLimit() {
+ return maxInstanceLimit;
+ }
+
+ public void setMaxInstanceLimit(int maxInstanceLimit) {
+ this.maxInstanceLimit = maxInstanceLimit;
+ }
+
+ public String getProvider() {
+ return provider;
+ }
+
+ public void setProvider(String provider) {
+ this.provider = provider;
+ }
+
+ public String getIdentity() {
+ return identity;
+ }
+
+ public void setIdentity(String identity) {
+ this.identity = identity;
+ }
+
+ public String getCredential() {
+ return credential;
+ }
+
+ public void setCredential(String credential) {
+ this.credential = credential;
+ }
+
+ public List<PropertyBean> getProperty() {
+ return property;
+ }
+
+ public void setProperty(List<PropertyBean> property) {
+ this.property = property;
+ }
+
+ public void setNetworkInterfaces(List<NetworkInterfaceBean> networkInterfaces) {
+ this.networkInterfaces = networkInterfaces;
+ }
+
+ private String getIaasPropertiesString () {
+
+ StringBuilder iaasPropertyBuilder = new StringBuilder();
+ if(getProperty() != null) {
+ for (PropertyBean propertyBean : getProperty()) {
+ iaasPropertyBuilder.append(propertyBean.getName() + " : " + propertyBean.getValue() + " | ");
+ }
+ }
+ return iaasPropertyBuilder.toString();
+ }
+
+ private String getNetworkInterfacesString() {
+ StringBuilder sb = new StringBuilder();
+ if (getNetworkInterfaces() != null) {
+ sb.append('[');
+ String delimeter = "";
+ for (NetworkInterfaceBean nib: getNetworkInterfaces()) {
+ sb.append(delimeter).append(nib);
+ delimeter = ", ";
+ }
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ public String toString () {
+ return " [ Type: " + getType() + ", Name: " + getName() + ", Class Name: " + getClassName() + ", Image Id: " + getImageId() +
+ ", Max Instance Limit: " + getMaxInstanceLimit() + ", Provider: " + getProvider() + ", Identity: " + getIdentity() +
+ ", Credentials: " + getCredential() + ", Properties: " + getIaasPropertiesString() + ", Network Interfaces: " +
+ getNetworkInterfacesString() + " ] ";
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/LoadBalancerBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/LoadBalancerBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/LoadBalancerBean.java
new file mode 100644
index 0000000..1797441
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/LoadBalancerBean.java
@@ -0,0 +1,80 @@
+/*
+ * 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.common.beans.cartridge.definition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement(name = "loadBalancer")
+public class LoadBalancerBean {
+
+ private String type;
+
+ private String deploymentPolicy;
+
+ private String autoscalingPolicy;
+
+ private List<PropertyBean> property;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDeploymentPolicy() {
+ return deploymentPolicy;
+ }
+
+ public void setDeploymentPolicy(String deploymentPolicy) {
+ this.deploymentPolicy = deploymentPolicy;
+ }
+
+ public String getAutoscalingPolicy() {
+ return autoscalingPolicy;
+ }
+
+ public void setAutoscalingPolicy(String autoscalingPolicy) {
+ this.autoscalingPolicy = autoscalingPolicy;
+ }
+
+ public List<PropertyBean> getProperty() {
+ return property;
+ }
+
+ public void setProperty(List<PropertyBean> property) {
+ this.property = property;
+ }
+
+ public String toString () {
+
+ StringBuilder lbBuilder = new StringBuilder();
+ lbBuilder.append(" Type: " + getType());
+ if(getProperty() != null && !getProperty().isEmpty()) {
+ lbBuilder.append(" Properties: ");
+ for(PropertyBean propertyBean : getProperty()) {
+ lbBuilder.append(propertyBean.getName() + " : " + propertyBean.getValue() + " | ");
+ }
+ }
+ return lbBuilder.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/NetworkInterfaceBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/NetworkInterfaceBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/NetworkInterfaceBean.java
new file mode 100644
index 0000000..ebb8c54
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/NetworkInterfaceBean.java
@@ -0,0 +1,101 @@
+/*
+ * 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.common.beans.cartridge.definition;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement (name = "networkInterfaces")
+public class NetworkInterfaceBean {
+ private String networkUuid;
+ private String fixedIp;
+ private String portUuid;
+ private List<FloatingNetworkBean> floatingNetworks;
+
+ private String getFloatingNetworksString() {
+ StringBuilder sb = new StringBuilder();
+ if (floatingNetworks != null) {
+ sb.append('[');
+ String delimeter = "";
+ for (FloatingNetworkBean floatingNetworkBean:floatingNetworks) {
+ sb.append(delimeter).append(floatingNetworkBean);
+ delimeter = ", ";
+ }
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ public String getNetworkUuid() {
+ return networkUuid;
+ }
+
+ public void setNetworkUuid(String networkUuid) {
+ this.networkUuid = networkUuid;
+ }
+
+ public String getFixedIp() {
+ return fixedIp;
+ }
+
+ public void setFixedIp(String fixedIp) {
+ this.fixedIp = fixedIp;
+ }
+
+ public String getPortUuid() {
+ return portUuid;
+ }
+
+ public void setPortUuid(String portUuid) {
+ this.portUuid = portUuid;
+ }
+
+ public void setFloatingNetworks(List<FloatingNetworkBean> floatingNetworks) {
+ this.floatingNetworks = floatingNetworks;
+ }
+
+ public List<FloatingNetworkBean> getFloatingNetworks() {
+ return floatingNetworks;
+ }
+
+ public String toString () {
+ StringBuilder sb = new StringBuilder('{');
+ String delimeter = "";
+ if (getNetworkUuid() != null) {
+ sb.append(delimeter).append("networkUuid : ").append(getNetworkUuid());
+ delimeter = ", ";
+ }
+ if (getFixedIp() != null) {
+ sb.append(delimeter).append("fixedIp : ").append(getFixedIp());
+ delimeter = ", ";
+ }
+ if (getPortUuid() != null) {
+ sb.append(delimeter).append("portUuid : ").append(getPortUuid());
+ delimeter = ", ";
+ }
+ if (getFloatingNetworks() != null) {
+ sb.append(delimeter).append("floatingNetworks : ").append(getFloatingNetworks());
+ delimeter = ", ";
+ }
+ sb.append('}');
+ return sb.toString();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/PersistenceBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/PersistenceBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/PersistenceBean.java
new file mode 100644
index 0000000..f8a767c
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/PersistenceBean.java
@@ -0,0 +1,62 @@
+/*
+ * 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.common.beans.cartridge.definition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement
+public class PersistenceBean {
+
+ private boolean isRequired;
+
+ private List<VolumeBean> volume;
+
+ public String toString () {
+ return " [ Persistence Required : " + isRequired() + "\n" +
+ "volume: " + getVolumes() + "] ";
+ }
+
+ private String getVolumes() {
+ StringBuilder volumeBuilder = new StringBuilder();
+ if(getVolume() != null && !getVolume().isEmpty()) {
+ for(VolumeBean volumeBean : getVolume()) {
+ volumeBuilder.append(volumeBean.toString());
+ }
+ }
+ return volumeBuilder.toString();
+ }
+
+ public boolean isRequired() {
+ return isRequired;
+ }
+
+ public void setRequired(boolean isRequired) {
+ this.isRequired = isRequired;
+ }
+
+ public List<VolumeBean> getVolume() {
+ return volume;
+ }
+
+ public void setVolume(List<VolumeBean> volume) {
+ this.volume = volume;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/PortMappingBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/PortMappingBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/PortMappingBean.java
new file mode 100644
index 0000000..bbe3056
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/PortMappingBean.java
@@ -0,0 +1,60 @@
+/*
+ * 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.common.beans.cartridge.definition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "portMapping")
+public class PortMappingBean {
+
+ private String protocol;
+
+ private int port;
+
+ private int proxyPort;
+
+ public String toString () {
+ return " [ Protocol: " + getProtocol() + ", Port: " + getPort() + ", Proxy port: " + getProxyPort() + "] ";
+ }
+
+ public String getProtocol() {
+ return protocol;
+ }
+
+ public void setProtocol(String protocol) {
+ this.protocol = protocol;
+ }
+
+ public int getPort() {
+ return port;
+ }
+
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ public int getProxyPort() {
+ return proxyPort;
+ }
+
+ public void setProxyPort(int proxyPort) {
+ this.proxyPort = proxyPort;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/PropertyBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/PropertyBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/PropertyBean.java
new file mode 100644
index 0000000..72d0792
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/PropertyBean.java
@@ -0,0 +1,46 @@
+/*
+ * 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.common.beans.cartridge.definition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "property")
+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/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/ServiceDefinitionBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/ServiceDefinitionBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/ServiceDefinitionBean.java
new file mode 100644
index 0000000..3c89d51
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/ServiceDefinitionBean.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.common.beans.cartridge.definition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "serviceDefinitionBean")
+public class ServiceDefinitionBean {
+
+ private String serviceName;
+ private String cartridgeType;
+ private String deploymentPolicyName;
+ private String autoscalingPolicyName;
+ private String clusterDomain;
+ private String clusterSubDomain;
+ private String tenantRange;
+ private boolean isPublic;
+
+ public String getServiceName() {
+ return serviceName;
+ }
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
+ public String getCartridgeType() {
+ return cartridgeType;
+ }
+ public void setCartridgeType(String cartridgeType) {
+ this.cartridgeType = cartridgeType;
+ }
+ public String getDeploymentPolicyName() {
+ return deploymentPolicyName;
+ }
+ public void setDeploymentPolicyName(String deploymentPolicyName) {
+ this.deploymentPolicyName = deploymentPolicyName;
+ }
+ public String getAutoscalingPolicyName() {
+ return autoscalingPolicyName;
+ }
+ public void setAutoscalingPolicyName(String autoscalingPolicyName) {
+ this.autoscalingPolicyName = autoscalingPolicyName;
+ }
+ public String getClusterDomain() {
+ return clusterDomain;
+ }
+ public void setClusterDomain(String clusterDomain) {
+ this.clusterDomain = clusterDomain;
+ }
+ public String getClusterSubDomain() {
+ return clusterSubDomain;
+ }
+ public void setClusterSubDomain(String clusterSubDomain) {
+ this.clusterSubDomain = clusterSubDomain;
+ }
+ public String getTenantRange() {
+ return tenantRange;
+ }
+ public void setTenantRange(String tenantRange) {
+ this.tenantRange = tenantRange;
+ }
+ public boolean getIsPublic() {
+ return isPublic;
+ }
+ public void setIsPublic(boolean isPublic) {
+ this.isPublic = isPublic;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/VolumeBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/VolumeBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/VolumeBean.java
new file mode 100644
index 0000000..0c1eb9a
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/cartridge/definition/VolumeBean.java
@@ -0,0 +1,101 @@
+/*
+ * 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.common.beans.cartridge.definition;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class VolumeBean {
+
+ private String id;
+
+ private String size;
+
+ private String device;
+
+ private boolean removeOnTermination;
+
+ private String mappingPath;
+
+ private String snapshotId;
+
+ private String volumeId;
+
+ public String toString () {
+ return " [ Persistence Required : " + ", Size: " + getSize() + ", device: " +
+ getDevice() + " remove on termination " + isRemoveOnTermination() +
+ ", mappingPath : " + getMappingPath() + "] ";
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getSize() {
+ return size;
+ }
+
+ public void setSize(String size) {
+ this.size = size;
+ }
+
+ public String getDevice() {
+ return device;
+ }
+
+ public void setDevice(String device) {
+ this.device = device;
+ }
+
+ public boolean isRemoveOnTermination() {
+ return removeOnTermination;
+ }
+
+ public void setRemoveOnTermination(boolean removeOnTermination) {
+ this.removeOnTermination = removeOnTermination;
+ }
+
+ public String getMappingPath() {
+ return mappingPath;
+ }
+
+ public void setMappingPath(String mappingPath) {
+ this.mappingPath = mappingPath;
+ }
+
+ public String getSnapshotId() {
+ return snapshotId;
+ }
+
+ public void setSnapshotId(String snapshotId) {
+ this.snapshotId = snapshotId;
+ }
+
+ public String getVolumeId() {
+ return volumeId;
+ }
+
+ public void setVolumeId(String volumeId) {
+ this.volumeId = volumeId;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/KubernetesGroup.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/KubernetesGroup.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/KubernetesGroup.java
new file mode 100644
index 0000000..3bd21ef
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/KubernetesGroup.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.common.beans.kubernetes;
+
+import org.apache.stratos.common.beans.cartridge.definition.PropertyBean;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement
+public class KubernetesGroup {
+
+ private String groupId;
+ private String description;
+ private List<KubernetesHost> kubernetesHosts;
+ private KubernetesMaster kubernetesMaster;
+ private PortRange portRange;
+ private List<PropertyBean> property;
+
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+
+ public List<KubernetesHost> getKubernetesHosts() {
+ return kubernetesHosts;
+ }
+
+ public void setKubernetesHosts(List<KubernetesHost> kubernetesHosts) {
+ this.kubernetesHosts = kubernetesHosts;
+ }
+
+ public KubernetesMaster getKubernetesMaster() {
+ return kubernetesMaster;
+ }
+
+ public void setKubernetesMaster(KubernetesMaster kubernetesMaster) {
+ this.kubernetesMaster = kubernetesMaster;
+ }
+
+ public PortRange getPortRange() {
+ return portRange;
+ }
+
+ public void setPortRange(PortRange portRange) {
+ this.portRange = portRange;
+ }
+
+ public List<PropertyBean> getProperty() {
+ return property;
+ }
+
+ public void setProperty(List<PropertyBean> property) {
+ this.property = property;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/KubernetesHost.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/KubernetesHost.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/KubernetesHost.java
new file mode 100644
index 0000000..a8d4b05
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/KubernetesHost.java
@@ -0,0 +1,67 @@
+/*
+ *
+ * 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.common.beans.kubernetes;
+
+import org.apache.stratos.common.beans.cartridge.definition.PropertyBean;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement
+public class KubernetesHost {
+ private String hostId;
+ private String hostname;
+ private String hostIpAddress;
+ private List<PropertyBean> property;
+
+ public String getHostId() {
+ return hostId;
+ }
+
+ public void setHostId(String hostId) {
+ this.hostId = hostId;
+ }
+
+ public String getHostname() {
+ return hostname;
+ }
+
+ public void setHostname(String hostname) {
+ this.hostname = hostname;
+ }
+
+ public String getHostIpAddress() {
+ return hostIpAddress;
+ }
+
+ public void setHostIpAddress(String hostIpAddress) {
+ this.hostIpAddress = hostIpAddress;
+ }
+
+ public List<PropertyBean> getProperty() {
+ return property;
+ }
+
+ public void setProperty(List<PropertyBean> property) {
+ this.property = property;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/KubernetesMaster.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/KubernetesMaster.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/KubernetesMaster.java
new file mode 100644
index 0000000..d023d19
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/KubernetesMaster.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.common.beans.kubernetes;
+
+import org.apache.stratos.common.beans.cartridge.definition.PropertyBean;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+@XmlRootElement
+public class KubernetesMaster {
+ private String hostId;
+ private String hostname;
+ private String hostIpAddress;
+ private List<PropertyBean> property;
+ private String endpoint;
+
+ public String getHostId() {
+ return hostId;
+ }
+
+ public void setHostId(String hostId) {
+ this.hostId = hostId;
+ }
+
+ public String getHostname() {
+ return hostname;
+ }
+
+ public void setHostname(String hostname) {
+ this.hostname = hostname;
+ }
+
+ public String getHostIpAddress() {
+ return hostIpAddress;
+ }
+
+ public void setHostIpAddress(String hostIpAddress) {
+ this.hostIpAddress = hostIpAddress;
+ }
+
+ public List<PropertyBean> getProperty() {
+ return property;
+ }
+
+ public void setProperty(List<PropertyBean> property) {
+ this.property = property;
+ }
+
+ public String getEndpoint() {
+ return endpoint;
+ }
+
+ public void setEndpoint(String endpoint) {
+ this.endpoint = endpoint;
+ }
+}
[7/7] stratos git commit: Moving rest api domain model to stratos
common component to be reused by the cli
Posted by im...@apache.org.
Moving rest api domain model to stratos common component to be reused by the cli
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/df2d6e6c
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/df2d6e6c
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/df2d6e6c
Branch: refs/heads/4.1.0-test
Commit: df2d6e6ced1959fe81eb8eee85b9635574d1bdb4
Parents: 0b9a0d7
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sun Dec 14 11:14:40 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Dec 14 11:14:53 2014 +0530
----------------------------------------------------------------------
components/org.apache.stratos.cli/pom.xml | 5 +
.../java/org/apache/stratos/cli/RestClient.java | 39 +-
.../stratos/cli/RestCommandLineService.java | 668 ++++------
.../apache/stratos/cli/StratosApplication.java | 15 -
.../stratos/cli/beans/SubscriptionInfo.java | 44 -
.../stratos/cli/beans/TenantInfoBean.java | 105 --
.../apache/stratos/cli/beans/UserInfoBean.java | 88 --
.../autoscaler/partition/NetworkPartition.java | 54 -
.../beans/autoscaler/partition/Partition.java | 96 --
.../autoscaler/partition/PropertyBean.java | 48 -
.../policy/autoscale/AutoscalePolicy.java | 82 --
.../policy/autoscale/LoadAverage.java | 32 -
.../policy/autoscale/LoadThresholds.java | 28 -
.../policy/autoscale/MemoryConsumption.java | 33 -
.../policy/autoscale/RequestsInFlight.java | 33 -
.../policy/deployment/DeploymentPolicy.java | 78 --
.../stratos/cli/beans/cartridge/Cartridge.java | 274 ----
.../cli/beans/cartridge/CartridgeInfoBean.java | 151 ---
.../cli/beans/cartridge/PortMapping.java | 68 -
.../beans/cartridge/ServiceDefinitionBean.java | 95 --
.../grouping/applications/Application.java | 70 -
.../beans/grouping/applications/Cluster.java | 56 -
.../cli/beans/grouping/applications/Group.java | 92 --
.../beans/grouping/applications/Instance.java | 26 -
.../cli/beans/grouping/applications/Member.java | 130 --
.../beans/grouping/applications/Property.java | 46 -
.../beans/grouping/applications/SubGroup.java | 70 -
.../grouping/serviceGroups/Dependencies.java | 46 -
.../serviceGroups/ServiceGroupBean.java | 33 -
.../serviceGroups/ServiceGroupDefinition.java | 70 -
.../cli/beans/kubernetes/KubernetesGroup.java | 44 -
.../beans/kubernetes/KubernetesGroupList.java | 37 -
.../cli/beans/kubernetes/KubernetesHost.java | 53 -
.../beans/kubernetes/KubernetesHostList.java | 37 -
.../stratos/cli/beans/topology/Cluster.java | 116 --
.../stratos/cli/beans/topology/Member.java | 123 --
.../cli/beans/topology/MemberStatus.java | 26 -
.../apache/stratos/cli/beans/topology/Port.java | 64 -
.../cli/commands/DescribePartitionCommand.java | 70 -
.../ListCartridgeSubscriptionsCommand.java | 120 --
.../stratos/common/beans/ApplicationBean.java | 75 ++
.../stratos/common/beans/CartridgeInfoBean.java | 167 +++
.../org/apache/stratos/common/beans/Error.java | 45 +
.../apache/stratos/common/beans/GroupBean.java | 99 ++
.../common/beans/StratosApiResponse.java | 36 +
.../common/beans/SubscriptionDomainRequest.java | 42 +
.../stratos/common/beans/TenantInfoBean.java | 2 +-
.../stratos/common/beans/UserInfoBean.java | 103 ++
.../ApplicationLevelNetworkPartition.java | 58 +
.../partition/ChildLevelNetworkPartition.java | 55 +
.../partition/ChildLevelPartition.java | 44 +
.../beans/autoscaler/partition/Partition.java | 83 ++
.../policy/autoscale/AutoscalePolicy.java | 87 ++
.../policy/autoscale/LoadAverageThresholds.java | 46 +
.../policy/autoscale/LoadThresholds.java | 54 +
.../autoscale/MemoryConsumptionThresholds.java | 46 +
.../autoscale/RequestsInFlightThresholds.java | 46 +
.../policy/deployment/ApplicationPolicy.java | 49 +
.../policy/deployment/ChildPolicy.java | 47 +
.../policy/deployment/DeploymentPolicy.java | 82 ++
.../definition/CartridgeDefinitionBean.java | 280 ++++
.../cartridge/definition/ContainerBean.java | 38 +
.../cartridge/definition/DeploymentBean.java | 62 +
.../definition/FloatingNetworkBean.java | 72 +
.../cartridge/definition/IaasProviderBean.java | 159 +++
.../cartridge/definition/LoadBalancerBean.java | 80 ++
.../definition/NetworkInterfaceBean.java | 101 ++
.../cartridge/definition/PersistenceBean.java | 62 +
.../cartridge/definition/PortMappingBean.java | 60 +
.../cartridge/definition/PropertyBean.java | 46 +
.../definition/ServiceDefinitionBean.java | 85 ++
.../beans/cartridge/definition/VolumeBean.java | 101 ++
.../beans/kubernetes/KubernetesGroup.java | 84 ++
.../common/beans/kubernetes/KubernetesHost.java | 67 +
.../beans/kubernetes/KubernetesMaster.java | 76 ++
.../common/beans/kubernetes/PortRange.java | 44 +
.../common/beans/kubernetes/Properties.java | 50 +
.../common/beans/kubernetes/Property.java | 62 +
.../repositoryNotificationInfoBean/Payload.java | 34 +
.../Repository.java | 43 +
.../domain/SubscriptionDomainBean.java | 44 +
.../stratos/common/beans/topology/Cluster.java | 126 ++
.../stratos/common/beans/topology/Instance.java | 45 +
.../stratos/common/beans/topology/Member.java | 127 ++
.../manager/user/mgt/StratosUserManager.java | 2 +-
.../manager/user/mgt/beans/UserInfoBean.java | 103 --
.../definition/PropertyBean.java | 34 +-
.../rest/endpoint/api/StratosApiV40.java | 28 +-
.../rest/endpoint/api/StratosApiV40Utils.java | 70 +-
.../rest/endpoint/api/StratosApiV41.java | 24 +-
.../rest/endpoint/api/StratosApiV41Utils.java | 56 +-
.../rest/endpoint/bean/ApplicationBean.java | 60 -
.../rest/endpoint/bean/CartridgeInfoBean.java | 167 ---
.../stratos/rest/endpoint/bean/Error.java | 45 -
.../stratos/rest/endpoint/bean/GroupBean.java | 99 --
.../rest/endpoint/bean/StratosApiResponse.java | 36 -
.../bean/SubscriptionDomainRequest.java | 35 -
.../ApplicationLevelNetworkPartition.java | 34 -
.../partition/ChildLevelNetworkPartition.java | 31 -
.../partition/ChildLevelPartition.java | 28 -
.../bean/autoscaler/partition/Partition.java | 39 -
.../policy/autoscale/AutoscalePolicy.java | 87 --
.../policy/autoscale/LoadAverageThresholds.java | 30 -
.../policy/autoscale/LoadThresholds.java | 30 -
.../autoscale/MemoryConsumptionThresholds.java | 30 -
.../autoscale/RequestsInFlightThresholds.java | 31 -
.../policy/deployment/ApplicationPolicy.java | 34 -
.../policy/deployment/ChildPolicy.java | 31 -
.../policy/deployment/DeploymentPolicy.java | 41 -
.../definition/CartridgeDefinitionBean.java | 280 ----
.../cartridge/definition/ContainerBean.java | 14 -
.../cartridge/definition/DeploymentBean.java | 46 -
.../definition/FloatingNetworkBean.java | 51 -
.../cartridge/definition/IaasProviderBean.java | 79 --
.../cartridge/definition/LoadBalancerBean.java | 48 -
.../definition/NetworkInterfaceBean.java | 68 -
.../cartridge/definition/PersistenceBean.java | 62 -
.../cartridge/definition/PortMappingBean.java | 36 -
.../bean/cartridge/definition/PropertyBean.java | 30 -
.../definition/ServiceDefinitionBean.java | 85 --
.../bean/cartridge/definition/VolumeBean.java | 101 --
.../bean/kubernetes/KubernetesGroup.java | 84 --
.../bean/kubernetes/KubernetesHost.java | 67 -
.../bean/kubernetes/KubernetesMaster.java | 76 --
.../endpoint/bean/kubernetes/PortRange.java | 44 -
.../endpoint/bean/kubernetes/Properties.java | 50 -
.../rest/endpoint/bean/kubernetes/Property.java | 62 -
.../repositoryNotificationInfoBean/Payload.java | 34 -
.../Repository.java | 43 -
.../domain/SubscriptionDomainBean.java | 29 -
.../rest/endpoint/bean/topology/Cluster.java | 63 -
.../rest/endpoint/bean/topology/Instance.java | 29 -
.../rest/endpoint/bean/topology/Member.java | 48 -
.../bean/util/converter/PojoConverter.java | 1255 ------------------
.../endpoint/bean/util/type/list/ListType.java | 39 -
.../endpoint/bean/util/type/map/MapAdapter.java | 52 -
.../bean/util/type/map/MapEntryType.java | 32 -
.../endpoint/bean/util/type/map/MapType.java | 28 -
.../stratos/rest/endpoint/mock/MockContext.java | 52 +-
.../rest/endpoint/mock/StratosApiV40Mock.java | 24 +-
.../endpoint/util/converter/PojoConverter.java | 1255 ++++++++++++++++++
.../rest/endpoint/util/type/list/ListType.java | 39 +
.../rest/endpoint/util/type/map/MapAdapter.java | 52 +
.../endpoint/util/type/map/MapEntryType.java | 32 +
.../rest/endpoint/util/type/map/MapType.java | 28 +
.../webapp/api-test/WEB-INF/cxf-servlet.xml | 2 +-
.../src/main/webapp/api/WEB-INF/cxf-servlet.xml | 3 +-
.../mgt/services/TenantMgtAdminService.java | 2 -
148 files changed, 5040 insertions(+), 7168 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/pom.xml b/components/org.apache.stratos.cli/pom.xml
index fbd3c9a..a83c997 100644
--- a/components/org.apache.stratos.cli/pom.xml
+++ b/components/org.apache.stratos.cli/pom.xml
@@ -64,6 +64,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java
index 0c549eb..f0f1050 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java
@@ -36,6 +36,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
+import java.lang.reflect.Type;
public class RestClient implements GenericRestClient {
@@ -232,6 +233,17 @@ public class RestClient implements GenericRestClient {
}
}
+ public Object listEntity(String serviceEndpoint, Type type, String entityName) {
+ try {
+ return executeGet(serviceEndpoint, type);
+ } catch (Exception e) {
+ String message = String.format("Error in listing %s", entityName);
+ System.out.println(message);
+ logger.error(message, e);
+ return null;
+ }
+ }
+
private int executePost(String serviceEndpoint, String postBody) throws IOException {
DefaultHttpClient httpClient = new DefaultHttpClient();
try {
@@ -248,6 +260,28 @@ public class RestClient implements GenericRestClient {
}
private Object executeGet(String serviceEndpoint, Class responseJsonClass) throws Exception {
+ String resultString = executeGet(serviceEndpoint);
+ if (resultString == null) {
+ return null;
+ }
+
+ GsonBuilder gsonBuilder = new GsonBuilder();
+ Gson gson = gsonBuilder.create();
+ return gson.fromJson(resultString, responseJsonClass);
+ }
+
+ private Object executeGet(String serviceEndpoint, Type responseJsonType) throws Exception {
+ String resultString = executeGet(serviceEndpoint);
+ if (resultString == null) {
+ return null;
+ }
+
+ GsonBuilder gsonBuilder = new GsonBuilder();
+ Gson gson = gsonBuilder.create();
+ return gson.fromJson(resultString, responseJsonType);
+ }
+
+ private String executeGet(String serviceEndpoint) throws Exception {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpResponse response = null;
@@ -262,10 +296,7 @@ public class RestClient implements GenericRestClient {
CliUtils.printError(response);
return null;
} else {
- String resultString = CliUtils.getHttpResponseString(response);
- GsonBuilder gsonBuilder = new GsonBuilder();
- Gson gson = gsonBuilder.create();
- return gson.fromJson(resultString, responseJsonClass);
+ return CliUtils.getHttpResponseString(response);
}
} finally {
httpClient.getConnectionManager().shutdown();
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/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 e757821..56b811e 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
@@ -18,6 +18,7 @@
*/
package org.apache.stratos.cli;
+import java.lang.reflect.Type;
import java.net.ConnectException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -33,6 +34,7 @@ import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
+import com.google.gson.reflect.TypeToken;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
@@ -40,27 +42,26 @@ import org.apache.axis2.description.TransportOutDescription;
import org.apache.axis2.transport.http.HttpTransportProperties;
import org.apache.http.HttpResponse;
import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.stratos.cli.beans.TenantInfoBean;
-import org.apache.stratos.cli.beans.UserInfoBean;
-import org.apache.stratos.cli.beans.autoscaler.partition.Partition;
-import org.apache.stratos.cli.beans.autoscaler.policy.autoscale.AutoscalePolicy;
-import org.apache.stratos.cli.beans.autoscaler.policy.deployment.DeploymentPolicy;
-import org.apache.stratos.cli.beans.cartridge.Cartridge;
-import org.apache.stratos.cli.beans.cartridge.PortMapping;
-import org.apache.stratos.cli.beans.cartridge.ServiceDefinitionBean;
-import org.apache.stratos.cli.beans.grouping.applications.Application;
-import org.apache.stratos.cli.beans.grouping.serviceGroups.ServiceGroupBean;
-import org.apache.stratos.cli.beans.kubernetes.KubernetesGroup;
-import org.apache.stratos.cli.beans.kubernetes.KubernetesGroupList;
-import org.apache.stratos.cli.beans.kubernetes.KubernetesHost;
-import org.apache.stratos.cli.beans.kubernetes.KubernetesHostList;
-import org.apache.stratos.cli.beans.topology.Cluster;
-import org.apache.stratos.cli.beans.topology.Member;
+import org.apache.stratos.common.beans.TenantInfoBean;
+import org.apache.stratos.common.beans.UserInfoBean;
+import org.apache.stratos.common.beans.autoscaler.partition.Partition;
+import org.apache.stratos.common.beans.autoscaler.policy.autoscale.AutoscalePolicy;
+import org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy;
+import org.apache.stratos.common.beans.cartridge.definition.CartridgeDefinitionBean;
+import org.apache.stratos.common.beans.cartridge.definition.PortMappingBean;
+import org.apache.stratos.common.beans.cartridge.definition.ServiceDefinitionBean;
+import org.apache.stratos.common.beans.ApplicationBean;
+import org.apache.stratos.common.beans.GroupBean;
+import org.apache.stratos.common.beans.kubernetes.KubernetesGroup;
+import org.apache.stratos.common.beans.kubernetes.KubernetesHost;
+import org.apache.stratos.common.beans.topology.Cluster;
+import org.apache.stratos.common.beans.topology.Member;
import org.apache.stratos.cli.exception.CommandException;
import org.apache.stratos.cli.exception.ExceptionMapper;
import org.apache.stratos.cli.utils.CliConstants;
import org.apache.stratos.cli.utils.CliUtils;
import org.apache.stratos.cli.utils.RowMapper;
+import org.apache.stratos.manager.dto.Cartridge;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -245,14 +246,16 @@ public class RestCommandLineService {
this.restClient = new RestClient(serverURL, username, password);
}
- public Cartridge getCartridge(String cartridgeType) throws CommandException {
+ public CartridgeDefinitionBean getCartridge(String cartridgeType) throws CommandException {
try {
- CartridgeList list = (CartridgeList) restClient.listEntity(ENDPOINT_LIST_CARTRIDGES,
- CartridgeList.class, "cartridges");
-
- for (int i = 0; i < list.getCartridge().size(); i++) {
- Cartridge cartridge = list.getCartridge().get(i);
- if (cartridgeType.equals(cartridge.getCartridgeType())) {
+ Type listType = new TypeToken<ArrayList<CartridgeDefinitionBean>>() {
+ }.getType();
+ List<CartridgeDefinitionBean> cartridgeList = (List<CartridgeDefinitionBean>) restClient.listEntity(ENDPOINT_LIST_CARTRIDGES,
+ listType, "cartridges");
+
+ for (int i = 0; i < cartridgeList.size(); i++) {
+ CartridgeDefinitionBean cartridge = cartridgeList.get(i);
+ if (cartridgeType.equals(cartridge.getType())) {
return cartridge;
}
}
@@ -264,20 +267,20 @@ public class RestCommandLineService {
return null;
}
- public ArrayList<Cartridge> listCartridgesByServiceGroup(String serviceGroup) throws CommandException {
+ public ArrayList<CartridgeDefinitionBean> listCartridgesByServiceGroup(String serviceGroup) throws CommandException {
try {
- CartridgeList list = (CartridgeList) restClient.listEntity(ENDPOINT_LIST_CARTRIDGES,
- CartridgeList.class, "cartridges");
-
- ArrayList<Cartridge> arrayList = new ArrayList<Cartridge>();
- for (int i = 0; i < list.getCartridge().size(); i++) {
- if (serviceGroup.equals(list.getCartridge().get(i).getServiceGroup())) {
- arrayList.add(list.getCartridge().get(i));
+ Type listType = new TypeToken<ArrayList<CartridgeDefinitionBean>>() {
+ }.getType();
+ List<CartridgeDefinitionBean> cartridgeList = (List<CartridgeDefinitionBean>) restClient.listEntity(ENDPOINT_LIST_CARTRIDGES,
+ listType, "cartridges");
+
+ ArrayList<CartridgeDefinitionBean> arrayList = new ArrayList<CartridgeDefinitionBean>();
+ for (int i = 0; i < cartridgeList.size(); i++) {
+ if (serviceGroup.equals(cartridgeList.get(i).getServiceGroup())) {
+ arrayList.add(cartridgeList.get(i));
}
}
-
return arrayList;
-
} catch (Exception e) {
String message = "Error in listing cartridges";
System.out.println(message);
@@ -289,35 +292,34 @@ public class RestCommandLineService {
// List currently available multi tenant and single tenant cartridges
public void listCartridges() throws CommandException {
try {
- CartridgeList cartridgeList = (CartridgeList) restClient.listEntity(ENDPOINT_LIST_CARTRIDGES,
- CartridgeList.class, "cartridges");
+ Type listType = new TypeToken<ArrayList<CartridgeDefinitionBean>>() {
+ }.getType();
+ List<CartridgeDefinitionBean> cartridgeList = (List<CartridgeDefinitionBean>) restClient.listEntity(ENDPOINT_LIST_CARTRIDGES,
+ listType, "cartridges");
- if ((cartridgeList == null) || (cartridgeList.getCartridge() == null) ||
- (cartridgeList.getCartridge().size() == 0)) {
+ if ((cartridgeList == null) || (cartridgeList.size() == 0)) {
System.out.println("No cartridges found");
return;
}
- RowMapper<Cartridge> cartridgeMapper = new RowMapper<Cartridge>() {
+ RowMapper<CartridgeDefinitionBean> cartridgeMapper = new RowMapper<CartridgeDefinitionBean>() {
- public String[] getData(Cartridge cartridge) {
- String[] data = new String[6];
- data[0] = cartridge.getCartridgeType();
+ public String[] getData(CartridgeDefinitionBean cartridge) {
+ String[] data = new String[5];
+ data[0] = cartridge.getType();
data[1] = cartridge.getDisplayName();
data[2] = cartridge.getDescription();
data[3] = cartridge.getVersion();
data[4] = String.valueOf(cartridge.isMultiTenant());
- data[5] = cartridge.getIsPublic() ? "Public" : "Private";
return data;
}
};
- Cartridge[] cartridges = new Cartridge[cartridgeList.getCartridge().size()];
- cartridges = cartridgeList.getCartridge().toArray(cartridges);
+ CartridgeDefinitionBean[] cartridges = new CartridgeDefinitionBean[cartridgeList.size()];
+ cartridges = cartridgeList.toArray(cartridges);
System.out.println("Cartridges found:");
- CliUtils.printTable(cartridges, cartridgeMapper, "Type", "Name", "Description", "Version",
- "Is Multi-Tenant", "Accessibility");
+ CliUtils.printTable(cartridges, cartridgeMapper, "Type", "Name", "Description", "Version", "Multi-Tenant");
} catch (Exception e) {
String message = "Error in listing cartridges";
System.out.println(message);
@@ -328,17 +330,18 @@ public class RestCommandLineService {
// Describe currently available multi tenant and single tenant cartridges
public void describeAvailableCartridges(String cartridgeType) throws CommandException {
try {
- CartridgeList cartridgeList = (CartridgeList) restClient.listEntity(ENDPOINT_LIST_CARTRIDGES,
- CartridgeList.class, "cartridges");
+ Type listType = new TypeToken<ArrayList<CartridgeDefinitionBean>>() {
+ }.getType();
+ List<CartridgeDefinitionBean> cartridgeList = (List<CartridgeDefinitionBean>) restClient.listEntity(ENDPOINT_LIST_CARTRIDGES,
+ listType, "cartridges");
- if ((cartridgeList == null) || (cartridgeList.getCartridge() == null) ||
- (cartridgeList.getCartridge().size() == 0)) {
+ if ((cartridgeList == null) || (cartridgeList.size() == 0)) {
System.out.println("Cartridge not found");
return;
}
- for (Cartridge tmp : cartridgeList.getCartridge()) {
- if (tmp.getCartridgeType().equalsIgnoreCase(cartridgeType)) {
+ for (CartridgeDefinitionBean tmp : cartridgeList) {
+ if (tmp.getType().equalsIgnoreCase(cartridgeType)) {
System.out.println("Cartridge:");
System.out.println(getGson().toJson(tmp));
return;
@@ -353,75 +356,75 @@ public class RestCommandLineService {
}
// List subscribe cartridges
- public void listCartridgeSubscriptions(final boolean showURLs) throws CommandException {
- try {
- CartridgeList cartridgeList = (CartridgeList) restClient.listEntity(ENDPOINT_LIST_CARTRIDGE_SUBSCRIPTIONS,
- CartridgeList.class, "cartridge subscriptions");
-
- if ((cartridgeList == null) || (cartridgeList.getCartridge() == null) ||
- (cartridgeList.getCartridge().size() == 0)) {
- System.out.println("No cartridge subscriptions found");
- return;
- }
-
- CartridgeList applicationCartridgeList = new CartridgeList();
-
- // Filter out LB cartridges
- List<Cartridge> allCartridges = cartridgeList.getCartridge();
- for (Cartridge cartridge : allCartridges) {
- if (!cartridge.isLoadBalancer()) {
- applicationCartridgeList.getCartridge().add(cartridge);
- }
- }
-
- Cartridge[] cartridges = new Cartridge[applicationCartridgeList.getCartridge().size()];
- cartridges = applicationCartridgeList.getCartridge().toArray(cartridges);
-
- RowMapper<Cartridge> cartridgeMapper = new RowMapper<Cartridge>() {
-
- public String[] getData(Cartridge cartridge) {
- String[] data = showURLs ? new String[11] : new String[9];
- data[0] = cartridge.getCartridgeType();
- data[1] = cartridge.getDisplayName();
- data[2] = cartridge.getIsPublic() ? "Public" : "Private";
- data[3] = cartridge.getVersion();
- data[4] = cartridge.isMultiTenant() ? "Multi-Tenant" : "Single-Tenant";
- data[5] = cartridge.getCartridgeAlias();
- data[6] = cartridge.getStatus();
- data[7] = cartridge.isMultiTenant() ? "N/A" : String.valueOf(cartridge.getActiveInstances());
- data[8] = cartridge.getHostName();
- if (showURLs) {
- data[9] = getAccessURLs(cartridge);
- data[10] = cartridge.getRepoURL() != null ? cartridge.getRepoURL() : "";
- }
- return data;
-
- }
- };
-
- List<String> headers = new ArrayList<String>();
- headers.add("Type");
- headers.add("Name");
- headers.add("Accessibility");
- headers.add("Version");
- headers.add("Tenancy Model");
- headers.add("Alias");
- headers.add("Status");
- headers.add("Running Instances");
- headers.add("Host Name");
- if (showURLs) {
- headers.add("Access URL(s)");
- headers.add("Repo URL");
- }
-
- System.out.println("Cartridge subscriptions found:");
- CliUtils.printTable(cartridges, cartridgeMapper, headers.toArray(new String[headers.size()]));
- } catch (Exception e) {
- String message = "Error in listing cartridge subscriptions";
- System.out.println(message);
- log.error(message, e);
- }
- }
+// public void listCartridgeSubscriptions(final boolean showURLs) throws CommandException {
+// try {
+// CartridgeList cartridgeList = (CartridgeList) restClient.listEntity(ENDPOINT_LIST_CARTRIDGE_SUBSCRIPTIONS,
+// CartridgeList.class, "cartridge subscriptions");
+//
+// if ((cartridgeList == null) || (cartridgeList.getCartridge() == null) ||
+// (cartridgeList.getCartridge().size() == 0)) {
+// System.out.println("No cartridge subscriptions found");
+// return;
+// }
+//
+// CartridgeList applicationCartridgeList = new CartridgeList();
+//
+// // Filter out LB cartridges
+// List<Cartridge> allCartridges = cartridgeList.getCartridge();
+// for (Cartridge cartridge : allCartridges) {
+// if (!cartridge.isLoadBalancer()) {
+// applicationCartridgeList.getCartridge().add(cartridge);
+// }
+// }
+//
+// Cartridge[] cartridges = new Cartridge[applicationCartridgeList.getCartridge().size()];
+// cartridges = applicationCartridgeList.getCartridge().toArray(cartridges);
+//
+// RowMapper<Cartridge> cartridgeMapper = new RowMapper<Cartridge>() {
+//
+// public String[] getData(Cartridge cartridge) {
+// String[] data = showURLs ? new String[11] : new String[9];
+// data[0] = cartridge.getCartridgeType();
+// data[1] = cartridge.getDisplayName();
+// data[2] = cartridge.getIsPublic() ? "Public" : "Private";
+// data[3] = cartridge.getVersion();
+// data[4] = cartridge.isMultiTenant() ? "Multi-Tenant" : "Single-Tenant";
+// data[5] = cartridge.getCartridgeAlias();
+// data[6] = cartridge.getStatus();
+// data[7] = cartridge.isMultiTenant() ? "N/A" : String.valueOf(cartridge.getActiveInstances());
+// data[8] = cartridge.getHostName();
+// if (showURLs) {
+// data[9] = getAccessURLs(cartridge);
+// data[10] = cartridge.getRepoURL() != null ? cartridge.getRepoURL() : "";
+// }
+// return data;
+//
+// }
+// };
+//
+// List<String> headers = new ArrayList<String>();
+// headers.add("Type");
+// headers.add("Name");
+// headers.add("Accessibility");
+// headers.add("Version");
+// headers.add("Tenancy Model");
+// headers.add("Alias");
+// headers.add("Status");
+// headers.add("Running Instances");
+// headers.add("Host Name");
+// if (showURLs) {
+// headers.add("Access URL(s)");
+// headers.add("Repo URL");
+// }
+//
+// System.out.println("Cartridge subscriptions found:");
+// CliUtils.printTable(cartridges, cartridgeMapper, headers.toArray(new String[headers.size()]));
+// } catch (Exception e) {
+// String message = "Error in listing cartridge subscriptions";
+// System.out.println(message);
+// log.error(message, e);
+// }
+// }
// Lists subscribed cartridge info (from alias)
public void describeCartridgeSubscription(String alias) throws CommandException {
@@ -438,9 +441,9 @@ public class RestCommandLineService {
Cartridge cartridge = cartridgeWrapper.getCartridge();
// Get LB IP s
- Map<String, Set<String>> lbIpMap = getLbIpList(cartridge, httpClient);
- final Set<String> lbPrivateIpSet = lbIpMap.get("private");
- final Set<String> lbFloatingIpSet = lbIpMap.get("floating");
+ //Map<String, Set<String>> lbIpMap = getLbIpList(cartridge, httpClient);
+ //final Set<String> lbPrivateIpSet = lbIpMap.get("private");
+ //final Set<String> lbFloatingIpSet = lbIpMap.get("floating");
Cartridge[] cartridges = new Cartridge[1];
cartridges[0] = cartridge;
@@ -448,30 +451,30 @@ public class RestCommandLineService {
System.out.println("\tType : " + cartridge.getCartridgeType());
System.out.println("\tName : " + cartridge.getDisplayName());
System.out.println("\tVersion : " + cartridge.getVersion());
- System.out.println("\tPublic : " + cartridge.getIsPublic());
- String tenancy = cartridge.isMultiTenant() ? "Multi-Tenant" : "Single-Tenant";
+ //System.out.println("\tPublic : " + cartridge.getIsPublic());
+ String tenancy = cartridge.isMultiTenantSpecified() ? "Multi-Tenant" : "Single-Tenant";
System.out.println("\tTenancy Model : " + tenancy);
System.out.println("\tAlias : " + cartridge.getCartridgeAlias());
System.out.println("\tStatus : " + cartridge.getStatus());
String instanceCount = String.valueOf(cartridge.getActiveInstances());
System.out.println("\tRunning Instances : " + instanceCount);
- System.out.println("\tAccess URL(s) : " + getAccessURLs(cartridge));
+ //System.out.println("\tAccess URL(s) : " + getAccessURLs(cartridge));
if (cartridge.getRepoURL() != null) {
System.out.println("\tRepo URL : " + cartridge.getRepoURL());
}
- System.out.println("\tLB Private IP : " + lbPrivateIpSet.toString());
- if (lbFloatingIpSet != null) {
- System.out.println("\tLB Floating IP : " + lbFloatingIpSet.toString());
- }
- if (cartridge.getProvider().equals("data")) {
- System.out.println("\tDB-username : " + cartridge.getDbUserName());
- System.out.println("\tDB-password : " + cartridge.getPassword());
- System.out.println("\tDB-Host IP (private) : " + cartridge.getIp());
- if (cartridge.getPublicIp() != null) {
- System.out.println("\tDB-Host IP (floating) : "
- + cartridge.getPublicIp());
- }
- }
+ //System.out.println("\tLB Private IP : " + lbPrivateIpSet.toString());
+ //if (lbFloatingIpSet != null) {
+ // System.out.println("\tLB Floating IP : " + lbFloatingIpSet.toString());
+ //}
+ //if (cartridge.getProvider().equals("data")) {
+// System.out.println("\tDB-username : " + cartridge.getDbUserName());
+// System.out.println("\tDB-password : " + cartridge.getPassword());
+// System.out.println("\tDB-Host IP (private) : " + cartridge.getIp());
+// if (cartridge.getPublicIp() != null) {
+// System.out.println("\tDB-Host IP (floating) : "
+// + cartridge.getPublicIp());
+// }
+// }
} catch (Exception e) {
String message = "Error in getting cartridge subscription";
System.out.println(message);
@@ -479,66 +482,6 @@ public class RestCommandLineService {
}
}
- private Map<String, Set<String>> getLbIpList(Cartridge cartridge, DefaultHttpClient httpClient) throws Exception {
- try {
- Map<String, Set<String>> privateFloatingLBIPMap = new HashMap<String, Set<String>>();
- Set<String> lbFloatingIpSet = new HashSet<String>();
- Set<String> lbPrivateIpSet = new HashSet<String>();
- Member[] members = getMembers(cartridge.getCartridgeType(), cartridge.getCartridgeAlias(), httpClient);
-
- Set<String> lbClusterIdSet = new HashSet<String>();
-
- for (Member member : members) {
- lbClusterIdSet.add(member.getLbClusterId());
- cartridge.setIp(member.getMemberIp());
- cartridge.setPublicIp(member.getMemberPublicIp());
- }
-
- // Invoke cluster/{clusterId}
- for (String clusterId : lbClusterIdSet) {
- HttpResponse responseCluster = restClient.doGet(httpClient, restClient.getBaseURL()
- + ENDPOINT_GET_CLUSTER_OF_TENANT + "lb");
-
- String responseCode = "" + responseCluster.getStatusLine().getStatusCode();
- String resultStringCluster = CliUtils.getHttpResponseString(responseCluster);
-
- GsonBuilder gsonBuilder = new GsonBuilder();
- Gson gson = gsonBuilder.create();
-
- if (!responseCode.equals(CliConstants.RESPONSE_OK)) {
- ExceptionMapper exception = gson.fromJson(resultStringCluster, ExceptionMapper.class);
- System.out.println(exception);
- return null;
- }
-
- ArrayList<Cluster> clusterList = getClusterListObjectFromString(resultStringCluster);
- Cluster cluster = clusterList.get(0);
- if (cluster == null) {
- System.out.println("Subscribe cartridge list is null");
- return null;
- }
-
- Member[] lbMembers = new Member[cluster.getMember().size()];
- lbMembers = cluster.getMember().toArray(lbMembers);
-
- for (Member lbMember : lbMembers) {
- lbPrivateIpSet.add(lbMember.getMemberIp());
- lbFloatingIpSet.add(lbMember.getMemberPublicIp());
- }
-
- }
- privateFloatingLBIPMap.put("private", lbPrivateIpSet);
- privateFloatingLBIPMap.put("floating", lbFloatingIpSet);
-
- return privateFloatingLBIPMap;
- } catch (Exception e) {
- String message = "Error in getting load balancer ip list";
- System.out.println(message);
- log.error(message, e);
- return null;
- }
- }
-
public void listMembersOfCluster(String cartridgeType, String alias) throws CommandException {
DefaultHttpClient httpClient = new DefaultHttpClient();
try {
@@ -559,7 +502,7 @@ public class RestCommandLineService {
return;
}
- System.out.println("\nList of members in the [cluster]: " + alias);
+ System.out.println("\nList of members in the cluster: " + alias);
for (Member member : members) {
System.out.println("\n\tServiceName : " + member.getServiceName());
System.out.println("\tClusterId : " + member.getClusterId());
@@ -656,14 +599,6 @@ public class RestCommandLineService {
return gson.fromJson(resultString, Cluster.class);
}
- private ArrayList<Cluster> getClusterListObjectFromString(String resultString) {
- GsonBuilder gsonBuilder = new GsonBuilder();
- Gson gson = gsonBuilder.create();
-
- ClusterList clusterlist = gson.fromJson(resultString, ClusterList.class);
- return clusterlist.getCluster();
- }
-
private void printLBs(String resultString) {
Cluster cluster = getClusterObjectFromString(resultString);
@@ -893,11 +828,12 @@ public class RestCommandLineService {
// This method helps to list all tenants
public void listAllTenants() throws CommandException {
try {
- TenantInfoList tenantInfoList = (TenantInfoList)restClient.listEntity(ENDPOINT_LIST_TENANTS,
- TenantInfoList.class, "tenants");
+ Type listType = new TypeToken<ArrayList<TenantInfoBean>>() {
+ }.getType();
+ List<TenantInfoBean> tenantInfoList = (List<TenantInfoBean>)restClient.listEntity(ENDPOINT_LIST_TENANTS,
+ listType, "tenants");
- if ((tenantInfoList == null) || (tenantInfoList.getTenantInfoBean() == null) ||
- (tenantInfoList.getTenantInfoBean().size() == 0)) {
+ if ((tenantInfoList == null) || (tenantInfoList.size() == 0)) {
System.out.println("No tenants found");
return;
}
@@ -909,16 +845,16 @@ public class RestCommandLineService {
data[1] = "" + tenantInfo.getTenantId();
data[2] = tenantInfo.getEmail();
data[3] = tenantInfo.isActive() ? "Active" : "De-active";
- data[4] = tenantInfo.getCreatedDate();
+ //data[4] = tenantInfo.getCreatedDate();
return data;
}
};
- TenantInfoBean[] tenantArray = new TenantInfoBean[tenantInfoList.getTenantInfoBean().size()];
- tenantArray = tenantInfoList.getTenantInfoBean().toArray(tenantArray);
+ TenantInfoBean[] tenantArray = new TenantInfoBean[tenantInfoList.size()];
+ tenantArray = tenantInfoList.toArray(tenantArray);
System.out.println("Tenants:");
- CliUtils.printTable(tenantArray, rowMapper, "Domain", "Tenant ID", "Email", "State", "Created Date");
+ CliUtils.printTable(tenantArray, rowMapper, "Domain", "Tenant ID", "Email", "State");
} catch (Exception e) {
String message = "Error in listing users";
System.out.println(message);
@@ -929,11 +865,12 @@ public class RestCommandLineService {
// This method helps to list all users
public void listAllUsers() throws CommandException {
try {
- UserInfoList userInfoList = (UserInfoList) restClient.listEntity(ENDPOINT_LIST_USERS,
- UserInfoList.class, "users");
+ Type listType = new TypeToken<ArrayList<UserInfoBean>>() {
+ }.getType();
+ List<UserInfoBean> userInfoList = (List<UserInfoBean>) restClient.listEntity(ENDPOINT_LIST_USERS,
+ listType, "users");
- if ((userInfoList == null) || (userInfoList.getUserInfoBean() == null) ||
- (userInfoList.getUserInfoBean().size() == 0)) {
+ if ((userInfoList == null) || (userInfoList.size() == 0)) {
System.out.println("No users found");
return;
}
@@ -947,8 +884,8 @@ public class RestCommandLineService {
}
};
- UserInfoBean[] usersArray = new UserInfoBean[userInfoList.getUserInfoBean().size()];
- usersArray = userInfoList.getUserInfoBean().toArray(usersArray);
+ UserInfoBean[] usersArray = new UserInfoBean[userInfoList.size()];
+ usersArray = userInfoList.toArray(usersArray);
System.out.println("Users:");
CliUtils.printTable(usersArray, rowMapper, "Username", "Role");
@@ -987,24 +924,26 @@ public class RestCommandLineService {
// This method helps to list applications
public void listApplications() throws CommandException {
try {
- ApplicationList list = (ApplicationList) restClient.listEntity(ENDPOINT_LIST_APPLICATION,
- ApplicationList.class, "applications");
+ Type listType = new TypeToken<ArrayList<ApplicationBean>>() {
+ }.getType();
+ List<ApplicationBean> list = (List<ApplicationBean>) restClient.listEntity(ENDPOINT_LIST_APPLICATION,
+ listType, "applications");
- if ((list == null) || (list.getApplications() == null) || (list.getApplications().size() == 0)) {
+ if ((list == null) || (list.size() == 0)) {
System.out.println("No applications found");
return;
}
- RowMapper<Application> rowMapper = new RowMapper<Application>() {
- public String[] getData(Application definition) {
+ RowMapper<ApplicationBean> rowMapper = new RowMapper<ApplicationBean>() {
+ public String[] getData(ApplicationBean definition) {
String[] data = new String[1];
data[0] = definition.getId();
return data;
}
};
- Application[] array = new Application[list.getApplications().size()];
- array = list.getApplications().toArray(array);
+ ApplicationBean[] array = new ApplicationBean[list.size()];
+ array = list.toArray(array);
System.out.println("Applications found:");
CliUtils.printTable(array, rowMapper, "Application ID");
@@ -1028,10 +967,12 @@ public class RestCommandLineService {
// This method lists available partitions
public void listPartitions() throws CommandException {
try {
- PartitionList list = (PartitionList) restClient.listEntity(ENDPOINT_LIST_PARTITIONS,
- PartitionList.class, "partitions");
+ Type listType = new TypeToken<ArrayList<Partition>>() {
+ }.getType();
+ List<Partition> list = (List<Partition>) restClient.listEntity(ENDPOINT_LIST_PARTITIONS,
+ listType, "partitions");
- if ((list == null) || (list.getPartition() == null) || (list.getPartition().size() == 0)) {
+ if ((list == null) || (list.size() == 0)) {
System.out.println("No partitions found");
return;
}
@@ -1047,8 +988,8 @@ public class RestCommandLineService {
}
};
- Partition[] partitions = new Partition[list.getPartition().size()];
- partitions = list.getPartition().toArray(partitions);
+ Partition[] partitions = new Partition[list.size()];
+ partitions = list.toArray(partitions);
System.out.println("Partitions found:");
CliUtils.printTable(partitions, rowMapper, "ID", "Provider", "Accessibility");
@@ -1061,10 +1002,12 @@ public class RestCommandLineService {
public void listAutoscalingPolicies() throws CommandException {
try {
- AutoscalePolicyList list = (AutoscalePolicyList) restClient.listEntity(ENDPOINT_LIST_AUTOSCALING_POLICIES,
- AutoscalePolicyList.class, "autoscaling policies");
+ Type listType = new TypeToken<ArrayList<AutoscalePolicy>>() {
+ }.getType();
+ List<AutoscalePolicy> list = (List<AutoscalePolicy>) restClient.listEntity(ENDPOINT_LIST_AUTOSCALING_POLICIES,
+ listType, "autoscaling policies");
- if ((list == null) || (list.getAutoscalePolicy() == null) || (list.getAutoscalePolicy().size() == 0)) {
+ if ((list == null) || (list == null) || (list.size() == 0)) {
System.out.println("No autoscaling policies found");
return;
}
@@ -1079,8 +1022,8 @@ public class RestCommandLineService {
}
};
- AutoscalePolicy[] array = new AutoscalePolicy[list.getAutoscalePolicy().size()];
- array = list.getAutoscalePolicy().toArray(array);
+ AutoscalePolicy[] array = new AutoscalePolicy[list.size()];
+ array = list.toArray(array);
System.out.println("Autoscaling policies found:");
CliUtils.printTable(array, rowMapper, "ID", "Accessibility");
@@ -1093,10 +1036,12 @@ public class RestCommandLineService {
public void listDeploymentPolicies() throws CommandException {
try {
- DeploymentPolicyList list = (DeploymentPolicyList) restClient.listEntity(ENDPOINT_LIST_DEPLOYMENT_POLICIES,
- DeploymentPolicyList.class, "deployment policies");
+ Type listType = new TypeToken<ArrayList<DeploymentPolicy>>() {
+ }.getType();
+ List<DeploymentPolicy> list = (List<DeploymentPolicy>) restClient.listEntity(ENDPOINT_LIST_DEPLOYMENT_POLICIES,
+ listType, "deployment policies");
- if ((list == null) || (list.getDeploymentPolicy() == null) || (list.getDeploymentPolicy().size() == 0)) {
+ if ((list == null) || (list.size() == 0)) {
System.out.println("No deployment policies found");
return;
}
@@ -1111,8 +1056,8 @@ public class RestCommandLineService {
}
};
- DeploymentPolicy[] array = new DeploymentPolicy[list.getDeploymentPolicy().size()];
- array = list.getDeploymentPolicy().toArray(array);
+ DeploymentPolicy[] array = new DeploymentPolicy[list.size()];
+ array = list.toArray(array);
System.out.println("Deployment policies found:");
CliUtils.printTable(array, rowMapper, "ID", "Accessibility");
@@ -1141,31 +1086,6 @@ public class RestCommandLineService {
}
}
- public void describePartition(String id) throws CommandException {
- try {
- PartitionList list = (PartitionList) restClient.listEntity(ENDPOINT_LIST_PARTITIONS,
- PartitionList.class, "partitions");
-
- if ((list == null) || (list.getPartition() == null) || (list.getPartition().size() == 0)) {
- System.out.println("Partition not found: " + id);
- return;
- }
-
- for (Partition partition : list.getPartition()) {
- if (partition.getId().equals(id)) {
- System.out.println("Partition: " + id);
- System.out.println(getGson().toJson(partition));
- return;
- }
- }
- System.out.println("Partition not found: " + id);
- } catch (Exception e) {
- String message = "Error in describing partition: " + id;
- System.out.println(message);
- log.error(message, e);
- }
- }
-
public void describeAutoScalingPolicy(String id) throws CommandException {
try {
AutoscalePolicy policy = (AutoscalePolicy) restClient.getEntity(ENDPOINT_GET_AUTOSCALING_POLICY, AutoscalePolicy.class, id, "autoscaling policy");
@@ -1190,8 +1110,11 @@ public class RestCommandLineService {
public void listKubernetesClusters() {
try {
- KubernetesGroupList list = (KubernetesGroupList) restClient.listEntity(ENDPOINT_LIST_KUBERNETES_CLUSTERS, KubernetesGroupList.class, "kubernetes cluster");
- if ((list != null) && (list.getKubernetesGroup() != null) && (list.getKubernetesGroup().size() > 0)) {
+ Type listType = new TypeToken<ArrayList<KubernetesHost>>() {
+ }.getType();
+ List<KubernetesGroup> list = (List<KubernetesGroup>) restClient.
+ listEntity(ENDPOINT_LIST_KUBERNETES_CLUSTERS, listType, "kubernetes cluster");
+ if ((list != null) && (list.size() > 0)) {
RowMapper<KubernetesGroup> partitionMapper = new RowMapper<KubernetesGroup>() {
public String[] getData(KubernetesGroup kubernetesGroup) {
String[] data = new String[2];
@@ -1201,8 +1124,8 @@ public class RestCommandLineService {
}
};
- KubernetesGroup[] array = new KubernetesGroup[list.getKubernetesGroup().size()];
- array = list.getKubernetesGroup().toArray(array);
+ KubernetesGroup[] array = new KubernetesGroup[list.size()];
+ array = list.toArray(array);
System.out.println("Kubernetes groups found:");
CliUtils.printTable(array, partitionMapper, "Group ID", "Description");
} else {
@@ -1249,9 +1172,11 @@ public class RestCommandLineService {
public void listKubernetesHosts(String clusterId) {
try {
- KubernetesHostList list = (KubernetesHostList) restClient.listEntity(ENDPOINT_LIST_KUBERNETES_HOSTS.replace("{kubernetesClusterId}", clusterId),
- KubernetesHostList.class, "kubernetes host");
- if ((list != null) && (list.getKubernetesHost() != null) && (list.getKubernetesHost().size() > 0)) {
+ Type listType = new TypeToken<ArrayList<KubernetesHost>>() {
+ }.getType();
+ List<KubernetesHost> list = (List<KubernetesHost>) restClient.listEntity(ENDPOINT_LIST_KUBERNETES_HOSTS.replace("{kubernetesClusterId}", clusterId),
+ listType, "kubernetes host");
+ if ((list != null) && (list.size() > 0)) {
RowMapper<KubernetesHost> partitionMapper = new RowMapper<KubernetesHost>() {
public String[] getData(KubernetesHost kubernetesHost) {
String[] data = new String[3];
@@ -1262,8 +1187,8 @@ public class RestCommandLineService {
}
};
- KubernetesHost[] array = new KubernetesHost[list.getKubernetesHost().size()];
- array = list.getKubernetesHost().toArray(array);
+ KubernetesHost[] array = new KubernetesHost[list.size()];
+ array = list.toArray(array);
System.out.println("Kubernetes hosts found:");
CliUtils.printTable(array, partitionMapper, "Host ID", "Hostname", "IP Address");
} else {
@@ -1336,16 +1261,16 @@ public class RestCommandLineService {
// This method helps to describe service group definition
public void describeServiceGroup (String groupDefinitionName) {
try {
- ServiceGroupBean bean = (ServiceGroupBean) restClient.listEntity(ENDPOINT_LIST_SERVICE_GROUP.replace("{groupDefinitionName}", groupDefinitionName),
- ServiceGroupBean.class, "serviceGroup");
+ GroupBean bean = (GroupBean) restClient.listEntity(ENDPOINT_LIST_SERVICE_GROUP.replace("{groupDefinitionName}", groupDefinitionName),
+ GroupBean.class, "serviceGroup");
- if ((bean == null) || (bean.getServiceGroupDefinition() == null)) {
+ if (bean == null) {
System.out.println("Service group not found: " + groupDefinitionName);
return;
}
System.out.println("Service Group : " + groupDefinitionName);
- System.out.println(getGson().toJson(bean.getServiceGroupDefinition()));
+ System.out.println(getGson().toJson(bean));
} catch (Exception e) {
String message = "Error in describing service group: " + groupDefinitionName;
System.out.println(message);
@@ -1366,8 +1291,11 @@ public class RestCommandLineService {
// This method helps to describe applications
public void describeApplication (String applicationID) {
try {
- ApplicationList applications = (ApplicationList) restClient.listEntity(ENDPOINT_GET_APPLICATION.replace("{appId}", applicationID),
- ApplicationList.class, "applications");
+ Type listType = new TypeToken<ArrayList<ApplicationBean>>() {
+ }.getType();
+ List<ApplicationBean> applications = (List<ApplicationBean>) restClient
+ .listEntity(ENDPOINT_GET_APPLICATION.replace("{appId}", applicationID),
+ listType, "applications");
if (applications == null) {
System.out.println("Application not found: " + applicationID);
@@ -1383,166 +1311,13 @@ public class RestCommandLineService {
}
}
- // This class convert JSON string to deploymentpolicylist object
- private class DeploymentPolicyList {
- private ArrayList<DeploymentPolicy> deploymentPolicy;
-
- public ArrayList<DeploymentPolicy> getDeploymentPolicy() {
- return deploymentPolicy;
- }
-
- public void setDeploymentPolicy(ArrayList<DeploymentPolicy> deploymentPolicy) {
- this.deploymentPolicy = deploymentPolicy;
- }
-
- DeploymentPolicyList() {
- deploymentPolicy = new ArrayList<DeploymentPolicy>();
- }
- }
-
- // This class convert JSON string to autoscalepolicylist object
- private class AutoscalePolicyList {
- private ArrayList<AutoscalePolicy> autoscalePolicy;
-
- public ArrayList<AutoscalePolicy> getAutoscalePolicy() {
- return autoscalePolicy;
- }
-
- public void setAutoscalePolicy(ArrayList<AutoscalePolicy> autoscalePolicy) {
- this.autoscalePolicy = autoscalePolicy;
- }
-
- AutoscalePolicyList() {
- autoscalePolicy = new ArrayList<AutoscalePolicy>();
- }
- }
-
- private class ApplicationList {
- private ArrayList<Application> applications;
-
- public ArrayList<Application> getApplications() {
- return applications;
- }
-
- public void setApplications(ArrayList<Application> applications) {
- this.applications = applications;
- }
-
- ApplicationList() {
- applications = new ArrayList<Application>();
- }
- }
-
- // This class convert JSON string to servicedefinitionbean object
- private class ServiceDefinitionList {
- private ArrayList<ServiceDefinitionBean> serviceDefinitionBean;
-
- public ArrayList<ServiceDefinitionBean> getServiceDefinition() {
- return serviceDefinitionBean;
- }
-
- public void setServiceDefinition(ArrayList<ServiceDefinitionBean> serviceDefinitionBean) {
- this.serviceDefinitionBean = serviceDefinitionBean;
- }
-
- ServiceDefinitionList() {
- serviceDefinitionBean = new ArrayList<ServiceDefinitionBean>();
- }
- }
-
- // This class convert JSON string to PartitionLIst object
- private class PartitionList {
- private ArrayList<Partition> partition;
-
- public ArrayList<Partition> getPartition() {
- return partition;
- }
-
- public void setPartition(ArrayList<Partition> partition) {
- this.partition = partition;
- }
-
- PartitionList() {
- partition = new ArrayList<Partition>();
- }
- }
-
- // This class convert JSON string to TenantInfoBean object
- private class TenantInfoList {
- private ArrayList<TenantInfoBean> tenantInfoBean;
-
- public ArrayList<TenantInfoBean> getTenantInfoBean() {
- return tenantInfoBean;
- }
-
- public void setTenantInfoBean(ArrayList<TenantInfoBean> tenantInfoBean) {
- this.tenantInfoBean = tenantInfoBean;
- }
-
- TenantInfoList() {
- tenantInfoBean = new ArrayList<TenantInfoBean>();
- }
- }
-
- // This class convert JSON string to UserInfoBean object
- private class UserInfoList {
- private ArrayList<UserInfoBean> userInfoBean;
-
- public ArrayList<UserInfoBean> getUserInfoBean() {
- return userInfoBean;
- }
-
- public void setUserInfoBean(ArrayList<UserInfoBean> userInfoBean) {
- this.userInfoBean = userInfoBean;
- }
-
- UserInfoList() {
- userInfoBean = new ArrayList<UserInfoBean>();
- }
- }
-
- // This class is for convert JSON string to CartridgeList object
- private class CartridgeList {
- private ArrayList<Cartridge> cartridge;
-
- public ArrayList<Cartridge> getCartridge() {
- return cartridge;
- }
-
- public void setCartridge(ArrayList<Cartridge> cartridge) {
- this.cartridge = cartridge;
- }
-
- CartridgeList() {
- cartridge = new ArrayList<Cartridge>();
- }
- }
-
- private class ClusterList {
- private ArrayList<Cluster> cluster;
-
- public ArrayList<Cluster> getCluster() {
- return cluster;
- }
-
- public void setCluster(ArrayList<Cluster> clusters) {
- this.cluster = clusters;
- }
-
- ClusterList() {
- cluster = new ArrayList<Cluster>();
- }
-
- ;
- }
-
// This will return access url from a given cartridge
- private String getAccessURLs(Cartridge cartridge) {
- PortMapping[] portMappings = cartridge.getPortMappings();
+ private String getAccessURLs(CartridgeDefinitionBean cartridge) {
+ List<PortMappingBean> portMappings = cartridge.getPortMapping();
StringBuilder urlBuilder = new StringBuilder();
- for (PortMapping portMapping : portMappings) {
- String url = portMapping.getProtocol() + "://" + cartridge.getHostName() + ":" + portMapping.getProxyPort() + "/";
+ for (PortMappingBean portMapping : portMappings) {
+ String url = portMapping.getProtocol() + "://" + cartridge.getHost() + ":" + portMapping.getProxyPort() + "/";
urlBuilder.append(url).append(", ");
}
@@ -1601,17 +1376,18 @@ public class RestCommandLineService {
return false;
}
- CartridgeList cartridgeList = gson.fromJson(resultString, CartridgeList.class);
+ Type listType = new TypeToken<ArrayList<CartridgeDefinitionBean>>() {}.getType();
+ List<CartridgeDefinitionBean> cartridgeList = gson.fromJson(resultString, listType);
if (cartridgeList == null) {
System.out.println("Available cartridge list is null");
return false;
}
- ArrayList<Cartridge> multiTenetCartridge = new ArrayList<Cartridge>();
+ ArrayList<CartridgeDefinitionBean> multiTenetCartridge = new ArrayList<CartridgeDefinitionBean>();
- for (Cartridge cartridge : cartridgeList.getCartridge()) {
- if (cartridge.isMultiTenant() && cartridge.getCartridgeType().equals(type)) {
+ for (CartridgeDefinitionBean cartridge : cartridgeList) {
+ if (cartridge.isMultiTenant() && cartridge.getType().equals(type)) {
multiTenetCartridge.add(cartridge);
}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/StratosApplication.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/StratosApplication.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/StratosApplication.java
index 1fa306f..57eb35d 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/StratosApplication.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/StratosApplication.java
@@ -129,27 +129,15 @@ public class StratosApplication extends CommandLineApplication<StratosCommandCon
command = new DeployAutoscalingPolicyCommand();
commands.put(command.getName(), command);
- /*command = new DeployServiceCommand();
- commands.put(command.getName(), command);
-
- command = new UndeployServiceDefinitionCommand();
- commands.put(command.getName(), command);*/
-
command = new ListApplicationsCommand();
commands.put(command.getName(), command);
- /*command = new ListServicesCommand();
- commands.put(command.getName(), command);*/
-
command = new UndeployCartridgeDefinitionCommand();
commands.put(command.getName(), command);
command = new DeployDeploymentPolicyCommand();
commands.put(command.getName(), command);
- //command = new ListPartitionCommand();
- //commands.put(command.getName(), command);
-
command = new ListAutoscalePolicyCommand();
commands.put(command.getName(), command);
@@ -162,9 +150,6 @@ public class StratosApplication extends CommandLineApplication<StratosCommandCon
command = new DescribeCartridgeCommand();
commands.put(command.getName(), command);
- command = new DescribePartitionCommand();
- commands.put(command.getName(), command);
-
command = new DescribeDeploymentPolicyCommand();
commands.put(command.getName(), command);
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/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
deleted file mode 100644
index d8c200e..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/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.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/stratos/blob/df2d6e6c/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
deleted file mode 100644
index 175b2cf..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/TenantInfoBean.java
+++ /dev/null
@@ -1,105 +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.beans;
-
-import java.util.Calendar;
-
-public class TenantInfoBean {
- private String admin;
- private String firstname;
- private String lastname;
- private String adminPassword;
- private String tenantDomain;
- private String email;
- private String createdDate;
- private boolean active;
- private int tenantId;
-
- 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 getCreatedDate() {
- return createdDate;
- }
-
- public void setCreatedDate(String createdDate) {
- this.createdDate = createdDate;
- }
-
- public boolean isActive() {
- return active;
- }
-
- public void setActive(boolean active) {
- this.active = active;
- }
-
- public int getTenantId() {
- return tenantId;
- }
-
- public void setTenantId(int tenantId) {
- this.tenantId = tenantId;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/UserInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/UserInfoBean.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/UserInfoBean.java
deleted file mode 100644
index 9f36223..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/UserInfoBean.java
+++ /dev/null
@@ -1,88 +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.beans;
-
-public class UserInfoBean {
-
- private String userName;
- private String credential;
- private String role;
- private String firstName;
- private String lastName;
- private String email;
- private String profileName;
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getCredential() {
- return credential;
- }
-
- public void setCredential(String credential) {
- this.credential = credential;
- }
-
- public String getRole() {
- return role;
- }
-
- public void setRole(String role) {
- this.role = role;
- }
-
- 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 getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public String getProfileName() {
- return profileName;
- }
-
- public void setProfileName(String profileName) {
- this.profileName = profileName;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/partition/NetworkPartition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/partition/NetworkPartition.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/partition/NetworkPartition.java
deleted file mode 100644
index c1fecb5..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/partition/NetworkPartition.java
+++ /dev/null
@@ -1,54 +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.beans.autoscaler.partition;
-
-import java.util.List;
-
-public class NetworkPartition {
- private String id;
-
- private String partitionAlgo;
-
- //partition Ids
- private List<Partition> partition;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getPartitionAlgo() {
- return partitionAlgo;
- }
-
- public void setPartitionAlgo(String partitionAlgo) {
- this.partitionAlgo = partitionAlgo;
- }
-
- public List<Partition> getPartition() {
- return partition;
- }
-
- public void setPartition(List<Partition> partition) {
- this.partition = partition;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/partition/Partition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/partition/Partition.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/partition/Partition.java
deleted file mode 100644
index e04f073..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/partition/Partition.java
+++ /dev/null
@@ -1,96 +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.beans.autoscaler.partition;
-
-import java.util.List;
-
-public class Partition {
-
- private String id;
-
- private String description;
-
- private boolean isPublic;
-
- 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;
- }
-
- public boolean getIsPublic() {
- return isPublic;
- }
-
- public void setIsPublic(boolean isPublic) {
- this.isPublic = isPublic;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-}
-
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/partition/PropertyBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/partition/PropertyBean.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/partition/PropertyBean.java
deleted file mode 100644
index 7e88296..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/partition/PropertyBean.java
+++ /dev/null
@@ -1,48 +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.beans.autoscaler.partition;
-
-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;
- }
-
- @Override
- public String toString() {
- return "Property [name=" + name + ", value=" + value + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/AutoscalePolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/AutoscalePolicy.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/AutoscalePolicy.java
deleted file mode 100644
index 254e996..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/AutoscalePolicy.java
+++ /dev/null
@@ -1,82 +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.beans.autoscaler.policy.autoscale;
-
-public class AutoscalePolicy {
-
- private String id;
-
- private String displayName;
-
- private String description;
-
- private boolean isPublic;
-
- private LoadThresholds loadThresholds;
-
- private float instanceRoundingFactor;
-
- 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;
- }
-
- public LoadThresholds getLoadThresholds() {
- return loadThresholds;
- }
-
- public void setLoadThresholds(LoadThresholds loadThresholds) {
- this.loadThresholds = loadThresholds;
- }
-
- public boolean getIsPublic() {
- return isPublic;
- }
-
- public void setIsPublic(boolean isPublic) {
- this.isPublic = isPublic;
- }
-
- public float getInstanceRoundingFactor() {
- return instanceRoundingFactor;
- }
-
- public void setInstanceRoundingFactor(float instanceRoundingFactor) {
- this.instanceRoundingFactor = instanceRoundingFactor;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/LoadAverage.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/LoadAverage.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/LoadAverage.java
deleted file mode 100644
index 80a8810..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/LoadAverage.java
+++ /dev/null
@@ -1,32 +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.beans.autoscaler.policy.autoscale;
-
-public class LoadAverage {
-
- public float average;
-
- public float secondDerivative;
-
- public float gradient;
-
- public float scaleDownMarginOfGradient;
-
- public float scaleDownMarginOfSecondDerivative;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/LoadThresholds.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/LoadThresholds.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/LoadThresholds.java
deleted file mode 100644
index ba6bedd..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/LoadThresholds.java
+++ /dev/null
@@ -1,28 +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.beans.autoscaler.policy.autoscale;
-
-public class LoadThresholds {
-
- public RequestsInFlight requestsInFlight;
-
- public MemoryConsumption memoryConsumption;
-
- public LoadAverage loadAverage;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/MemoryConsumption.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/MemoryConsumption.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/MemoryConsumption.java
deleted file mode 100644
index 43acbe4..0000000
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/autoscaler/policy/autoscale/MemoryConsumption.java
+++ /dev/null
@@ -1,33 +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.beans.autoscaler.policy.autoscale;
-
-public class MemoryConsumption {
-
- public float average;
-
- public float secondDerivative;
-
- public float gradient;
-
- public float scaleDownMarginOfGradient;
-
- public float scaleDownMarginOfSecondDerivative;
-}
[4/7] stratos git commit: Moving rest api domain model to stratos
common component to be reused by the cli
Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/PortRange.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/PortRange.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/PortRange.java
new file mode 100644
index 0000000..68cbd96
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/PortRange.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.common.beans.kubernetes;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class PortRange {
+ private int upper;
+ private int lower;
+
+ public int getUpper() {
+ return upper;
+ }
+
+ public void setUpper(int upper) {
+ this.upper = upper;
+ }
+
+ public int getLower() {
+ return lower;
+ }
+
+ public void setLower(int lower) {
+ this.lower = lower;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/Properties.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/Properties.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/Properties.java
new file mode 100644
index 0000000..dbacc17
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/Properties.java
@@ -0,0 +1,50 @@
+/*
+ * 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.common.beans.kubernetes;
+
+import java.io.Serializable;
+import java.util.Arrays;
+
+/**
+ * Had to wrap {@link Property} array using a class, since there's a bug in current
+ * stub generation.
+ */
+public class Properties implements Serializable{
+
+ private static final long serialVersionUID = 1986895299288322592L;
+ private Property[] properties;
+
+ public Property[] getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Property[] properties) {
+ if(properties == null) {
+ this.properties = new Property[0];
+ } else {
+ this.properties = Arrays.copyOf(properties, properties.length);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "Properties [properties=" + Arrays.toString(properties) + "]";
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/Property.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/Property.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/Property.java
new file mode 100644
index 0000000..14ea390
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/kubernetes/Property.java
@@ -0,0 +1,62 @@
+/*
+ * 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.common.beans.kubernetes;
+
+import java.io.Serializable;
+
+/**
+ * Holds a property
+ */
+public class Property implements Serializable{
+
+ private static final long serialVersionUID = -2191782657999410197L;
+ private String name;
+ private String value;
+
+ public Property(){
+
+ }
+
+ public Property(String name, String value){
+ this.setName(name);
+ this.setValue(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;
+ }
+
+ @Override
+ public String toString() {
+ return "Property [name=" + name + ", value=" + value + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/repositoryNotificationInfoBean/Payload.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/repositoryNotificationInfoBean/Payload.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/repositoryNotificationInfoBean/Payload.java
new file mode 100644
index 0000000..bc9475b
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/repositoryNotificationInfoBean/Payload.java
@@ -0,0 +1,34 @@
+/**
+ * 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.common.beans.repositoryNotificationInfoBean;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "payload")
+public class Payload {
+ private Repository repository;
+
+ public Repository getRepository() {
+ return repository;
+ }
+
+ public void setRepository(Repository repository) {
+ this.repository = repository;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/repositoryNotificationInfoBean/Repository.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/repositoryNotificationInfoBean/Repository.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/repositoryNotificationInfoBean/Repository.java
new file mode 100644
index 0000000..2d9b822
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/repositoryNotificationInfoBean/Repository.java
@@ -0,0 +1,43 @@
+/**
+ * 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.common.beans.repositoryNotificationInfoBean;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "repository")
+public class Repository {
+ private String url;
+ private String description;
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/subscription/domain/SubscriptionDomainBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/subscription/domain/SubscriptionDomainBean.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/subscription/domain/SubscriptionDomainBean.java
new file mode 100644
index 0000000..ee16cc2
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/subscription/domain/SubscriptionDomainBean.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.common.beans.subscription.domain;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "domains")
+public class SubscriptionDomainBean {
+ private String domainName;
+ private String applicationContext;
+
+ public String getDomainName() {
+ return domainName;
+ }
+
+ public void setDomainName(String domainName) {
+ this.domainName = domainName;
+ }
+
+ public String getApplicationContext() {
+ return applicationContext;
+ }
+
+ public void setApplicationContext(String applicationContext) {
+ this.applicationContext = applicationContext;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/topology/Cluster.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/topology/Cluster.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/topology/Cluster.java
new file mode 100644
index 0000000..0af5718
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/topology/Cluster.java
@@ -0,0 +1,126 @@
+/**
+ * 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.common.beans.topology;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import org.apache.stratos.common.beans.cartridge.definition.PropertyBean;
+
+import java.util.List;
+
+@XmlRootElement(name="clusters")
+public class Cluster {
+
+ private String alias;
+
+ private String serviceName;
+
+ private String clusterId;
+
+ private List<Member> member;
+
+ private String tenantRange;
+
+ private List<String> hostNames;
+
+ private boolean isLbCluster;
+
+ private List<PropertyBean> property;
+
+ private List<Instance> instances;
+
+ public List<Instance> getInstances() {
+ return instances;
+ }
+
+ public void setInstances(List<Instance> instances) {
+ this.instances = instances;
+ }
+
+ @Override
+ public String toString() {
+ return "Cluster [serviceName=" + getServiceName() + ", clusterId=" + getClusterId() + ", member=" + getMember()
+ + ", tenantRange=" + getTenantRange() + ", hostNames=" + getHostNames() + ", isLbCluster=" + isLbCluster()
+ + ", property=" + getProperty() + "]";
+ }
+
+
+ public String getAlias() {
+ return alias;
+ }
+
+ public void setAlias(String alias) {
+ this.alias = alias;
+ }
+
+ 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 List<Member> getMember() {
+ return member;
+ }
+
+ public void setMember(List<Member> member) {
+ this.member = member;
+ }
+
+ public String getTenantRange() {
+ return tenantRange;
+ }
+
+ public void setTenantRange(String tenantRange) {
+ this.tenantRange = tenantRange;
+ }
+
+ public List<String> getHostNames() {
+ return hostNames;
+ }
+
+ public void setHostNames(List<String> hostNames) {
+ this.hostNames = hostNames;
+ }
+
+ public boolean isLbCluster() {
+ return isLbCluster;
+ }
+
+ public void setLbCluster(boolean isLbCluster) {
+ this.isLbCluster = isLbCluster;
+ }
+
+ public List<PropertyBean> getProperty() {
+ return property;
+ }
+
+ public void setProperty(List<PropertyBean> property) {
+ this.property = property;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/topology/Instance.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/topology/Instance.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/topology/Instance.java
new file mode 100644
index 0000000..59e311c
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/topology/Instance.java
@@ -0,0 +1,45 @@
+/*
+ * 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.common.beans.topology;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Instance {
+
+ private String status;
+
+ private String instanceId;
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getInstanceId() {
+ return instanceId;
+ }
+
+ public void setInstanceId(String instanceId) {
+ this.instanceId = instanceId;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/topology/Member.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/topology/Member.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/topology/Member.java
new file mode 100644
index 0000000..0bba360
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/beans/topology/Member.java
@@ -0,0 +1,127 @@
+/**
+ * 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.common.beans.topology;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.apache.stratos.common.beans.cartridge.definition.PropertyBean;
+
+@XmlRootElement
+public class Member {
+ private String serviceName;
+ private String clusterId;
+ private String networkPartitionId;
+ private String partitionId;
+ private String memberId;
+
+ private String status;
+ private String memberIp;
+ private String lbClusterId;
+ private String memberPublicIp;
+ private List<PropertyBean> property;
+
+ @Override
+ public String toString() {
+ return "Member [serviceName=" + getServiceName() + ", clusterId=" + getClusterId() + ", networkPartitionId="
+ + getNetworkPartitionId() + ", partitionId=" + getPartitionId() + ", memberId=" + getMemberId() + ", status=" + getStatus()
+ + ", memberIp=" + getMemberIp() + ", lbClusterId=" + getLbClusterId() + ", memberPublicIp=" + getMemberPublicIp()
+ + ", property=" + getProperty() + "]";
+ }
+
+
+ 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 getNetworkPartitionId() {
+ return networkPartitionId;
+ }
+
+ public void setNetworkPartitionId(String networkPartitionId) {
+ this.networkPartitionId = networkPartitionId;
+ }
+
+ public String getPartitionId() {
+ return partitionId;
+ }
+
+ public void setPartitionId(String partitionId) {
+ this.partitionId = partitionId;
+ }
+
+ public String getMemberId() {
+ return memberId;
+ }
+
+ public void setMemberId(String memberId) {
+ this.memberId = memberId;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getMemberIp() {
+ return memberIp;
+ }
+
+ public void setMemberIp(String memberIp) {
+ this.memberIp = memberIp;
+ }
+
+ public String getLbClusterId() {
+ return lbClusterId;
+ }
+
+ public void setLbClusterId(String lbClusterId) {
+ this.lbClusterId = lbClusterId;
+ }
+
+ public String getMemberPublicIp() {
+ return memberPublicIp;
+ }
+
+ public void setMemberPublicIp(String memberPublicIp) {
+ this.memberPublicIp = memberPublicIp;
+ }
+
+ public List<PropertyBean> getProperty() {
+ return property;
+ }
+
+ public void setProperty(List<PropertyBean> property) {
+ this.property = property;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/StratosUserManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/StratosUserManager.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/StratosUserManager.java
index 57588ab..3178141 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/StratosUserManager.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/StratosUserManager.java
@@ -22,7 +22,7 @@ package org.apache.stratos.manager.user.mgt;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.manager.user.mgt.beans.UserInfoBean;
+import org.apache.stratos.common.beans.UserInfoBean;
import org.apache.stratos.manager.user.mgt.exception.UserManagerException;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.api.UserStoreManager;
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/beans/UserInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/beans/UserInfoBean.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/beans/UserInfoBean.java
deleted file mode 100644
index 5cf0b44..0000000
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/beans/UserInfoBean.java
+++ /dev/null
@@ -1,103 +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.manager.user.mgt.beans;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class UserInfoBean {
-
- private String userName;
- private String credential;
- private String role;
- private String firstName;
- private String lastName;
- private String email;
- private String profileName;
-
- public UserInfoBean(){}
-
- public UserInfoBean(UserInfoBean userInfoBean) {
- this.userName = userInfoBean.getUserName();
- this.credential = userInfoBean.getCredential();
- this.role = userInfoBean.getRole();
- this.firstName = userInfoBean.getFirstName();
- this.lastName = userInfoBean.getLastName();
- this.email = userInfoBean.getEmail();
- this.profileName = userInfoBean.getProfileName();
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getCredential() {
- return credential;
- }
-
- public void setCredential(String credential) {
- this.credential = credential;
- }
-
- public String getRole() {
- return role;
- }
-
- public void setRole(String role) {
- this.role = role;
- }
-
- 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 getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public String getProfileName() {
- return profileName;
- }
-
- public void setProfileName(String profileName) {
- this.profileName = profileName;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/definition/PropertyBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/definition/PropertyBean.java b/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/definition/PropertyBean.java
index 0ecc8d9..1ff9586 100644
--- a/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/definition/PropertyBean.java
+++ b/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/definition/PropertyBean.java
@@ -24,14 +24,38 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "properties")
public class PropertyBean {
- public String hostname;
+ private String hostname;
- public String username;
- public String password;
+ private String username;
+ private String password;
+
+ public String getHostname() {
+ return hostname;
+ }
+
+ public void setHostname(String hostname) {
+ this.hostname = hostname;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
@Override
public String toString() {
- return " [ hostname: " + hostname + ", username: " + username + ", password: " + password +
- "] ";
+ return " [hostname: " + getHostname() + ", username: " + getUsername() + ", password: " + getPassword() +
+ "]";
}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV40.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV40.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV40.java
index 674fa28..5032698 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV40.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV40.java
@@ -31,18 +31,18 @@ import org.apache.stratos.rest.endpoint.ServiceHolder;
import org.apache.stratos.rest.endpoint.Utils;
import org.apache.stratos.rest.endpoint.annotation.AuthorizationAction;
import org.apache.stratos.rest.endpoint.annotation.SuperTenantService;
-import org.apache.stratos.rest.endpoint.bean.CartridgeInfoBean;
-import org.apache.stratos.rest.endpoint.bean.StratosApiResponse;
-import org.apache.stratos.rest.endpoint.bean.SubscriptionDomainRequest;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.ApplicationLevelNetworkPartition;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.Partition;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.AutoscalePolicy;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.CartridgeDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.ServiceDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.repositoryNotificationInfoBean.Payload;
-import org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean;
-import org.apache.stratos.rest.endpoint.bean.topology.Cluster;
+import org.apache.stratos.common.beans.CartridgeInfoBean;
+import org.apache.stratos.common.beans.StratosApiResponse;
+import org.apache.stratos.common.beans.SubscriptionDomainRequest;
+import org.apache.stratos.common.beans.autoscaler.partition.ApplicationLevelNetworkPartition;
+import org.apache.stratos.common.beans.autoscaler.partition.Partition;
+import org.apache.stratos.common.beans.autoscaler.policy.autoscale.AutoscalePolicy;
+import org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy;
+import org.apache.stratos.common.beans.cartridge.definition.CartridgeDefinitionBean;
+import org.apache.stratos.common.beans.cartridge.definition.ServiceDefinitionBean;
+import org.apache.stratos.common.beans.repositoryNotificationInfoBean.Payload;
+import org.apache.stratos.common.beans.subscription.domain.SubscriptionDomainBean;
+import org.apache.stratos.common.beans.topology.Cluster;
import org.apache.stratos.rest.endpoint.exception.RestAPIException;
import org.apache.stratos.tenant.mgt.core.TenantPersistor;
import org.apache.stratos.tenant.mgt.util.TenantMgtUtil;
@@ -437,7 +437,7 @@ public class StratosApiV40 extends AbstractApi {
}
}
for (Cluster clusterObj : clusters) {
- if (clusterObj.clusterId.equals(clusterId)){
+ if (clusterObj.getClusterId().equals(clusterId)){
cluster = clusterObj;
break;
}
@@ -1075,7 +1075,7 @@ public class StratosApiV40 extends AbstractApi {
public Response getSubscriptionDomain(@PathParam("cartridgeType") String cartridgeType,
@PathParam("subscriptionAlias") String subscriptionAlias, @PathParam("domainName") String domainName) throws RestAPIException {
SubscriptionDomainBean subscriptionDomainBean = StratosApiV40Utils.getSubscriptionDomain(getConfigContext(), cartridgeType, subscriptionAlias, domainName);
- if(subscriptionDomainBean.domainName == null){
+ if(subscriptionDomainBean.getDomainName() == null){
return Response.status(Response.Status.NOT_FOUND).build();
}else{
return Response.ok().entity(subscriptionDomainBean).build();
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV40Utils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV40Utils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV40Utils.java
index c8655a9..1ab2c33 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV40Utils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV40Utils.java
@@ -47,16 +47,16 @@ import org.apache.stratos.messaging.domain.topology.Cluster;
import org.apache.stratos.messaging.domain.topology.Member;
import org.apache.stratos.messaging.domain.topology.MemberStatus;
import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
-import org.apache.stratos.rest.endpoint.bean.StratosApiResponse;
-import org.apache.stratos.rest.endpoint.bean.SubscriptionDomainRequest;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.ApplicationLevelNetworkPartition;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.Partition;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.AutoscalePolicy;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.CartridgeDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.ServiceDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.repositoryNotificationInfoBean.Payload;
-import org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean;
-import org.apache.stratos.rest.endpoint.bean.util.converter.PojoConverter;
+import org.apache.stratos.common.beans.StratosApiResponse;
+import org.apache.stratos.common.beans.SubscriptionDomainRequest;
+import org.apache.stratos.common.beans.autoscaler.partition.ApplicationLevelNetworkPartition;
+import org.apache.stratos.common.beans.autoscaler.partition.Partition;
+import org.apache.stratos.common.beans.autoscaler.policy.autoscale.AutoscalePolicy;
+import org.apache.stratos.common.beans.cartridge.definition.CartridgeDefinitionBean;
+import org.apache.stratos.common.beans.cartridge.definition.ServiceDefinitionBean;
+import org.apache.stratos.common.beans.repositoryNotificationInfoBean.Payload;
+import org.apache.stratos.common.beans.subscription.domain.SubscriptionDomainBean;
+import org.apache.stratos.rest.endpoint.util.converter.PojoConverter;
import org.apache.stratos.rest.endpoint.exception.RestAPIException;
import javax.ws.rs.core.Response;
@@ -191,7 +191,7 @@ public class StratosApiV40Utils {
}
StratosApiResponse stratosApiResponse = new StratosApiResponse();
- stratosApiResponse.setMessage("Successfully deployed partition definition with id " + partitionBean.id);
+ stratosApiResponse.setMessage("Successfully deployed partition definition with id " + partitionBean.getId());
return stratosApiResponse;
}
@@ -226,7 +226,7 @@ public class StratosApiV40Utils {
}
public static StratosApiResponse deployDeploymentPolicy(
- org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy deploymentPolicyBean)
+ org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy deploymentPolicyBean)
throws RestAPIException {
String policyId = null;
@@ -394,7 +394,7 @@ public class StratosApiV40Utils {
return PojoConverter.populateAutoscalePojo(autoscalePolicy);
}
- public static org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy[]
+ public static org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy[]
getDeploymentPolicies () throws RestAPIException {
DeploymentPolicy [] deploymentPolicies = null;
@@ -414,7 +414,7 @@ public class StratosApiV40Utils {
return PojoConverter.populateDeploymentPolicyPojos(deploymentPolicies);
}
- public static org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy[]
+ public static org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy[]
getDeploymentPolicies (String cartridgeType) throws RestAPIException {
DeploymentPolicy [] deploymentPolicies = null;
@@ -440,7 +440,7 @@ public class StratosApiV40Utils {
return PojoConverter.populateDeploymentPolicyPojos(deploymentPolicies);
}
- public static org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy
+ public static org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy
getDeploymentPolicy(String deploymentPolicyId) throws RestAPIException {
DeploymentPolicy deploymentPolicy = null;
@@ -969,7 +969,7 @@ public class StratosApiV40Utils {
return cartridgeSubsciptionManager.getCartridgeSubscription(ApplicationManagementUtil.getTenantId(configurationContext), alias);
}
- public static org.apache.stratos.rest.endpoint.bean.topology.Cluster getCluster (String cartridgeType, String subscriptionAlias, ConfigurationContext configurationContext) throws RestAPIException {
+ public static org.apache.stratos.common.beans.topology.Cluster getCluster (String cartridgeType, String subscriptionAlias, ConfigurationContext configurationContext) throws RestAPIException {
Cluster cluster = TopologyClusterInformationModel.getInstance().getCluster(ApplicationManagementUtil.getTenantId(configurationContext),
subscriptionAlias);
@@ -980,49 +980,49 @@ public class StratosApiV40Utils {
}
}
- public static org.apache.stratos.rest.endpoint.bean.topology.Cluster[] getClustersForTenant (ConfigurationContext configurationContext) {
+ public static org.apache.stratos.common.beans.topology.Cluster[] getClustersForTenant (ConfigurationContext configurationContext) {
Set<Cluster> clusterSet = TopologyClusterInformationModel.getInstance().getClusters(ApplicationManagementUtil.
getTenantId(configurationContext), null);
- ArrayList<org.apache.stratos.rest.endpoint.bean.topology.Cluster> clusters =
- new ArrayList<org.apache.stratos.rest.endpoint.bean.topology.Cluster>();
+ ArrayList<org.apache.stratos.common.beans.topology.Cluster> clusters =
+ new ArrayList<org.apache.stratos.common.beans.topology.Cluster>();
for(Cluster cluster : clusterSet) {
clusters.add(PojoConverter.populateClusterPojos(cluster, null));
}
- org.apache.stratos.rest.endpoint.bean.topology.Cluster[] arrCluster =
- new org.apache.stratos.rest.endpoint.bean.topology.Cluster[clusters.size()];
+ org.apache.stratos.common.beans.topology.Cluster[] arrCluster =
+ new org.apache.stratos.common.beans.topology.Cluster[clusters.size()];
arrCluster = clusters.toArray(arrCluster);
return arrCluster;
}
- public static org.apache.stratos.rest.endpoint.bean.topology.Cluster[] getClustersForTenantAndCartridgeType (ConfigurationContext configurationContext,
+ public static org.apache.stratos.common.beans.topology.Cluster[] getClustersForTenantAndCartridgeType (ConfigurationContext configurationContext,
String cartridgeType) {
Set<Cluster> clusterSet = TopologyClusterInformationModel.getInstance().getClusters(ApplicationManagementUtil.
getTenantId(configurationContext), cartridgeType);
- List<org.apache.stratos.rest.endpoint.bean.topology.Cluster> clusters =
- new ArrayList<org.apache.stratos.rest.endpoint.bean.topology.Cluster>();
+ List<org.apache.stratos.common.beans.topology.Cluster> clusters =
+ new ArrayList<org.apache.stratos.common.beans.topology.Cluster>();
for(Cluster cluster : clusterSet) {
clusters.add(PojoConverter.populateClusterPojos(cluster, null));
}
- org.apache.stratos.rest.endpoint.bean.topology.Cluster[] arrCluster =
- new org.apache.stratos.rest.endpoint.bean.topology.Cluster[clusters.size()];
+ org.apache.stratos.common.beans.topology.Cluster[] arrCluster =
+ new org.apache.stratos.common.beans.topology.Cluster[clusters.size()];
arrCluster = clusters.toArray(arrCluster);
return arrCluster;
}
- public static org.apache.stratos.rest.endpoint.bean.topology.Cluster[] getClustersForCartridgeType(String cartridgeType) {
+ public static org.apache.stratos.common.beans.topology.Cluster[] getClustersForCartridgeType(String cartridgeType) {
Set<Cluster> clusterSet = TopologyClusterInformationModel
.getInstance()
.getClusters(cartridgeType);
- List<org.apache.stratos.rest.endpoint.bean.topology.Cluster> clusters = new ArrayList<org.apache.stratos.rest.endpoint.bean.topology.Cluster>();
+ List<org.apache.stratos.common.beans.topology.Cluster> clusters = new ArrayList<org.apache.stratos.common.beans.topology.Cluster>();
for (Cluster cluster : clusterSet) {
clusters.add(PojoConverter.populateClusterPojos(cluster, null));
}
- org.apache.stratos.rest.endpoint.bean.topology.Cluster[] arrCluster = new org.apache.stratos.rest.endpoint.bean.topology.Cluster[clusters
+ org.apache.stratos.common.beans.topology.Cluster[] arrCluster = new org.apache.stratos.common.beans.topology.Cluster[clusters
.size()];
arrCluster = clusters.toArray(arrCluster);
return arrCluster;
@@ -1166,17 +1166,17 @@ public class StratosApiV40Utils {
try {
int tenantId = ApplicationManagementUtil.getTenantId(configurationContext);
- for (org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean subscriptionDomain : request.domains) {
- boolean isDomainExists = isSubscriptionDomainExists(configurationContext, cartridgeType, subscriptionAlias, subscriptionDomain.domainName);
+ for (org.apache.stratos.common.beans.subscription.domain.SubscriptionDomainBean subscriptionDomain : request.getDomains()) {
+ boolean isDomainExists = isSubscriptionDomainExists(configurationContext, cartridgeType, subscriptionAlias, subscriptionDomain.getDomainName());
if (isDomainExists) {
- String message = "Subscription domain " + subscriptionDomain.domainName + " exists";
+ String message = "Subscription domain " + subscriptionDomain.getDomainName() + " exists";
throw new RestAPIException(Status.INTERNAL_SERVER_ERROR, message);
}
}
- for (org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean subscriptionDomain : request.domains) {
+ for (org.apache.stratos.common.beans.subscription.domain.SubscriptionDomainBean subscriptionDomain : request.getDomains()) {
cartridgeSubsciptionManager.addSubscriptionDomain(tenantId, subscriptionAlias,
- subscriptionDomain.domainName, subscriptionDomain.applicationContext);
+ subscriptionDomain.getDomainName(), subscriptionDomain.getApplicationContext());
}
} catch (Exception e) {
log.error(e.getMessage(), e);
@@ -1195,7 +1195,7 @@ public class StratosApiV40Utils {
SubscriptionDomainBean subscriptionDomain = PojoConverter.populateSubscriptionDomainPojo(cartridgeSubsciptionManager.getSubscriptionDomain(tenantId,
subscriptionAlias, domain));
- if (subscriptionDomain.domainName != null) {
+ if (subscriptionDomain.getDomainName() != null) {
return true;
} else {
return false;
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index b23901d..3972211 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@ -30,20 +30,20 @@ import org.apache.stratos.manager.grouping.definitions.ServiceGroupDefinition;
import org.apache.stratos.manager.subscription.ApplicationSubscription;
import org.apache.stratos.manager.subscription.CartridgeSubscription;
import org.apache.stratos.manager.user.mgt.StratosUserManager;
-import org.apache.stratos.manager.user.mgt.beans.UserInfoBean;
+import org.apache.stratos.common.beans.UserInfoBean;
import org.apache.stratos.manager.user.mgt.exception.UserManagerException;
import org.apache.stratos.rest.endpoint.annotation.AuthorizationAction;
import org.apache.stratos.rest.endpoint.annotation.SuperTenantService;
-import org.apache.stratos.rest.endpoint.bean.ApplicationBean;
-import org.apache.stratos.rest.endpoint.bean.StratosApiResponse;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.AutoscalePolicy;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.CartridgeDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.kubernetes.KubernetesGroup;
-import org.apache.stratos.rest.endpoint.bean.kubernetes.KubernetesHost;
-import org.apache.stratos.rest.endpoint.bean.kubernetes.KubernetesMaster;
-import org.apache.stratos.rest.endpoint.bean.repositoryNotificationInfoBean.Payload;
-import org.apache.stratos.rest.endpoint.bean.topology.Cluster;
+import org.apache.stratos.common.beans.ApplicationBean;
+import org.apache.stratos.common.beans.StratosApiResponse;
+import org.apache.stratos.common.beans.autoscaler.policy.autoscale.AutoscalePolicy;
+import org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy;
+import org.apache.stratos.common.beans.cartridge.definition.CartridgeDefinitionBean;
+import org.apache.stratos.common.beans.kubernetes.KubernetesGroup;
+import org.apache.stratos.common.beans.kubernetes.KubernetesHost;
+import org.apache.stratos.common.beans.kubernetes.KubernetesMaster;
+import org.apache.stratos.common.beans.repositoryNotificationInfoBean.Payload;
+import org.apache.stratos.common.beans.topology.Cluster;
import org.apache.stratos.rest.endpoint.exception.RestAPIException;
import org.apache.stratos.rest.endpoint.exception.TenantNotFoundException;
import org.apache.stratos.rest.endpoint.ServiceHolder;
@@ -675,7 +675,7 @@ public class StratosApiV41 extends AbstractApi {
}
}
for (Cluster clusterObj : clusters) {
- if (clusterObj.clusterId.equals(clusterId)) {
+ if (clusterObj.getClusterId().equals(clusterId)) {
cluster = clusterObj;
break;
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
index e1fc650..a213d90 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
@@ -56,19 +56,19 @@ import org.apache.stratos.messaging.domain.topology.Cluster;
import org.apache.stratos.messaging.domain.topology.Member;
import org.apache.stratos.messaging.message.receiver.applications.ApplicationManager;
import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
-import org.apache.stratos.rest.endpoint.bean.ApplicationBean;
-import org.apache.stratos.rest.endpoint.bean.GroupBean;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.ApplicationLevelNetworkPartition;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.AutoscalePolicy;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.CartridgeDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PersistenceBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PropertyBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.VolumeBean;
-import org.apache.stratos.rest.endpoint.bean.kubernetes.KubernetesGroup;
-import org.apache.stratos.rest.endpoint.bean.kubernetes.KubernetesHost;
-import org.apache.stratos.rest.endpoint.bean.kubernetes.KubernetesMaster;
-import org.apache.stratos.rest.endpoint.bean.repositoryNotificationInfoBean.Payload;
-import org.apache.stratos.rest.endpoint.bean.util.converter.PojoConverter;
+import org.apache.stratos.common.beans.ApplicationBean;
+import org.apache.stratos.common.beans.GroupBean;
+import org.apache.stratos.common.beans.autoscaler.partition.ApplicationLevelNetworkPartition;
+import org.apache.stratos.common.beans.autoscaler.policy.autoscale.AutoscalePolicy;
+import org.apache.stratos.common.beans.cartridge.definition.CartridgeDefinitionBean;
+import org.apache.stratos.common.beans.cartridge.definition.PersistenceBean;
+import org.apache.stratos.common.beans.cartridge.definition.PropertyBean;
+import org.apache.stratos.common.beans.cartridge.definition.VolumeBean;
+import org.apache.stratos.common.beans.kubernetes.KubernetesGroup;
+import org.apache.stratos.common.beans.kubernetes.KubernetesHost;
+import org.apache.stratos.common.beans.kubernetes.KubernetesMaster;
+import org.apache.stratos.common.beans.repositoryNotificationInfoBean.Payload;
+import org.apache.stratos.rest.endpoint.util.converter.PojoConverter;
import org.apache.stratos.rest.endpoint.exception.RestAPIException;
import java.rmi.RemoteException;
@@ -613,7 +613,7 @@ public class StratosApiV41Utils {
// Util methods for Deployment policies
- public static org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy[]
+ public static org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy[]
getDeploymentPolicies() throws RestAPIException {
DeploymentPolicy[] deploymentPolicies = null;
@@ -632,7 +632,7 @@ public class StratosApiV41Utils {
return PojoConverter.populateDeploymentPolicyPojos(deploymentPolicies);
}
- public static org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy
+ public static org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy
getDeploymentPolicy(String deploymentPolicyId) throws RestAPIException {
DeploymentPolicy deploymentPolicy = null;
@@ -827,34 +827,34 @@ public class StratosApiV41Utils {
// Util methods for clusters
- public static org.apache.stratos.rest.endpoint.bean.topology.Cluster[] getClustersForTenant(ConfigurationContext configurationContext) {
+ public static org.apache.stratos.common.beans.topology.Cluster[] getClustersForTenant(ConfigurationContext configurationContext) {
Set<Cluster> clusterSet = TopologyClusterInformationModel.getInstance().getClusters(ApplicationManagementUtil.
getTenantId(configurationContext), null);
- ArrayList<org.apache.stratos.rest.endpoint.bean.topology.Cluster> clusters =
- new ArrayList<org.apache.stratos.rest.endpoint.bean.topology.Cluster>();
+ ArrayList<org.apache.stratos.common.beans.topology.Cluster> clusters =
+ new ArrayList<org.apache.stratos.common.beans.topology.Cluster>();
for (Cluster cluster : clusterSet) {
clusters.add(PojoConverter.populateClusterPojos(cluster, null));
}
- org.apache.stratos.rest.endpoint.bean.topology.Cluster[] arrCluster =
- new org.apache.stratos.rest.endpoint.bean.topology.Cluster[clusters.size()];
+ org.apache.stratos.common.beans.topology.Cluster[] arrCluster =
+ new org.apache.stratos.common.beans.topology.Cluster[clusters.size()];
arrCluster = clusters.toArray(arrCluster);
return arrCluster;
}
- public static org.apache.stratos.rest.endpoint.bean.topology.Cluster[] getClustersForTenantAndCartridgeType(ConfigurationContext configurationContext,
+ public static org.apache.stratos.common.beans.topology.Cluster[] getClustersForTenantAndCartridgeType(ConfigurationContext configurationContext,
String cartridgeType) {
Set<Cluster> clusterSet = TopologyClusterInformationModel.getInstance().getClusters(ApplicationManagementUtil.
getTenantId(configurationContext), cartridgeType);
- List<org.apache.stratos.rest.endpoint.bean.topology.Cluster> clusters =
- new ArrayList<org.apache.stratos.rest.endpoint.bean.topology.Cluster>();
+ List<org.apache.stratos.common.beans.topology.Cluster> clusters =
+ new ArrayList<org.apache.stratos.common.beans.topology.Cluster>();
for (Cluster cluster : clusterSet) {
clusters.add(PojoConverter.populateClusterPojos(cluster, null));
}
- org.apache.stratos.rest.endpoint.bean.topology.Cluster[] arrCluster =
- new org.apache.stratos.rest.endpoint.bean.topology.Cluster[clusters.size()];
+ org.apache.stratos.common.beans.topology.Cluster[] arrCluster =
+ new org.apache.stratos.common.beans.topology.Cluster[clusters.size()];
arrCluster = clusters.toArray(arrCluster);
return arrCluster;
@@ -995,12 +995,12 @@ public class StratosApiV41Utils {
* @throws RestAPIException
*/
public static void deployApplication(
- org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy deploymentPolicyBean)
+ org.apache.stratos.common.beans.autoscaler.policy.deployment.DeploymentPolicy deploymentPolicyBean)
throws RestAPIException {
if (log.isInfoEnabled()) {
log.info(String.format("Starting to deploy application: [application-id] %s [deployment-policy-id] %s",
- deploymentPolicyBean.applicationPolicy.applicationId, deploymentPolicyBean.id));
+ deploymentPolicyBean.getApplicationPolicy().getApplicationId(), deploymentPolicyBean.getId()));
}
AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient();
@@ -1114,7 +1114,7 @@ public class StratosApiV41Utils {
String serviceType = clusterDataHolder.getServiceType();
TopologyManager.acquireReadLockForCluster(serviceType, clusterId);
Cluster topLevelCluster = TopologyManager.getTopology().getService(serviceType).getCluster(clusterId);
- applicationBean.clusters.add(PojoConverter.populateClusterPojos(topLevelCluster, entry.getKey()));
+ applicationBean.getClusters().add(PojoConverter.populateClusterPojos(topLevelCluster, entry.getKey()));
}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/ApplicationBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/ApplicationBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/ApplicationBean.java
deleted file mode 100644
index 15cb726..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/ApplicationBean.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.apache.stratos.rest.endpoint.bean;
-
-import org.apache.stratos.rest.endpoint.bean.topology.Cluster;
-import org.apache.stratos.rest.endpoint.bean.topology.Instance;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement(name="applications")
-public class ApplicationBean {
- private String id;
- private String tenantDomain;
- private String tenantAdminUsername;
- public List<GroupBean> groups = null;
- public List<Cluster> clusters = null;
- private List<Instance> instances;
-
-
- public ApplicationBean(){
- this.groups = new ArrayList<GroupBean>();
- this.clusters = new ArrayList<Cluster>();
- }
- public void addGroup(GroupBean groupBean) {
- this.groups.add(groupBean);
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public void setTenantDomain(String tenantDomain) {
- this.tenantDomain = tenantDomain;
- }
-
- public void setTenantAdminUsername(String tenantAdminUsername) {
- this.tenantAdminUsername = tenantAdminUsername;
- }
-
- public String getId() {
- return id;
- }
-
- public String getTenantDomain() {
- return tenantDomain;
- }
-
- public String getTenantAdminUsername() {
- return tenantAdminUsername;
- }
- public List<Instance> getInstances() {
- return instances;
- }
- public void setInstances(List<Instance> instances) {
- this.instances = instances;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/CartridgeInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/CartridgeInfoBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/CartridgeInfoBean.java
deleted file mode 100644
index 6d67fe1..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/CartridgeInfoBean.java
+++ /dev/null
@@ -1,167 +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.rest.endpoint.bean;
-
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PersistenceBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PropertyBean;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement
-public class CartridgeInfoBean {
- String cartridgeType;
- String alias;
- String autoscalePolicy;
- String deploymentPolicy;
- String repoURL;
- boolean privateRepo;
- String repoUsername;
- String repoPassword;
- String dataCartridgeType;
- String dataCartridgeAlias;
- boolean commitsEnabled;
-
- private String serviceGroup;
-
- private PersistenceBean persistence;
-
- private List<PropertyBean> property;
-
- private List<String> domains;
-
- public CartridgeInfoBean() {
- this.domains = new ArrayList<String>();
- }
-
- 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 getAutoscalePolicy() {
- return autoscalePolicy;
- }
-
- public void setAutoscalePolicy(String autoscalePolicy) {
- this.autoscalePolicy = autoscalePolicy;
- }
-
- 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 getDeploymentPolicy() {
- return deploymentPolicy;
- }
-
- public void setDeploymentPolicy(String deploymentPolicy) {
- this.deploymentPolicy = deploymentPolicy;
- }
-
- public boolean isCommitsEnabled() {
- return commitsEnabled;
- }
-
- public void setCommitsEnabled(boolean commitsEnabled) {
- this.commitsEnabled = commitsEnabled;
- }
-
- public String getServiceGroup() {
- return serviceGroup;
- }
-
- public void setServiceGroup(String serviceGroup) {
- this.serviceGroup = serviceGroup;
- }
-
- public PersistenceBean getPersistence() {
- return persistence;
- }
-
- public void setPersistence(PersistenceBean persistence) {
- this.persistence = persistence;
- }
-
- public List<PropertyBean> getProperty() {
- return property;
- }
-
- public void setProperty(List<PropertyBean> property) {
- this.property = property;
- }
- public List<String> getDomains() { return domains; }
-
- public void setDomains(List<String> domains) { this.domains = domains; }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/Error.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/Error.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/Error.java
deleted file mode 100644
index 2bb4823..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/Error.java
+++ /dev/null
@@ -1,45 +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.rest.endpoint.bean;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "error")
-public class Error {
- private int errorCode;
- private String errorMessage;
-
- public int getErrorCode() {
- return errorCode;
- }
-
- public void setErrorCode(int errorCode) {
- this.errorCode = errorCode;
- }
-
- public String getErrorMessage() {
- return errorMessage;
- }
-
- public void setErrorMessage(String errorMessage) {
- this.errorMessage = errorMessage;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/GroupBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/GroupBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/GroupBean.java
deleted file mode 100644
index e5f35e9..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/GroupBean.java
+++ /dev/null
@@ -1,99 +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.rest.endpoint.bean;
-
-import org.apache.stratos.rest.endpoint.bean.topology.Cluster;
-import org.apache.stratos.rest.endpoint.bean.topology.Instance;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement(name="groups")
-public class GroupBean {
- private List<GroupBean> subGroups = null;
- private List<Cluster> clusters = null;
- private String alias;
- private String deploymentPolicy;
- private String autoScalingPolicy;
- private List<Instance> instances;
-
- public GroupBean(){
- this.setClusters(new ArrayList<Cluster>());
- this.setSubGroups(new ArrayList<GroupBean>());
- }
-
- public void addGroup(GroupBean groupBean){
- getSubGroups().add(groupBean);
- }
- public void addCluster(Cluster cluster){
- getClusters().add(cluster);
- }
-
- public List<GroupBean> getSubGroups() {
- return subGroups;
- }
-
- public void setSubGroups(List<GroupBean> subGroups) {
- this.subGroups = subGroups;
- }
-
- public List<Cluster> getClusters() {
- return clusters;
- }
-
- public void setClusters(List<Cluster> clusters) {
- this.clusters = clusters;
- }
-
- public void setAlias(String alias) {
- this.alias = alias;
- }
-
- public void setDeploymentPolicy(String deploymentPolicy) {
- this.deploymentPolicy = deploymentPolicy;
- }
-
- public void setAutoScalingPolicy(String autoScalingPolicy) {
- this.autoScalingPolicy = autoScalingPolicy;
- }
-
- public String getAlias() {
- return alias;
- }
-
- public String getDeploymentPolicy() {
- return deploymentPolicy;
- }
-
- public String getAutoScalingPolicy() {
- return autoScalingPolicy;
- }
-
- public List<Instance> getInstances() {
- return instances;
- }
-
- public void setInstances(List<Instance> instances) {
- this.instances = instances;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/StratosApiResponse.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/StratosApiResponse.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/StratosApiResponse.java
deleted file mode 100644
index 6496b6a..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/StratosApiResponse.java
+++ /dev/null
@@ -1,36 +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.rest.endpoint.bean;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class StratosApiResponse {
-
- private String message;
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/SubscriptionDomainRequest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/SubscriptionDomainRequest.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/SubscriptionDomainRequest.java
deleted file mode 100644
index 6e0d6ae..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/SubscriptionDomainRequest.java
+++ /dev/null
@@ -1,35 +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.rest.endpoint.bean;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean;
-
-/**
- * Defines subscription domain post request.
- */
-@XmlRootElement
-public class SubscriptionDomainRequest {
- public List<SubscriptionDomainBean> domains;
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/ApplicationLevelNetworkPartition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/ApplicationLevelNetworkPartition.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/ApplicationLevelNetworkPartition.java
deleted file mode 100644
index 819eec6..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/ApplicationLevelNetworkPartition.java
+++ /dev/null
@@ -1,34 +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.rest.endpoint.bean.autoscaler.partition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class ApplicationLevelNetworkPartition {
-
- public String id;
-
- public boolean activeByDefault;
-
- //partition Ids
- public List<Partition> partitions;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/ChildLevelNetworkPartition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/ChildLevelNetworkPartition.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/ChildLevelNetworkPartition.java
deleted file mode 100644
index 40d3400..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/ChildLevelNetworkPartition.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.rest.endpoint.bean.autoscaler.partition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class ChildLevelNetworkPartition {
- public String id;
-
- public String partitionAlgo;
-
- public List<ChildLevelPartition> partitions;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/ChildLevelPartition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/ChildLevelPartition.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/ChildLevelPartition.java
deleted file mode 100644
index 9afd69b..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/ChildLevelPartition.java
+++ /dev/null
@@ -1,28 +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.rest.endpoint.bean.autoscaler.partition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class ChildLevelPartition {
- public String id;
-
- public int max;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/Partition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/Partition.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/Partition.java
deleted file mode 100644
index 98c5141..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/partition/Partition.java
+++ /dev/null
@@ -1,39 +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.rest.endpoint.bean.autoscaler.partition;
-
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PropertyBean;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class Partition {
-
- public String id;
-
- public String description;
-
- public boolean isPublic;
-
- public String provider;
-
- public List<PropertyBean> property;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/AutoscalePolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/AutoscalePolicy.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/AutoscalePolicy.java
deleted file mode 100644
index b273aee..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/AutoscalePolicy.java
+++ /dev/null
@@ -1,87 +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.rest.endpoint.bean.autoscaler.policy.autoscale;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class AutoscalePolicy {
-
- private String id;
-
- private String displayName;
-
- private String description;
-
- private LoadThresholds loadThresholds;
-
- private boolean isPublic;
-
- private float instanceRoundingFactor;
-
- 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;
- }
-
- public boolean getIsPublic() {
- return isPublic;
- }
-
- public void setIsPublic(boolean isPublic) {
- this.isPublic = isPublic;
- }
-
-
- public LoadThresholds getLoadThresholds() {
- return loadThresholds;
- }
-
- public void setLoadThresholds(LoadThresholds loadThresholds) {
- this.loadThresholds = loadThresholds;
- }
-
- public float getInstanceRoundingFactor() {
- return instanceRoundingFactor;
- }
-
- public void setInstanceRoundingFactor(float instanceRoundingFactor) {
- this.instanceRoundingFactor = instanceRoundingFactor;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/LoadAverageThresholds.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/LoadAverageThresholds.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/LoadAverageThresholds.java
deleted file mode 100644
index ebda721..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/LoadAverageThresholds.java
+++ /dev/null
@@ -1,30 +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.rest.endpoint.bean.autoscaler.policy.autoscale;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class LoadAverageThresholds {
-
- public float threshold;
-
- public float lowerLimit;
-}
[3/7] stratos git commit: Moving rest api domain model to stratos
common component to be reused by the cli
Posted by im...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/LoadThresholds.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/LoadThresholds.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/LoadThresholds.java
deleted file mode 100644
index 30de3bd..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/LoadThresholds.java
+++ /dev/null
@@ -1,30 +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.rest.endpoint.bean.autoscaler.policy.autoscale;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class LoadThresholds {
-
- public RequestsInFlightThresholds requestsInFlight;
- public MemoryConsumptionThresholds memoryConsumption;
- public LoadAverageThresholds loadAverage;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/MemoryConsumptionThresholds.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/MemoryConsumptionThresholds.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/MemoryConsumptionThresholds.java
deleted file mode 100644
index cffacc0..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/MemoryConsumptionThresholds.java
+++ /dev/null
@@ -1,30 +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.rest.endpoint.bean.autoscaler.policy.autoscale;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class MemoryConsumptionThresholds {
-
- public float threshold;
-
- public float lowerLimit;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/RequestsInFlightThresholds.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/RequestsInFlightThresholds.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/RequestsInFlightThresholds.java
deleted file mode 100644
index 0df4d07..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/autoscale/RequestsInFlightThresholds.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.rest.endpoint.bean.autoscaler.policy.autoscale;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class RequestsInFlightThresholds {
-
- public float threshold;
-
- public float lowerLimit;
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/deployment/ApplicationPolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/deployment/ApplicationPolicy.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/deployment/ApplicationPolicy.java
deleted file mode 100644
index ac33546..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/deployment/ApplicationPolicy.java
+++ /dev/null
@@ -1,34 +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.rest.endpoint.bean.autoscaler.policy.deployment;
-
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.ApplicationLevelNetworkPartition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class ApplicationPolicy {
- //partition groups
- public String applicationId;
-
- public List<ApplicationLevelNetworkPartition> networkPartition;
-
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/deployment/ChildPolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/deployment/ChildPolicy.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/deployment/ChildPolicy.java
deleted file mode 100644
index a010318..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/deployment/ChildPolicy.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.rest.endpoint.bean.autoscaler.policy.deployment;
-
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.ChildLevelNetworkPartition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class ChildPolicy {
- public String childId;
-
- public List<ChildLevelNetworkPartition> networkPartition;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/deployment/DeploymentPolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/deployment/DeploymentPolicy.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/deployment/DeploymentPolicy.java
deleted file mode 100644
index 758e279..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/autoscaler/policy/deployment/DeploymentPolicy.java
+++ /dev/null
@@ -1,41 +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.rest.endpoint.bean.autoscaler.policy.deployment;
-
-
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.ApplicationLevelNetworkPartition;
-import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.Partition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class DeploymentPolicy {
-
- public String id;
-
- public String description;
-
- public boolean isPublic;
-
- public ApplicationPolicy applicationPolicy;
-
- public List<ChildPolicy> childPolicies;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/CartridgeDefinitionBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/CartridgeDefinitionBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/CartridgeDefinitionBean.java
deleted file mode 100644
index ad8f055..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/CartridgeDefinitionBean.java
+++ /dev/null
@@ -1,280 +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.rest.endpoint.bean.cartridge.definition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import java.util.List;
-
-@XmlRootElement(name = "cartridgeDefinitionBean")
-public class CartridgeDefinitionBean {
-
- private String type;
-
- private String host;
-
- private String provider;
-
- //Four types - Application,Framework,Data,LB
- private String category;
-
- private String displayName;
-
- private String description;
-
- private String version;
-
- private boolean multiTenant;
-
- private boolean isPublic;
-
- private DeploymentBean deployment;
-
- private List<PortMappingBean> portMapping;
-
- private PersistenceBean persistence;
-
- private List<IaasProviderBean> iaasProvider;
-
- private List<PropertyBean> property;
-
- private String defaultAutoscalingPolicy;
-
- private String defaultDeploymentPolicy;
-
- private String serviceGroup;
-
- private ContainerBean container;
-
- private String deployerType;
-
- private String[] exportingProperties;
-
- public String toString () {
-
- return "Type: " + getType() + ", Provider: " + getProvider() + ", Category: " + getCategory() + ", Host: " + getHost() + ", Display Name: " + getDisplayName() +
- ", Description: " + getDescription() + ", Version: " + getVersion() + ", Multitenant " + isMultiTenant() +", Public " + isPublic() + "\n" +
- getDeploymentDetails() + "\n PortMapping: " + getPortMappings() + "\n IaaS: " + getIaasProviders() +
- "\n Properties: " + getProperties() +"\n VolumeBean mappings "+ getPersistence().toString()
- + "\n Exports " + getExportingProperties().toString();
- }
-
- private String getDeploymentDetails () {
-
- if(getDeployment() != null) {
- return getDeployment().toString();
- }
- return null;
- }
-
- private String getPortMappings () {
-
- StringBuilder portMappingBuilder = new StringBuilder();
- if(getPortMapping() != null && !getPortMapping().isEmpty()) {
- for(PortMappingBean portMappingBean : getPortMapping()) {
- portMappingBuilder.append(portMappingBean.toString());
- }
- }
- return portMappingBuilder.toString();
- }
-
- private String getIaasProviders () {
-
- StringBuilder iaasBuilder = new StringBuilder();
- if(getIaasProvider() != null && !getIaasProvider().isEmpty()) {
- for(IaasProviderBean iaasProviderBean : getIaasProvider()) {
- iaasBuilder.append(iaasProviderBean.toString());
- }
- }
- return iaasBuilder.toString();
- }
-
- private String getProperties () {
-
- StringBuilder propertyBuilder = new StringBuilder();
- if(getProperty() != null) {
- for(PropertyBean propertyBean : getProperty()) {
- propertyBuilder.append(propertyBean.name + " : " + propertyBean.value + " | ");
- }
- }
- return propertyBuilder.toString();
- }
-
- public String[] getExportingProperties() {
- return exportingProperties;
- }
-
- public void setExportingProperties(String[] exportingProperties) {
- this.exportingProperties = exportingProperties;
- }
-
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getHost() {
- return host;
- }
-
- public void setHost(String host) {
- this.host = host;
- }
-
- public String getProvider() {
- return provider;
- }
-
- public void setProvider(String provider) {
- this.provider = provider;
- }
-
- public String getCategory() {
- return category;
- }
-
- public void setCategory(String category) {
- this.category = category;
- }
-
- 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 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 boolean isPublic() {
- return isPublic;
- }
-
- public void setPublic(boolean isPublic) {
- this.isPublic = isPublic;
- }
-
- public DeploymentBean getDeployment() {
- return deployment;
- }
-
- public void setDeployment(DeploymentBean deployment) {
- this.deployment = deployment;
- }
-
- public List<PortMappingBean> getPortMapping() {
- return portMapping;
- }
-
- public void setPortMapping(List<PortMappingBean> portMapping) {
- this.portMapping = portMapping;
- }
-
- public PersistenceBean getPersistence() {
- return persistence;
- }
-
- public void setPersistence(PersistenceBean persistence) {
- this.persistence = persistence;
- }
-
- public List<IaasProviderBean> getIaasProvider() {
- return iaasProvider;
- }
-
- public void setIaasProvider(List<IaasProviderBean> iaasProvider) {
- this.iaasProvider = iaasProvider;
- }
-
- public List<PropertyBean> getProperty() {
- return property;
- }
-
- public void setProperty(List<PropertyBean> property) {
- this.property = property;
- }
-
- public String getDefaultAutoscalingPolicy() {
- return defaultAutoscalingPolicy;
- }
-
- public void setDefaultAutoscalingPolicy(String defaultAutoscalingPolicy) {
- this.defaultAutoscalingPolicy = defaultAutoscalingPolicy;
- }
-
- public String getDefaultDeploymentPolicy() {
- return defaultDeploymentPolicy;
- }
-
- public void setDefaultDeploymentPolicy(String defaultDeploymentPolicy) {
- this.defaultDeploymentPolicy = defaultDeploymentPolicy;
- }
-
- public String getServiceGroup() {
- return serviceGroup;
- }
-
- public void setServiceGroup(String serviceGroup) {
- this.serviceGroup = serviceGroup;
- }
-
- public ContainerBean getContainer() {
- return container;
- }
-
- public void setContainer(ContainerBean container) {
- this.container = container;
- }
-
- public String getDeployerType() {
- return deployerType;
- }
-
- public void setDeployerType(String deployerType) {
- this.deployerType = deployerType;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/ContainerBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/ContainerBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/ContainerBean.java
deleted file mode 100644
index 8e15b5c..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/ContainerBean.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.apache.stratos.rest.endpoint.bean.cartridge.definition;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-
-@XmlRootElement(name = "container")
-public class ContainerBean {
-
- public String imageName;
- public String dockerfileRepo;
- public List<PropertyBean> property;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/DeploymentBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/DeploymentBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/DeploymentBean.java
deleted file mode 100644
index 97d0d2e..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/DeploymentBean.java
+++ /dev/null
@@ -1,46 +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.rest.endpoint.bean.cartridge.definition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement(name = "deployment")
-public class DeploymentBean {
-
- public String baseDir;
-
- public List<String> dir;
-
- public String toString () {
- return " Base Directory: " + baseDir + " Directories: " + getDirectories();
- }
-
- private String getDirectories () {
-
- StringBuilder directoryBuilder = new StringBuilder();
- if(dir != null) {
- for(String directory : dir) {
- directoryBuilder.append(directory + " | ");
- }
- }
- return directoryBuilder.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/FloatingNetworkBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/FloatingNetworkBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/FloatingNetworkBean.java
deleted file mode 100644
index e6df7e1..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/FloatingNetworkBean.java
+++ /dev/null
@@ -1,51 +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.rest.endpoint.bean.cartridge.definition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * @author rajkumar
- */
-@XmlRootElement (name = "floatingNetworks")
-public class FloatingNetworkBean {
- public String name;
- public String networkUuid;
- public String floatingIP;
-
- public String toString () {
- StringBuilder sb = new StringBuilder('{');
- String delimeter = "";
- if (name != null) {
- sb.append(delimeter).append("name : ").append(name);
- delimeter = ", ";
- }
- if (networkUuid != null) {
- sb.append(delimeter).append("networkUuid : ").append(networkUuid);
- delimeter = ", ";
- }
- if (floatingIP != null) {
- sb.append(delimeter).append("floatingIP : ").append(floatingIP);
- delimeter = ", ";
- }
- sb.append('}');
- return sb.toString();
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/IaasProviderBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/IaasProviderBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/IaasProviderBean.java
deleted file mode 100644
index da2d615..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/IaasProviderBean.java
+++ /dev/null
@@ -1,79 +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.rest.endpoint.bean.cartridge.definition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement (name = "iaasProvider")
-public class IaasProviderBean {
-
- public String type;
-
- public String name;
-
- public String className;
-
- public String imageId;
-
- public int maxInstanceLimit;
-
- public String provider;
-
- public String identity;
-
- public String credential;
-
- public List<PropertyBean> property;
-
- public List<NetworkInterfaceBean> networkInterfaces;
-
- public String toString () {
- return " [ Type: " + type + ", Name: " + name + ", Class Name: " + className + ", Image Id: " + imageId +
- ", Max Instance Limit: " + maxInstanceLimit + ", Provider: " + provider + ", Identity: " + identity +
- ", Credentials: " + credential + ", Properties: " + getIaasProperties() + ", Network Interfaces: " +
- getNetworkInterfaces() + " ] ";
- }
-
- private String getIaasProperties () {
-
- StringBuilder iaasPropertyBuilder = new StringBuilder();
- if(property != null) {
- for (PropertyBean propertyBean : property) {
- iaasPropertyBuilder.append(propertyBean.name + " : " + propertyBean.value + " | ");
- }
- }
- return iaasPropertyBuilder.toString();
- }
-
- private String getNetworkInterfaces() {
- StringBuilder sb = new StringBuilder();
- if (networkInterfaces != null) {
- sb.append('[');
- String delimeter = "";
- for (NetworkInterfaceBean nib:networkInterfaces) {
- sb.append(delimeter).append(nib);
- delimeter = ", ";
- }
- sb.append(']');
- }
- return sb.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/LoadBalancerBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/LoadBalancerBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/LoadBalancerBean.java
deleted file mode 100644
index 8fbddcc..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/LoadBalancerBean.java
+++ /dev/null
@@ -1,48 +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.rest.endpoint.bean.cartridge.definition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement(name = "loadBalancer")
-public class LoadBalancerBean {
-
- public String type;
-
- public String deploymentPolicy;
-
- public String autoscalingPolicy;
-
- public List<PropertyBean> property;
-
- public String toString () {
-
- StringBuilder lbBuilder = new StringBuilder();
- lbBuilder.append(" Type: " + type);
- if(property != null && !property.isEmpty()) {
- lbBuilder.append(" Properties: ");
- for(PropertyBean propertyBean : property) {
- lbBuilder.append(propertyBean.name + " : " + propertyBean.value + " | ");
- }
- }
- return lbBuilder.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/NetworkInterfaceBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/NetworkInterfaceBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/NetworkInterfaceBean.java
deleted file mode 100644
index 707e7fe..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/NetworkInterfaceBean.java
+++ /dev/null
@@ -1,68 +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.rest.endpoint.bean.cartridge.definition;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement (name = "networkInterfaces")
-public class NetworkInterfaceBean {
- public String networkUuid;
- public String fixedIp;
- public String portUuid;
- public List<FloatingNetworkBean> floatingNetworks;
- public String toString () {
- StringBuilder sb = new StringBuilder('{');
- String delimeter = "";
- if (networkUuid != null) {
- sb.append(delimeter).append("networkUuid : ").append(networkUuid);
- delimeter = ", ";
- }
- if (fixedIp != null) {
- sb.append(delimeter).append("fixedIp : ").append(fixedIp);
- delimeter = ", ";
- }
- if (portUuid != null) {
- sb.append(delimeter).append("portUuid : ").append(portUuid);
- delimeter = ", ";
- }
- if (floatingNetworks != null) {
- sb.append(delimeter).append("floatingNetworks : ").append(getFloatingNetworks());
- delimeter = ", ";
- }
- sb.append('}');
- return sb.toString();
- }
-
- private String getFloatingNetworks() {
- StringBuilder sb = new StringBuilder();
- if (floatingNetworks != null) {
- sb.append('[');
- String delimeter = "";
- for (FloatingNetworkBean floatingNetworkBean:floatingNetworks) {
- sb.append(delimeter).append(floatingNetworkBean);
- delimeter = ", ";
- }
- sb.append(']');
- }
- return sb.toString();
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/PersistenceBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/PersistenceBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/PersistenceBean.java
deleted file mode 100644
index 96229a5..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/PersistenceBean.java
+++ /dev/null
@@ -1,62 +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.rest.endpoint.bean.cartridge.definition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class PersistenceBean {
-
- private boolean isRequired;
-
- private List<VolumeBean> volume;
-
- public String toString () {
- return " [ Persistence Required : " + isRequired() + "\n" +
- "volume: " + getVolumes() + "] ";
- }
-
- private String getVolumes() {
- StringBuilder volumeBuilder = new StringBuilder();
- if(getVolume() != null && !getVolume().isEmpty()) {
- for(VolumeBean volumeBean : getVolume()) {
- volumeBuilder.append(volumeBean.toString());
- }
- }
- return volumeBuilder.toString();
- }
-
- public boolean isRequired() {
- return isRequired;
- }
-
- public void setRequired(boolean isRequired) {
- this.isRequired = isRequired;
- }
-
- public List<VolumeBean> getVolume() {
- return volume;
- }
-
- public void setVolume(List<VolumeBean> volume) {
- this.volume = volume;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/PortMappingBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/PortMappingBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/PortMappingBean.java
deleted file mode 100644
index bd11f5e..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/PortMappingBean.java
+++ /dev/null
@@ -1,36 +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.rest.endpoint.bean.cartridge.definition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "portMapping")
-public class PortMappingBean {
-
- public String protocol;
-
- public int port;
-
- public int proxyPort;
-
- public String toString () {
- return " [ Protocol: " + protocol + ", Port: " + port + ", Proxy port: " + proxyPort + "] ";
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/PropertyBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/PropertyBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/PropertyBean.java
deleted file mode 100644
index 8bdd7e2..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/PropertyBean.java
+++ /dev/null
@@ -1,30 +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.rest.endpoint.bean.cartridge.definition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "property")
-public class PropertyBean {
-
- public String name;
-
- public String value;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/ServiceDefinitionBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/ServiceDefinitionBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/ServiceDefinitionBean.java
deleted file mode 100644
index d31e75d..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/ServiceDefinitionBean.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.rest.endpoint.bean.cartridge.definition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "serviceDefinitionBean")
-public class ServiceDefinitionBean {
-
- private String serviceName;
- private String cartridgeType;
- private String deploymentPolicyName;
- private String autoscalingPolicyName;
- private String clusterDomain;
- private String clusterSubDomain;
- private String tenantRange;
- private boolean isPublic;
-
- public String getServiceName() {
- return serviceName;
- }
- public void setServiceName(String serviceName) {
- this.serviceName = serviceName;
- }
- public String getCartridgeType() {
- return cartridgeType;
- }
- public void setCartridgeType(String cartridgeType) {
- this.cartridgeType = cartridgeType;
- }
- public String getDeploymentPolicyName() {
- return deploymentPolicyName;
- }
- public void setDeploymentPolicyName(String deploymentPolicyName) {
- this.deploymentPolicyName = deploymentPolicyName;
- }
- public String getAutoscalingPolicyName() {
- return autoscalingPolicyName;
- }
- public void setAutoscalingPolicyName(String autoscalingPolicyName) {
- this.autoscalingPolicyName = autoscalingPolicyName;
- }
- public String getClusterDomain() {
- return clusterDomain;
- }
- public void setClusterDomain(String clusterDomain) {
- this.clusterDomain = clusterDomain;
- }
- public String getClusterSubDomain() {
- return clusterSubDomain;
- }
- public void setClusterSubDomain(String clusterSubDomain) {
- this.clusterSubDomain = clusterSubDomain;
- }
- public String getTenantRange() {
- return tenantRange;
- }
- public void setTenantRange(String tenantRange) {
- this.tenantRange = tenantRange;
- }
- public boolean getIsPublic() {
- return isPublic;
- }
- public void setIsPublic(boolean isPublic) {
- this.isPublic = isPublic;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/VolumeBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/VolumeBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/VolumeBean.java
deleted file mode 100644
index 3881b78..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/cartridge/definition/VolumeBean.java
+++ /dev/null
@@ -1,101 +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.rest.endpoint.bean.cartridge.definition;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class VolumeBean {
-
- private String id;
-
- private String size;
-
- private String device;
-
- private boolean removeOnTermination;
-
- private String mappingPath;
-
- private String snapshotId;
-
- private String volumeId;
-
- public String toString () {
- return " [ Persistence Required : " + ", Size: " + getSize() + ", device: " +
- getDevice() + " remove on termination " + isRemoveOnTermination() +
- ", mappingPath : " + getMappingPath() + "] ";
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getSize() {
- return size;
- }
-
- public void setSize(String size) {
- this.size = size;
- }
-
- public String getDevice() {
- return device;
- }
-
- public void setDevice(String device) {
- this.device = device;
- }
-
- public boolean isRemoveOnTermination() {
- return removeOnTermination;
- }
-
- public void setRemoveOnTermination(boolean removeOnTermination) {
- this.removeOnTermination = removeOnTermination;
- }
-
- public String getMappingPath() {
- return mappingPath;
- }
-
- public void setMappingPath(String mappingPath) {
- this.mappingPath = mappingPath;
- }
-
- public String getSnapshotId() {
- return snapshotId;
- }
-
- public void setSnapshotId(String snapshotId) {
- this.snapshotId = snapshotId;
- }
-
- public String getVolumeId() {
- return volumeId;
- }
-
- public void setVolumeId(String volumeId) {
- this.volumeId = volumeId;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/KubernetesGroup.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/KubernetesGroup.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/KubernetesGroup.java
deleted file mode 100644
index a7c596a..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/KubernetesGroup.java
+++ /dev/null
@@ -1,84 +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.rest.endpoint.bean.kubernetes;
-
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PropertyBean;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class KubernetesGroup {
-
- private String groupId;
- private String description;
- private List<KubernetesHost> kubernetesHosts;
- private KubernetesMaster kubernetesMaster;
- private PortRange portRange;
- private List<PropertyBean> property;
-
- public String getGroupId() {
- return groupId;
- }
-
- public void setGroupId(String groupId) {
- this.groupId = groupId;
- }
-
- public List<KubernetesHost> getKubernetesHosts() {
- return kubernetesHosts;
- }
-
- public void setKubernetesHosts(List<KubernetesHost> kubernetesHosts) {
- this.kubernetesHosts = kubernetesHosts;
- }
-
- public KubernetesMaster getKubernetesMaster() {
- return kubernetesMaster;
- }
-
- public void setKubernetesMaster(KubernetesMaster kubernetesMaster) {
- this.kubernetesMaster = kubernetesMaster;
- }
-
- public PortRange getPortRange() {
- return portRange;
- }
-
- public void setPortRange(PortRange portRange) {
- this.portRange = portRange;
- }
-
- public List<PropertyBean> getProperty() {
- return property;
- }
-
- public void setProperty(List<PropertyBean> property) {
- this.property = property;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/KubernetesHost.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/KubernetesHost.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/KubernetesHost.java
deleted file mode 100644
index 864bc07..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/KubernetesHost.java
+++ /dev/null
@@ -1,67 +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.rest.endpoint.bean.kubernetes;
-
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PropertyBean;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class KubernetesHost {
- private String hostId;
- private String hostname;
- private String hostIpAddress;
- private List<PropertyBean> property;
-
- public String getHostId() {
- return hostId;
- }
-
- public void setHostId(String hostId) {
- this.hostId = hostId;
- }
-
- public String getHostname() {
- return hostname;
- }
-
- public void setHostname(String hostname) {
- this.hostname = hostname;
- }
-
- public String getHostIpAddress() {
- return hostIpAddress;
- }
-
- public void setHostIpAddress(String hostIpAddress) {
- this.hostIpAddress = hostIpAddress;
- }
-
- public List<PropertyBean> getProperty() {
- return property;
- }
-
- public void setProperty(List<PropertyBean> property) {
- this.property = property;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/KubernetesMaster.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/KubernetesMaster.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/KubernetesMaster.java
deleted file mode 100644
index d4c5392..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/KubernetesMaster.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.rest.endpoint.bean.kubernetes;
-
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PropertyBean;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class KubernetesMaster {
- private String hostId;
- private String hostname;
- private String hostIpAddress;
- private List<PropertyBean> property;
- private String endpoint;
-
- public String getHostId() {
- return hostId;
- }
-
- public void setHostId(String hostId) {
- this.hostId = hostId;
- }
-
- public String getHostname() {
- return hostname;
- }
-
- public void setHostname(String hostname) {
- this.hostname = hostname;
- }
-
- public String getHostIpAddress() {
- return hostIpAddress;
- }
-
- public void setHostIpAddress(String hostIpAddress) {
- this.hostIpAddress = hostIpAddress;
- }
-
- public List<PropertyBean> getProperty() {
- return property;
- }
-
- public void setProperty(List<PropertyBean> property) {
- this.property = property;
- }
-
- public String getEndpoint() {
- return endpoint;
- }
-
- public void setEndpoint(String endpoint) {
- this.endpoint = endpoint;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/PortRange.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/PortRange.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/PortRange.java
deleted file mode 100644
index fd105bf..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/PortRange.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.rest.endpoint.bean.kubernetes;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class PortRange {
- int upper;
- int lower;
-
- public int getUpper() {
- return upper;
- }
-
- public void setUpper(int upper) {
- this.upper = upper;
- }
-
- public int getLower() {
- return lower;
- }
-
- public void setLower(int lower) {
- this.lower = lower;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Properties.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Properties.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Properties.java
deleted file mode 100644
index 643e1db..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Properties.java
+++ /dev/null
@@ -1,50 +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.rest.endpoint.bean.kubernetes;
-
-import java.io.Serializable;
-import java.util.Arrays;
-
-/**
- * Had to wrap {@link Property} array using a class, since there's a bug in current
- * stub generation.
- */
-public class Properties implements Serializable{
-
- private static final long serialVersionUID = 1986895299288322592L;
- private Property[] properties;
-
- public Property[] getProperties() {
- return properties;
- }
-
- public void setProperties(Property[] properties) {
- if(properties == null) {
- this.properties = new Property[0];
- } else {
- this.properties = Arrays.copyOf(properties, properties.length);
- }
- }
-
- @Override
- public String toString() {
- return "Properties [properties=" + Arrays.toString(properties) + "]";
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Property.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Property.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Property.java
deleted file mode 100644
index 3ed20d7..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Property.java
+++ /dev/null
@@ -1,62 +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.rest.endpoint.bean.kubernetes;
-
-import java.io.Serializable;
-
-/**
- * Holds a property
- */
-public class Property implements Serializable{
-
- private static final long serialVersionUID = -2191782657999410197L;
- private String name;
- private String value;
-
- public Property(){
-
- }
-
- public Property(String name, String value){
- this.setName(name);
- this.setValue(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;
- }
-
- @Override
- public String toString() {
- return "Property [name=" + name + ", value=" + value + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/repositoryNotificationInfoBean/Payload.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/repositoryNotificationInfoBean/Payload.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/repositoryNotificationInfoBean/Payload.java
deleted file mode 100644
index 9376a59..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/repositoryNotificationInfoBean/Payload.java
+++ /dev/null
@@ -1,34 +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.rest.endpoint.bean.repositoryNotificationInfoBean;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "payload")
-public class Payload {
- private Repository repository;
-
- public Repository getRepository() {
- return repository;
- }
-
- public void setRepository(Repository repository) {
- this.repository = repository;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/repositoryNotificationInfoBean/Repository.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/repositoryNotificationInfoBean/Repository.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/repositoryNotificationInfoBean/Repository.java
deleted file mode 100644
index 02440b8..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/repositoryNotificationInfoBean/Repository.java
+++ /dev/null
@@ -1,43 +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.rest.endpoint.bean.repositoryNotificationInfoBean;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "repository")
-public class Repository {
- private String url;
- private String description;
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/subscription/domain/SubscriptionDomainBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/subscription/domain/SubscriptionDomainBean.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/subscription/domain/SubscriptionDomainBean.java
deleted file mode 100644
index 1b053bf..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/subscription/domain/SubscriptionDomainBean.java
+++ /dev/null
@@ -1,29 +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.rest.endpoint.bean.subscription.domain;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "domains")
-public class SubscriptionDomainBean {
- public String domainName;
- public String applicationContext;
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/topology/Cluster.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/topology/Cluster.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/topology/Cluster.java
deleted file mode 100644
index 7fcc1b2..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/topology/Cluster.java
+++ /dev/null
@@ -1,63 +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.rest.endpoint.bean.topology;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PropertyBean;
-
-import java.util.List;
-
-@XmlRootElement(name="clusters")
-public class Cluster {
-
- public String alias;
-
- public String serviceName;
-
- public String clusterId;
-
- public List<Member> member;
-
- public String tenantRange;
-
- public List<String> hostNames;
-
- public boolean isLbCluster;
-
- public List<PropertyBean> property;
-
- private List<Instance> instances;
-
- public List<Instance> getInstances() {
- return instances;
- }
-
- public void setInstances(List<Instance> instances) {
- this.instances = instances;
- }
-
- @Override
- public String toString() {
- return "Cluster [serviceName=" + serviceName + ", clusterId=" + clusterId + ", member=" + member
- + ", tenantRange=" + tenantRange + ", hostNames=" + hostNames + ", isLbCluster=" + isLbCluster
- + ", property=" + property + "]";
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/topology/Instance.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/topology/Instance.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/topology/Instance.java
deleted file mode 100644
index ebd4066..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/topology/Instance.java
+++ /dev/null
@@ -1,29 +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.rest.endpoint.bean.topology;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class Instance {
-
- public String status;
-
- public String instanceId;
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/df2d6e6c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/topology/Member.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/topology/Member.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/topology/Member.java
deleted file mode 100644
index 2de7c0e..0000000
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/topology/Member.java
+++ /dev/null
@@ -1,48 +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.rest.endpoint.bean.topology;
-
-import java.util.List;
-import javax.xml.bind.annotation.XmlRootElement;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PropertyBean;
-
-@XmlRootElement
-public class Member {
- public String serviceName;
- public String clusterId;
- public String networkPartitionId;
- public String partitionId;
- public String memberId;
-
- public String status;
- public String memberIp;
- public String lbClusterId;
- public String memberPublicIp;
- public List<PropertyBean> property;
-
- @Override
- public String toString() {
- return "Member [serviceName=" + serviceName + ", clusterId=" + clusterId + ", networkPartitionId="
- + networkPartitionId + ", partitionId=" + partitionId + ", memberId=" + memberId + ", status=" + status
- + ", memberIp=" + memberIp + ", lbClusterId=" + lbClusterId + ", memberPublicIp=" + memberPublicIp
- + ", property=" + property + "]";
- }
-
-
-}