Repository: stratos Updated Branches: refs/heads/master 0b7734f4c -> e4ec3ee4a
Fixing services and service stubs properly. Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/84102805 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/84102805 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/84102805 Branch: refs/heads/master Commit: 8410280576641fcbe5b2e42a1a7f044fc08794b8 Parents: 0b7734f Author: Nirmal Fernando <[email protected]> Authored: Mon Dec 1 17:53:38 2014 +0530 Committer: Nirmal Fernando <[email protected]> Committed: Mon Dec 1 17:55:43 2014 +0530 ---------------------------------------------------------------------- .../applications/ApplicationUtils.java | 30 ++++-- .../client/CloudControllerClient.java | 9 +- .../context/cluster/VMClusterContext.java | 3 +- .../cluster/VMServiceClusterMonitor.java | 3 +- .../policy/deployment/DeploymentPolicy.java | 3 +- .../stratos/autoscaler/util/AutoscalerUtil.java | 48 +++++++++ .../behaviour/CartridgeMgtBehaviour.java | 31 +++--- .../manager/client/AutoscalerServiceClient.java | 10 +- .../client/CloudControllerServiceClient.java | 24 +---- .../manager/CartridgeSubscriptionManager.java | 6 +- .../filter/LBCreationSubscriptionFilter.java | 40 +++---- .../utils/ApplicationManagementUtil.java | 68 ++++++++++++ .../rest/endpoint/api/StratosApiV40Utils.java | 4 +- .../rest/endpoint/api/StratosApiV41Utils.java | 26 ++--- .../bean/util/converter/PojoConverter.java | 103 +++++++++++++------ .../pom.xml | 2 +- .../pom.xml | 2 +- 17 files changed, 281 insertions(+), 131 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java index dc81eb9..d0918e6 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java @@ -25,6 +25,7 @@ import org.apache.stratos.autoscaler.applications.payload.BasicPayloadData; import org.apache.stratos.autoscaler.applications.payload.PayloadData; import org.apache.stratos.autoscaler.applications.payload.PayloadFactory; import org.apache.stratos.autoscaler.exception.application.ApplicationDefinitionException; +import org.apache.stratos.autoscaler.util.AutoscalerUtil; import org.apache.stratos.cloud.controller.stub.domain.CartridgeInfo; import org.apache.stratos.cloud.controller.stub.domain.PortMapping; import org.apache.stratos.common.Property; @@ -209,18 +210,25 @@ public class ApplicationUtils { // get the payload parameters defined in the cartridgeInfo definition file for this cartridgeInfo type if (cartridgeInfo.getProperties() != null && cartridgeInfo.getProperties().length != 0) { - for (Property propertyEntry : cartridgeInfo.getProperties()) { - // check if a property is related to the payload. Currently this is done by checking if the - // property name starts with 'payload_parameter.' suffix. If so the payload param name will - // be taken as the substring from the index of '.' to the end of the property name. - if (propertyEntry.getName() - .startsWith("payload_parameter.")) { - String payloadParamName = propertyEntry.getName(); - String payloadParamSubstring = payloadParamName.substring(payloadParamName.indexOf(".") + 1); - if("DEPLOYMENT".equals(payloadParamSubstring)) { - isDeploymentParam = true; + org.apache.stratos.common.Properties cartridgeProps = AutoscalerUtil.toCommonProperties(cartridgeInfo.getProperties()); + + if (cartridgeProps != null) { + + for (Property propertyEntry : cartridgeProps.getProperties()) { + // check if a property is related to the payload. Currently + // this is done by checking if the + // property name starts with 'payload_parameter.' suffix. If + // so the payload param name will + // be taken as the substring from the index of '.' to the + // end of the property name. + if (propertyEntry.getName().startsWith("payload_parameter.")) { + String payloadParamName = propertyEntry.getName(); + String payloadParamSubstring = payloadParamName.substring(payloadParamName.indexOf(".") + 1); + if ("DEPLOYMENT".equals(payloadParamSubstring)) { + isDeploymentParam = true; + } + payloadData.add(payloadParamSubstring, propertyEntry.getValue()); } - payloadData.add(payloadParamSubstring, propertyEntry.getValue()); } } } http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/CloudControllerClient.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/CloudControllerClient.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/CloudControllerClient.java index 963c661..4119c34 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/CloudControllerClient.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/CloudControllerClient.java @@ -33,6 +33,7 @@ import org.apache.stratos.autoscaler.exception.partition.PartitionValidationExce import org.apache.stratos.autoscaler.pojo.policy.deployment.DeploymentPolicy; import org.apache.stratos.autoscaler.kubernetes.KubernetesManager; import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.*; +import org.apache.stratos.autoscaler.util.AutoscalerUtil; import org.apache.stratos.autoscaler.util.ConfUtil; import org.apache.stratos.cloud.controller.stub.*; import org.apache.stratos.cloud.controller.stub.domain.*; @@ -132,7 +133,7 @@ public class CloudControllerClient { partition1.setId(partition.getId()); partition1.setProvider(partition.getProvider()); - partition1.setProperties(partition.getProperties()); + partition1.setProperties(AutoscalerUtil.toStubProperties(partition.getProperties())); return partition1; } @@ -200,7 +201,7 @@ public class CloudControllerClient { memberContextProps.addProperty(isPrimaryProp); memberContextProps.addProperty(minCountProp); - member.setProperties(memberContextProps); + member.setProperties(AutoscalerUtil.toStubProperties(memberContextProps)); long startTime = System.currentTimeMillis(); @@ -261,7 +262,7 @@ public class CloudControllerClient { dto.setTenantRange(context.getTenantRange()); dto.setTextPayload(context.getTextPayload()); dto.setLbCluster(context.isLbCluster()); - dto.setProperties(context.getProperties()); + dto.setProperties(AutoscalerUtil.toStubProperties(context.getProperties())); contextDTOs.add(dto); } @@ -373,7 +374,7 @@ public class CloudControllerClient { kubernetesClusterPortRangeProps.setName(StratosConstants.KUBERNETES_PORT_RANGE); kubernetesClusterPortRangeProps.setValue(portRange); memberContextProps.addProperty(kubernetesClusterPortRangeProps); - context.setProperties(memberContextProps); + context.setProperties(AutoscalerUtil.toStubProperties(memberContextProps)); long startTime = System.currentTimeMillis(); MemberContext[] memberContexts = stub.startContainers(context); http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/VMClusterContext.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/VMClusterContext.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/VMClusterContext.java index d250fc3..9fb91ac 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/VMClusterContext.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/context/cluster/VMClusterContext.java @@ -31,6 +31,7 @@ import org.apache.stratos.autoscaler.pojo.policy.deployment.DeploymentPolicy; import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.ChildLevelPartition; import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.ChildLevelNetworkPartition; import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.Partition; +import org.apache.stratos.autoscaler.util.AutoscalerUtil; import org.apache.stratos.cloud.controller.stub.domain.MemberContext; import org.apache.stratos.messaging.domain.instance.ClusterInstance; import org.apache.stratos.messaging.domain.topology.Cluster; @@ -322,7 +323,7 @@ public class VMClusterContext extends AbstractClusterContext { partition1.setId(partition.getId()); partition1.setProvider(partition.getProvider()); - partition1.setProperties(partition.getProperties()); + partition1.setProperties(AutoscalerUtil.toStubProperties(partition.getProperties())); return partition1; } http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMServiceClusterMonitor.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMServiceClusterMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMServiceClusterMonitor.java index a20e1f2..02c4ee6 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMServiceClusterMonitor.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMServiceClusterMonitor.java @@ -31,6 +31,7 @@ import org.apache.stratos.autoscaler.monitor.events.MonitorStatusEvent; import org.apache.stratos.autoscaler.monitor.events.builder.MonitorStatusEventBuilder; import org.apache.stratos.autoscaler.rule.AutoscalerRuleEvaluator; import org.apache.stratos.autoscaler.util.AutoScalerConstants; +import org.apache.stratos.autoscaler.util.AutoscalerUtil; import org.apache.stratos.autoscaler.util.ConfUtil; import org.apache.stratos.cloud.controller.stub.domain.MemberContext; import org.apache.stratos.common.Properties; @@ -93,7 +94,7 @@ public class VMServiceClusterMonitor extends VMClusterMonitor { } private boolean isPrimaryMember(MemberContext memberContext) { - Properties props = memberContext.getProperties(); + Properties props = AutoscalerUtil.toCommonProperties(memberContext.getProperties()); if (log.isDebugEnabled()) { log.debug(" Properties [" + props + "] "); } http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/DeploymentPolicy.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/DeploymentPolicy.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/DeploymentPolicy.java index d451124..378c40b 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/DeploymentPolicy.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/DeploymentPolicy.java @@ -23,6 +23,7 @@ import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.Ap import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.ChildLevelNetworkPartition; import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.ChildPolicyHolder; import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.Partition; +import org.apache.stratos.autoscaler.util.AutoscalerUtil; import java.io.Serializable; import java.util.ArrayList; @@ -155,7 +156,7 @@ public class DeploymentPolicy implements Serializable{ partition1.setId(partition.getId()); partition1.setProvider(partition.getProvider()); - partition1.setProperties(partition.getProperties()); + partition1.setProperties(AutoscalerUtil.toStubProperties(partition.getProperties())); return partition1; } http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java index 455e795..5b80264 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java @@ -238,6 +238,54 @@ public class AutoscalerUtil { properties.setProperties(propertyArray); return properties; } + + public static org.apache.stratos.cloud.controller.stub.Properties toStubProperties( + org.apache.stratos.common.Properties properties) { + org.apache.stratos.cloud.controller.stub.Properties stubProps = new org.apache.stratos.cloud.controller.stub.Properties(); + + if (properties != null && properties.getProperties() != null) { + + for (Property property : properties.getProperties()) { + if ((property != null) && (property.getValue() != null)) { + org.apache.stratos.cloud.controller.stub.Property newProperty = new org.apache.stratos.cloud.controller.stub.Property(); + newProperty.setName(property.getName()); + newProperty.setValue(property.getValue()); + stubProps.addProperties(newProperty); + } + } + + } + + return stubProps; + } + + public static org.apache.stratos.common.Properties toCommonProperties( + org.apache.stratos.cloud.controller.stub.Properties properties) { + org.apache.stratos.common.Properties commonProps = new org.apache.stratos.common.Properties(); + + if (properties != null && properties.getProperties() != null) { + + for (org.apache.stratos.cloud.controller.stub.Property property : properties.getProperties()) { + if ((property != null) && (property.getValue() != null)) { + Property newProperty = new Property(); + newProperty.setName(property.getName()); + newProperty.setValue(property.getValue()); + commonProps.addProperty(newProperty); + } + } + + } + + return commonProps; + } + + public static org.apache.stratos.common.Properties toCommonProperties( + org.apache.stratos.cloud.controller.stub.Property[] propertyArray) { + + org.apache.stratos.cloud.controller.stub.Properties properties = new org.apache.stratos.cloud.controller.stub.Properties(); + properties.setProperties(propertyArray); + return toCommonProperties(properties); + } // public static LbClusterMonitor getLbClusterMonitor(Cluster cluster) throws PolicyValidationException, PartitionValidationException { // if (null == cluster) { http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/behaviour/CartridgeMgtBehaviour.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/behaviour/CartridgeMgtBehaviour.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/behaviour/CartridgeMgtBehaviour.java index 797935c..384d494 100644 --- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/behaviour/CartridgeMgtBehaviour.java +++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/behaviour/CartridgeMgtBehaviour.java @@ -38,7 +38,6 @@ import org.apache.stratos.manager.subscriber.Subscriber; import org.apache.stratos.manager.subscription.utils.CartridgeSubscriptionUtils; import org.apache.stratos.manager.utils.ApplicationManagementUtil; import org.apache.stratos.manager.utils.CartridgeConstants; -import org.apache.stratos.cloud.controller.stub.domain.CartridgeInfo; import java.io.Serializable; import java.util.Map; @@ -92,18 +91,26 @@ public abstract class CartridgeMgtBehaviour implements Serializable { // get the payload parameters defined in the cartridge definition file for this cartridge type if (cartridgeInfo.getProperties() != null && cartridgeInfo.getProperties().length != 0) { - for (org.apache.stratos.common.Property property : cartridgeInfo.getProperties()) { - // check if a property is related to the payload. Currently this is done by checking if the - // property name starts with 'payload_parameter.' suffix. If so the payload param name will - // be taken as the substring from the index of '.' to the end of the property name. - if (property.getName() - .startsWith(CartridgeConstants.CUSTOM_PAYLOAD_PARAM_NAME_PREFIX)) { - String payloadParamName = property.getName(); - String payloadParamSubstring = payloadParamName.substring(payloadParamName.indexOf(".") + 1); - if("DEPLOYMENT".equals(payloadParamSubstring)) { - isDeploymentParam = true; + org.apache.stratos.common.Properties cartridgeProps = ApplicationManagementUtil + .toCommonProperties(cartridgeInfo.getProperties()); + + if (cartridgeProps != null) { + + for (org.apache.stratos.common.Property property : cartridgeProps.getProperties()) { + // check if a property is related to the payload. Currently + // this is done by checking if the + // property name starts with 'payload_parameter.' suffix. If + // so the payload param name will + // be taken as the substring from the index of '.' to the + // end of the property name. + if (property.getName().startsWith(CartridgeConstants.CUSTOM_PAYLOAD_PARAM_NAME_PREFIX)) { + String payloadParamName = property.getName(); + String payloadParamSubstring = payloadParamName.substring(payloadParamName.indexOf(".") + 1); + if ("DEPLOYMENT".equals(payloadParamSubstring)) { + isDeploymentParam = true; + } + payloadData.add(payloadParamSubstring, property.getValue()); } - payloadData.add(payloadParamSubstring, property.getValue()); } } } http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/client/AutoscalerServiceClient.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/client/AutoscalerServiceClient.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/client/AutoscalerServiceClient.java index a220323..15fc690 100644 --- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/client/AutoscalerServiceClient.java +++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/client/AutoscalerServiceClient.java @@ -25,17 +25,17 @@ import org.apache.axis2.transport.http.HTTPConstants; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.stratos.autoscaler.stub.deployment.partition.ApplicationLevelNetworkPartition; +import org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup; +import org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost; +import org.apache.stratos.autoscaler.stub.kubernetes.KubernetesMaster; import org.apache.stratos.autoscaler.stub.pojo.ApplicationContext; import org.apache.stratos.autoscaler.stub.pojo.ServiceGroup; import org.apache.stratos.autoscaler.stub.*; -import org.apache.stratos.common.kubernetes.KubernetesGroup; -import org.apache.stratos.common.kubernetes.KubernetesHost; -import org.apache.stratos.common.kubernetes.KubernetesMaster; import org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy; import org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy; -import org.apache.stratos.cloud.controller.stub.domain.Partition; import org.apache.stratos.common.Properties; import org.apache.stratos.manager.internal.DataHolder; +import org.apache.stratos.manager.utils.ApplicationManagementUtil; import org.apache.stratos.manager.utils.CartridgeConstants; import java.rmi.RemoteException; @@ -311,6 +311,6 @@ public class AutoscalerServiceClient { } public void updateClusterMonitor(String clusterId, Properties properties) throws RemoteException, AutoScalerServiceInvalidArgumentExceptionException { - stub.updateClusterMonitor(clusterId, properties); + stub.updateClusterMonitor(clusterId, ApplicationManagementUtil.toAutoscalerStubProperties(properties)); } } http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/client/CloudControllerServiceClient.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/client/CloudControllerServiceClient.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/client/CloudControllerServiceClient.java index e900c60..86c8d01 100644 --- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/client/CloudControllerServiceClient.java +++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/client/CloudControllerServiceClient.java @@ -35,6 +35,7 @@ import org.apache.stratos.cloud.controller.stub.domain.Dependencies; import org.apache.stratos.common.Properties; import org.apache.stratos.common.Property; import org.apache.stratos.manager.internal.DataHolder; +import org.apache.stratos.manager.utils.ApplicationManagementUtil; import org.apache.stratos.manager.utils.CartridgeConstants; import java.rmi.RemoteException; @@ -128,7 +129,7 @@ public class CloudControllerServiceClient { registrant.setCartridgeType(cartridgeType); registrant.setTenantRange(tenantRange); registrant.setHostName(hostName); - registrant.setProperties(properties); + registrant.setProperties(ApplicationManagementUtil.toCCStubProperties(properties)); registrant.setPayload(payload); registrant.setAutoScalerPolicyName(autoscalorPolicyName); registrant.setDeploymentPolicyName(deploymentPolicyName); @@ -137,27 +138,6 @@ public class CloudControllerServiceClient { } - @SuppressWarnings("unused") - private Properties - extractProperties(java.util.Properties properties) { - Properties props = new Properties(); - if (properties != null) { - - for (Iterator<Object> iterator = properties.keySet().iterator(); iterator.hasNext();) { - String key = (String) iterator.next(); - String value = properties.getProperty(key); - - Property prop = new Property(); - prop.setName(key); - prop.setValue(value); - - props.addProperties(prop); - - } - } - return props; - } - public void terminateAllInstances(String clusterId) throws RemoteException, CloudControllerServiceInvalidClusterExceptionException { stub.terminateAllInstances(clusterId); http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/manager/CartridgeSubscriptionManager.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/manager/CartridgeSubscriptionManager.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/manager/CartridgeSubscriptionManager.java index c5b8cbf..224f100 100644 --- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/manager/CartridgeSubscriptionManager.java +++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/manager/CartridgeSubscriptionManager.java @@ -318,7 +318,7 @@ public class CartridgeSubscriptionManager { if (propertiesReturnedByFilters.getProperties() != null && propertiesReturnedByFilters.getProperties().length > 0) { for (Property prop : propertiesReturnedByFilters.getProperties()) { - serviceCartridgeSubscriptionProperties.addProperties(prop); + serviceCartridgeSubscriptionProperties.addProperty(prop); } } @@ -326,7 +326,7 @@ public class CartridgeSubscriptionManager { if (persistenceMappingProperties != null && persistenceMappingProperties.getProperties().length > 0) { // add the properties to send to CC via register method for (Property persistenceMappingProperty : persistenceMappingProperties.getProperties()) { - serviceCartridgeSubscriptionProperties.addProperties(persistenceMappingProperty); + serviceCartridgeSubscriptionProperties.addProperty(persistenceMappingProperty); } } @@ -358,7 +358,7 @@ public class CartridgeSubscriptionManager { for (Property property : newProperties.getProperties()) { if (property != null) { - propertiesReturnedByFilters.addProperties(property); + propertiesReturnedByFilters.addProperty(property); } } http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/filter/LBCreationSubscriptionFilter.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/filter/LBCreationSubscriptionFilter.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/filter/LBCreationSubscriptionFilter.java index 2d25bf7..c2534a1 100644 --- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/filter/LBCreationSubscriptionFilter.java +++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/filter/LBCreationSubscriptionFilter.java @@ -99,30 +99,30 @@ public class LBCreationSubscriptionFilter implements SubscriptionFilter { lbCartridgeSubscriptionProperties.setProperties(lbProperperties.toArray(new Property[lbProperperties.size()])); for (Property property : lbProperperties){ if (StratosConstants.LOAD_BALANCER_REF.equals(property.getName())) { - filterProperties.addProperties(property); + filterProperties.addProperty(property); } } } - if (lbCartridgeSubscription != null) { - // determine the LB cluster id, if available - Property lbClusterIdProp = new Property(); - lbClusterIdProp.setName(CartridgeConstants.LB_CLUSTER_ID); - lbClusterIdProp.setValue(lbCartridgeSubscription - .getClusterDomain()); - lbCartridgeSubscriptionProperties - .addProperties(lbClusterIdProp); - filterProperties.addProperties(lbClusterIdProp); - - // register LB cartridge subscription - if (log.isDebugEnabled()) { - log.debug(" Registering LB Cartridge subscription "); - } - CartridgeSubscriptionManager.registerCartridgeSubscription( - lbCartridgeSubscription, - lbCartridgeSubscriptionProperties, - subscriptionData.getPersistence()); - } +// if (lbCartridgeSubscription != null) { +// // determine the LB cluster id, if available +// Property lbClusterIdProp = new Property(); +// lbClusterIdProp.setName(CartridgeConstants.LB_CLUSTER_ID); +// lbClusterIdProp.setValue(lbCartridgeSubscription +// .getClusterDomain()); +// lbCartridgeSubscriptionProperties +// .addProperty(lbClusterIdProp); +// filterProperties.addProperty(lbClusterIdProp); +// +// // register LB cartridge subscription +// if (log.isDebugEnabled()) { +// log.debug(" Registering LB Cartridge subscription "); +// } +// CartridgeSubscriptionManager.registerCartridgeSubscription( +// lbCartridgeSubscription, +// lbCartridgeSubscriptionProperties, +// subscriptionData.getPersistence()); +// } } } catch (Exception e) { log.error(e.getMessage(), e); http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/ApplicationManagementUtil.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/ApplicationManagementUtil.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/ApplicationManagementUtil.java index 99e7088..04021ac 100644 --- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/ApplicationManagementUtil.java +++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/ApplicationManagementUtil.java @@ -212,6 +212,74 @@ public class ApplicationManagementUtil { } return properties; } + + public static org.apache.stratos.cloud.controller.stub.Properties toCCStubProperties( + org.apache.stratos.common.Properties properties) { + org.apache.stratos.cloud.controller.stub.Properties stubProps = new org.apache.stratos.cloud.controller.stub.Properties(); + + if (properties != null && properties.getProperties() != null) { + + for (Property property : properties.getProperties()) { + if ((property != null) && (property.getValue() != null)) { + org.apache.stratos.cloud.controller.stub.Property newProperty = new org.apache.stratos.cloud.controller.stub.Property(); + newProperty.setName(property.getName()); + newProperty.setValue(property.getValue()); + stubProps.addProperties(newProperty); + } + } + + } + + return stubProps; + } + + public static org.apache.stratos.autoscaler.stub.Properties toAutoscalerStubProperties( + org.apache.stratos.common.Properties properties) { + org.apache.stratos.autoscaler.stub.Properties stubProps = new org.apache.stratos.autoscaler.stub.Properties(); + + if (properties != null && properties.getProperties() != null) { + + for (Property property : properties.getProperties()) { + if ((property != null) && (property.getValue() != null)) { + org.apache.stratos.autoscaler.stub.Property newProperty = new org.apache.stratos.autoscaler.stub.Property(); + newProperty.setName(property.getName()); + newProperty.setValue(property.getValue()); + stubProps.addProperties(newProperty); + } + } + + } + + return stubProps; + } + + public static org.apache.stratos.common.Properties toCommonProperties( + org.apache.stratos.cloud.controller.stub.Properties properties) { + org.apache.stratos.common.Properties commonProps = new org.apache.stratos.common.Properties(); + + if (properties != null && properties.getProperties() != null) { + + for (org.apache.stratos.cloud.controller.stub.Property property : properties.getProperties()) { + if ((property != null) && (property.getValue() != null)) { + Property newProperty = new Property(); + newProperty.setName(property.getName()); + newProperty.setValue(property.getValue()); + commonProps.addProperty(newProperty); + } + } + + } + + return commonProps; + } + + public static org.apache.stratos.common.Properties toCommonProperties( + org.apache.stratos.cloud.controller.stub.Property[] propertyArray) { + + org.apache.stratos.cloud.controller.stub.Properties properties = new org.apache.stratos.cloud.controller.stub.Properties(); + properties.setProperties(propertyArray); + return toCommonProperties(properties); + } private static String convertRepoURL(String gitURL) { String convertedHttpURL = null; http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/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 407b7fa..e5fa7be 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 @@ -583,7 +583,7 @@ public class StratosApiV40Utils { cartridge.setServiceGroup(cartridgeInfo.getServiceGroup()); if(cartridgeInfo.getLbConfig() != null && cartridgeInfo.getProperties() != null) { - for(Property property: cartridgeInfo.getProperties()) { + for(org.apache.stratos.cloud.controller.stub.Property property: cartridgeInfo.getProperties()) { if(property.getName().equals("load.balancer")) { cartridge.setLoadBalancer(true); } @@ -898,7 +898,7 @@ public class StratosApiV40Utils { .getPortMappings()); if(subscription.getCartridgeInfo().getLbConfig() != null && subscription.getCartridgeInfo().getProperties() != null) { - for(Property property: subscription.getCartridgeInfo().getProperties()) { + for(org.apache.stratos.cloud.controller.stub.Property property: subscription.getCartridgeInfo().getProperties()) { if(property.getName().equals("load.balancer")) { cartridge.setLoadBalancer(true); } http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/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 ffd40fc..d8a6c3f 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 @@ -172,12 +172,12 @@ public class StratosApiV41Utils { applicationContext.setTeantAdminUsername(userName); if (appDefinition.getProperty() != null) { - org.apache.stratos.common.Properties properties = new org.apache.stratos.common.Properties(); + org.apache.stratos.autoscaler.stub.Properties properties = new org.apache.stratos.autoscaler.stub.Properties(); for (org.apache.stratos.manager.composite.application.beans.PropertyBean propertyBean : appDefinition.getProperty()) { - Property property = new Property(); + org.apache.stratos.autoscaler.stub.Property property = new org.apache.stratos.autoscaler.stub.Property(); property.setName(propertyBean.getName()); property.setValue(propertyBean.getValue()); - properties.addProperty(property); + properties.addProperties(property); } applicationContext.setProperties(properties); } @@ -763,7 +763,7 @@ public class StratosApiV41Utils { cartridge.setServiceGroup(cartridgeInfo.getServiceGroup()); if (cartridgeInfo.getProperties() != null) { - for (Property property : cartridgeInfo.getProperties()) { + for (org.apache.stratos.cloud.controller.stub.Property property : cartridgeInfo.getProperties()) { if (property.getName().equals("load.balancer")) { cartridge.setLoadBalancer(true); } @@ -1081,7 +1081,7 @@ public class StratosApiV41Utils { .getPortMappings()); if (subscription.getCartridgeInfo().getProperties() != null) { - for (Property property : subscription.getCartridgeInfo().getProperties()) { + for (org.apache.stratos.cloud.controller.stub.Property property : subscription.getCartridgeInfo().getProperties()) { if (property.getName().equals("load.balancer")) { cartridge.setLoadBalancer(true); } @@ -1620,7 +1620,7 @@ public class StratosApiV41Utils { AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient(); if (autoscalerServiceClient != null) { - org.apache.stratos.common.kubernetes.KubernetesGroup kubernetesGroup = + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup kubernetesGroup = PojoConverter.convertToASKubernetesGroupPojo(kubernetesGroupBean); try { @@ -1642,7 +1642,7 @@ public class StratosApiV41Utils { AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient(); if (autoscalerServiceClient != null) { - org.apache.stratos.common.kubernetes.KubernetesHost kubernetesHost = + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost kubernetesHost = PojoConverter.convertToASKubernetesHostPojo(kubernetesHostBean); try { @@ -1667,7 +1667,7 @@ public class StratosApiV41Utils { AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient(); if (autoscalerServiceClient != null) { - org.apache.stratos.common.kubernetes.KubernetesMaster kubernetesMaster = + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesMaster kubernetesMaster = PojoConverter.convertToASKubernetesMasterPojo(kubernetesMasterBean); try { @@ -1693,7 +1693,7 @@ public class StratosApiV41Utils { AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient(); if (autoscalerServiceClient != null) { try { - org.apache.stratos.common.kubernetes.KubernetesGroup[] + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup[] kubernetesGroups = autoscalerServiceClient.getAvailableKubernetesGroups(); return PojoConverter.populateKubernetesGroupsPojo(kubernetesGroups); @@ -1710,7 +1710,7 @@ public class StratosApiV41Utils { AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient(); if (autoscalerServiceClient != null) { try { - org.apache.stratos.common.kubernetes.KubernetesGroup + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup kubernetesGroup = autoscalerServiceClient.getKubernetesGroup(kubernetesGroupId); return PojoConverter.populateKubernetesGroupPojo(kubernetesGroup); @@ -1769,7 +1769,7 @@ public class StratosApiV41Utils { AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient(); if (autoscalerServiceClient != null) { try { - org.apache.stratos.common.kubernetes.KubernetesHost[] + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost[] kubernetesHosts = autoscalerServiceClient.getKubernetesHosts(kubernetesGroupId); List<KubernetesHost> arrayList = PojoConverter.populateKubernetesHostsPojo(kubernetesHosts); @@ -1792,7 +1792,7 @@ public class StratosApiV41Utils { AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient(); if (autoscalerServiceClient != null) { try { - org.apache.stratos.common.kubernetes.KubernetesMaster + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesMaster kubernetesMaster = autoscalerServiceClient.getKubernetesMaster(kubernetesGroupId); return PojoConverter.populateKubernetesMasterPojo(kubernetesMaster); @@ -1811,7 +1811,7 @@ public class StratosApiV41Utils { public static boolean updateKubernetesHost(KubernetesHost kubernetesHostBean) throws RestAPIException { AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient(); if (autoscalerServiceClient != null) { - org.apache.stratos.common.kubernetes.KubernetesHost kubernetesHost = + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost kubernetesHost = PojoConverter.convertToASKubernetesHostPojo(kubernetesHostBean); try { return autoscalerServiceClient.updateKubernetesHost(kubernetesHost); http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/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 index 64e9bc6..a6504f4 100644 --- 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 @@ -108,7 +108,7 @@ public class PojoConverter { } //Properties if (cartridgeDefinitionBean.property != null && !cartridgeDefinitionBean.property.isEmpty()) { - cartridgeConfig.setProperties(getProperties(cartridgeDefinitionBean.property)); + cartridgeConfig.setProperties(getCCProperties(cartridgeDefinitionBean.property)); } if (cartridgeDefinitionBean.getExportingProperties() != null) { @@ -143,7 +143,7 @@ public class PojoConverter { LoadbalancerConfig lbConfig = new LoadbalancerConfig(); lbConfig.setType(loadBalancer.type); if (loadBalancer.property != null && !loadBalancer.property.isEmpty()) { - lbConfig.setProperties(getProperties(loadBalancer.property)); + lbConfig.setProperties(getCCProperties(loadBalancer.property)); } return lbConfig; } @@ -186,7 +186,7 @@ public class PojoConverter { if (iaasProviderBeansArray[i].property != null && !iaasProviderBeansArray[i].property.isEmpty()) { //set the Properties instance to IaasConfig instance - iaasConfig.setProperties(getProperties(iaasProviderBeansArray[i].property)); + iaasConfig.setProperties(getCCProperties(iaasProviderBeansArray[i].property)); } if (iaasProviderBeansArray[i].networkInterfaces != null && !iaasProviderBeansArray[i].networkInterfaces.isEmpty()) { @@ -242,9 +242,28 @@ public class PojoConverter { 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]; - public static Properties getASProperties(List<PropertyBean> propertyBeans) { + 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; } @@ -252,16 +271,16 @@ public class PojoConverter { //convert to an array PropertyBean[] propertyBeansArray = new PropertyBean[propertyBeans.size()]; propertyBeans.toArray(propertyBeansArray); - Property[] propertyArray = new Property[propertyBeansArray.length]; + org.apache.stratos.autoscaler.stub.Property[] propertyArray = new org.apache.stratos.autoscaler.stub.Property[propertyBeansArray.length]; for (int j = 0; j < propertyBeansArray.length; j++) { - Property property = new Property(); + 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; } - Properties properties = new Properties(); + org.apache.stratos.autoscaler.stub.Properties properties = new org.apache.stratos.autoscaler.stub.Properties(); properties.setProperties(propertyArray); return properties; } @@ -295,7 +314,7 @@ public class PojoConverter { partition.setProvider(partitionBean.provider); if (partitionBean.property != null && !partitionBean.property.isEmpty()) { - partition.setProperties(getProperties(partitionBean.property)); + partition.setProperties(getASProperties(partitionBean.property)); } return partition; @@ -586,6 +605,22 @@ public class PojoConverter { } 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) { @@ -784,10 +819,10 @@ public class PojoConverter { return serviceDefinitionBeans; } - public static org.apache.stratos.common.kubernetes.KubernetesGroup convertToASKubernetesGroupPojo(KubernetesGroup kubernetesGroupBean) { + public static org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup convertToASKubernetesGroupPojo(KubernetesGroup kubernetesGroupBean) { - org.apache.stratos.common.kubernetes.KubernetesGroup kubernetesGroup = new - org.apache.stratos.common.kubernetes.KubernetesGroup(); + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup kubernetesGroup = new + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup(); kubernetesGroup.setGroupId(kubernetesGroupBean.getGroupId()); kubernetesGroup.setDescription(kubernetesGroupBean.getDescription()); @@ -799,13 +834,13 @@ public class PojoConverter { return kubernetesGroup; } - private static org.apache.stratos.common.kubernetes.KubernetesHost[] convertToASKubernetesHostsPojo(List<KubernetesHost> kubernetesHosts) { + private static org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost[] convertToASKubernetesHostsPojo(List<KubernetesHost> kubernetesHosts) { if (kubernetesHosts == null || kubernetesHosts.isEmpty()) { return null; } int kubernetesHostCount = kubernetesHosts.size(); - org.apache.stratos.common.kubernetes.KubernetesHost[] - kubernetesHostsArr = new org.apache.stratos.common.kubernetes.KubernetesHost[kubernetesHostCount]; + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost[] + kubernetesHostsArr = new org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost[kubernetesHostCount]; for (int i = 0; i < kubernetesHostCount; i++) { KubernetesHost kubernetesHostBean = kubernetesHosts.get(i); kubernetesHostsArr[i] = convertToASKubernetesHostPojo(kubernetesHostBean); @@ -814,24 +849,24 @@ public class PojoConverter { } - private static org.apache.stratos.common.kubernetes.PortRange convertToASPortRange(PortRange portRangeBean) { + private static org.apache.stratos.autoscaler.stub.kubernetes.PortRange convertToASPortRange(PortRange portRangeBean) { if (portRangeBean == null) { return null; } - org.apache.stratos.common.kubernetes.PortRange - portRange = new org.apache.stratos.common.kubernetes.PortRange(); + org.apache.stratos.autoscaler.stub.kubernetes.PortRange + portRange = new org.apache.stratos.autoscaler.stub.kubernetes.PortRange(); portRange.setLower(portRangeBean.getLower()); portRange.setUpper(portRangeBean.getUpper()); return portRange; } - public static org.apache.stratos.common.kubernetes.KubernetesHost convertToASKubernetesHostPojo(KubernetesHost kubernetesHostBean) { + public static org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost convertToASKubernetesHostPojo(KubernetesHost kubernetesHostBean) { if (kubernetesHostBean == null) { return null; } - org.apache.stratos.common.kubernetes.KubernetesHost - kubernetesHost = new org.apache.stratos.common.kubernetes.KubernetesHost(); + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost + kubernetesHost = new org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost(); kubernetesHost.setHostId(kubernetesHostBean.getHostId()); kubernetesHost.setHostIpAddress(kubernetesHostBean.getHostIpAddress()); kubernetesHost.setHostname(kubernetesHostBean.getHostname()); @@ -840,13 +875,13 @@ public class PojoConverter { return kubernetesHost; } - public static org.apache.stratos.common.kubernetes.KubernetesMaster convertToASKubernetesMasterPojo(KubernetesMaster kubernetesMasterBean) { + public static org.apache.stratos.autoscaler.stub.kubernetes.KubernetesMaster convertToASKubernetesMasterPojo(KubernetesMaster kubernetesMasterBean) { if (kubernetesMasterBean == null) { return null; } - org.apache.stratos.common.kubernetes.KubernetesMaster - kubernetesMaster = new org.apache.stratos.common.kubernetes.KubernetesMaster(); + org.apache.stratos.autoscaler.stub.kubernetes.KubernetesMaster + kubernetesMaster = new org.apache.stratos.autoscaler.stub.kubernetes.KubernetesMaster(); kubernetesMaster.setHostId(kubernetesMasterBean.getHostId()); kubernetesMaster.setHostIpAddress(kubernetesMasterBean.getHostIpAddress()); kubernetesMaster.setHostname(kubernetesMasterBean.getHostname()); @@ -856,7 +891,7 @@ public class PojoConverter { return kubernetesMaster; } - public static KubernetesGroup[] populateKubernetesGroupsPojo(org.apache.stratos.common.kubernetes.KubernetesGroup[] kubernetesGroups) { + public static KubernetesGroup[] populateKubernetesGroupsPojo(org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup[] kubernetesGroups) { if (kubernetesGroups == null) { return null; @@ -868,7 +903,7 @@ public class PojoConverter { return kubernetesGroupsBean; } - public static KubernetesGroup populateKubernetesGroupPojo(org.apache.stratos.common.kubernetes.KubernetesGroup kubernetesGroup) { + public static KubernetesGroup populateKubernetesGroupPojo(org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup kubernetesGroup) { if (kubernetesGroup == null) { return null; } @@ -882,7 +917,7 @@ public class PojoConverter { return kubernetesGroupBean; } - public static KubernetesMaster populateKubernetesMasterPojo(org.apache.stratos.common.kubernetes.KubernetesMaster kubernetesMaster) { + public static KubernetesMaster populateKubernetesMasterPojo(org.apache.stratos.autoscaler.stub.kubernetes.KubernetesMaster kubernetesMaster) { if (kubernetesMaster == null) { return null; } @@ -895,7 +930,7 @@ public class PojoConverter { return kubernetesMasterBean; } - public static List<KubernetesHost> populateKubernetesHostsPojo(org.apache.stratos.common.kubernetes.KubernetesHost[] kubernetesHosts) { + public static List<KubernetesHost> populateKubernetesHostsPojo(org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost[] kubernetesHosts) { if (kubernetesHosts == null) { return null; } @@ -906,7 +941,7 @@ public class PojoConverter { return kubernetesHostList; } - private static KubernetesHost populateKubernetesHostPojo(org.apache.stratos.common.kubernetes.KubernetesHost kubernetesHost) { + private static KubernetesHost populateKubernetesHostPojo(org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost kubernetesHost) { if (kubernetesHost == null) { return null; } @@ -918,7 +953,7 @@ public class PojoConverter { return kubernetesHostBean; } - private static List<PropertyBean> populateASProperties(Properties properties) { + private static List<PropertyBean> populateASProperties(org.apache.stratos.autoscaler.stub.Properties properties) { if (properties == null || properties.getProperties() == null) { return null; } @@ -929,7 +964,7 @@ public class PojoConverter { return propertyBeanList; } - private static PropertyBean populateASProperty(Property propertyE) { + private static PropertyBean populateASProperty(org.apache.stratos.autoscaler.stub.Property propertyE) { if (propertyE == null) { return null; } @@ -939,7 +974,7 @@ public class PojoConverter { return propertyBean; } - private static PortRange populatePortRangePojo(org.apache.stratos.common.kubernetes.PortRange portRange) { + private static PortRange populatePortRangePojo(org.apache.stratos.autoscaler.stub.kubernetes.PortRange portRange) { if (portRange == null) { return null; } @@ -1001,12 +1036,12 @@ public class PojoConverter { subscribableInfoContext.setRepoPassword(subscribableInfo.getRepoPassword()); subscribableInfoContext.setDependencyAliases(subscribableInfo.getDependencyAliases()); if (subscribableInfo.getProperty() != null) { - Properties properties = new Properties(); + org.apache.stratos.autoscaler.stub.Properties properties = new org.apache.stratos.autoscaler.stub.Properties(); for (org.apache.stratos.manager.composite.application.beans.PropertyBean propertyBean : subscribableInfo.getProperty()) { - Property property = new Property(); + org.apache.stratos.autoscaler.stub.Property property = new org.apache.stratos.autoscaler.stub.Property(); property.setName(propertyBean.getName()); property.setValue(propertyBean.getValue()); - properties.addProperty(property); + properties.addProperties(property); } subscribableInfoContext.setProperties(properties); } http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/service-stubs/org.apache.stratos.autoscaler.service.stub/pom.xml ---------------------------------------------------------------------- diff --git a/service-stubs/org.apache.stratos.autoscaler.service.stub/pom.xml b/service-stubs/org.apache.stratos.autoscaler.service.stub/pom.xml index 6a47629..562f498 100644 --- a/service-stubs/org.apache.stratos.autoscaler.service.stub/pom.xml +++ b/service-stubs/org.apache.stratos.autoscaler.service.stub/pom.xml @@ -50,7 +50,7 @@ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true"> <arg line="-uri src/main/resources/AutoScalerService.wsdl -u -uw -o target/generated-code -p org.apache.stratos.autoscaler.stub - -ns2p http://policy.exception.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.exception,http://application.exception.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.exception,http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.autoscale.policy,http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.deployment.policy,http://exception.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.exception,http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.deployment.partition,http://pojo.applications.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.pojo,http://pojo.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.pojo,http://kubernetes.exception.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.exception,http://api.aut oscaler.stratos.apache.org=org.apache.stratos.autoscaler.stub.api,http://common.stratos.apache.org/xsd=org.apache.stratos.common,http://kubernetes.common.stratos.apache.org/xsd=org.apache.stratos.common.kubernetes"/> + -ns2p http://policy.exception.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.exception,http://application.exception.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.exception,http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.autoscale.policy,http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.deployment.policy,http://exception.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.exception,http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.deployment.partition,http://pojo.applications.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.pojo,http://pojo.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.pojo,http://kubernetes.exception.autoscaler.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.exception,http://api.aut oscaler.stratos.apache.org=org.apache.stratos.autoscaler.stub.api,http://common.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub,http://kubernetes.common.stratos.apache.org/xsd=org.apache.stratos.autoscaler.stub.kubernetes"/> <classpath refid="maven.dependency.classpath"/> <classpath refid="maven.compile.classpath"/> <classpath refid="maven.runtime.classpath"/> http://git-wip-us.apache.org/repos/asf/stratos/blob/84102805/service-stubs/org.apache.stratos.cloud.controller.service.stub/pom.xml ---------------------------------------------------------------------- diff --git a/service-stubs/org.apache.stratos.cloud.controller.service.stub/pom.xml b/service-stubs/org.apache.stratos.cloud.controller.service.stub/pom.xml index f83d8fd..a750914 100644 --- a/service-stubs/org.apache.stratos.cloud.controller.service.stub/pom.xml +++ b/service-stubs/org.apache.stratos.cloud.controller.service.stub/pom.xml @@ -48,7 +48,7 @@ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true"> <arg line="-uri src/main/resources/CloudControllerService.wsdl -u -uw -o target/generated-code -p org.apache.stratos.cloud.controller.stub - -ns2p http://domain.controller.cloud.stratos.apache.org/xsd=org.apache.stratos.cloud.controller.stub.domain,http://exception.controller.cloud.stratos.apache.org/xsd=org.apache.stratos.cloud.controller.stub.exception,http://impl.services.controller.cloud.stratos.apache.org=org.apache.stratos.cloud.controller.stub.services.impl,http://common.stratos.apache.org/xsd=org.apache.stratos.common"/> + -ns2p http://domain.controller.cloud.stratos.apache.org/xsd=org.apache.stratos.cloud.controller.stub.domain,http://exception.controller.cloud.stratos.apache.org/xsd=org.apache.stratos.cloud.controller.stub.exception,http://impl.services.controller.cloud.stratos.apache.org=org.apache.stratos.cloud.controller.stub.services.impl,http://common.stratos.apache.org/xsd=org.apache.stratos.cloud.controller.stub"/> <classpath refid="maven.dependency.classpath"/> <classpath refid="maven.compile.classpath"/> <classpath refid="maven.runtime.classpath"/>
