Repository: stratos Updated Branches: refs/heads/docker-grouping-merge 2a6606f7f -> f55d5447e
Removing not implemented exceptions Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/c8dc8cc8 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/c8dc8cc8 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/c8dc8cc8 Branch: refs/heads/docker-grouping-merge Commit: c8dc8cc8cc9297c26867a0c05a6a0c7a0e9833ae Parents: 77d1a7c Author: Imesh Gunaratne <[email protected]> Authored: Tue Nov 4 16:58:06 2014 +0530 Committer: Imesh Gunaratne <[email protected]> Committed: Tue Nov 4 16:58:06 2014 +0530 ---------------------------------------------------------------------- .../manager/client/AutoscalerServiceClient.java | 6 +-- .../bean/util/converter/PojoConverter.java | 40 ++++++++++---------- .../rest/endpoint/services/ServiceUtils.java | 20 +++++----- 3 files changed, 30 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/c8dc8cc8/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 8572494..2e87cbf 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 @@ -300,10 +300,6 @@ public class AutoscalerServiceClient { } public void updateClusterMonitor(String clusterId, Properties properties) throws RemoteException, AutoScalerServiceInvalidArgumentExceptionException { - //TODO: To be fixed - throw new NotImplementedException(); - //stub.updateClusterMonitor(clusterId, properties); + stub.updateClusterMonitor(clusterId, properties); } - - } http://git-wip-us.apache.org/repos/asf/stratos/blob/c8dc8cc8/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 9ae6fcb..a1fa9c6 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 @@ -242,27 +242,25 @@ public class PojoConverter { public static PropertiesE getASProperties(List<PropertyBean> propertyBeans) { - //TODO: To be fixed - throw new NotImplementedException(); -// if (propertyBeans == null || propertyBeans.isEmpty()) { -// return null; -// } -// -// //convert to an array -// PropertyBean[] propertyBeansArray = new PropertyBean[propertyBeans.size()]; -// propertyBeans.toArray(propertyBeansArray); -// PropertyE[] propertyArray = new PropertyE[propertyBeansArray.length]; -// -// for (int j = 0; j < propertyBeansArray.length; j++) { -// PropertyE property = new PropertyE(); -// property.setName(propertyBeansArray[j].name); -// property.setValue(propertyBeansArray[j].value); -// propertyArray[j] = property; -// } -// -// PropertiesE properties = new PropertiesE(); -// properties.setProperties(propertyArray); -// return properties; + if (propertyBeans == null || propertyBeans.isEmpty()) { + return null; + } + + //convert to an array + PropertyBean[] propertyBeansArray = new PropertyBean[propertyBeans.size()]; + propertyBeans.toArray(propertyBeansArray); + PropertyE[] propertyArray = new PropertyE[propertyBeansArray.length]; + + for (int j = 0; j < propertyBeansArray.length; j++) { + PropertyE property = new PropertyE(); + property.setName(propertyBeansArray[j].name); + property.setValue(propertyBeansArray[j].value); + propertyArray[j] = property; + } + + PropertiesE properties = new PropertiesE(); + properties.setProperties(propertyArray); + return properties; } private static NetworkInterfaces getNetworkInterfaces(List<NetworkInterfaceBean> networkInterfaceBeans) { http://git-wip-us.apache.org/repos/asf/stratos/blob/c8dc8cc8/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java index 0a373cf..4c75e6b 100644 --- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java +++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java @@ -26,6 +26,8 @@ import org.apache.commons.logging.LogFactory; import org.apache.stratos.autoscaler.applications.pojo.xsd.ApplicationContext; import org.apache.stratos.autoscaler.stub.*; import org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy; +import org.apache.stratos.autoscaler.stub.pojo.PropertiesE; +import org.apache.stratos.autoscaler.stub.pojo.PropertyE; import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidCartridgeTypeExceptionException; import org.apache.stratos.autoscaler.stub.AutoScalerServiceApplicationDefinitionExceptionException; import org.apache.stratos.autoscaler.stub.AutoScalerServiceInvalidPartitionExceptionException; @@ -144,16 +146,14 @@ public class ServiceUtils { applicationContext.setTeantAdminUsername(userName); if(appDefinition.getProperty() != null) { - //TODO: To be fixed - throw new NotImplementedException(); -// PropertiesE properties = new PropertiesE(); -// for (org.apache.stratos.manager.composite.application.beans.PropertyBean propertyBean : appDefinition.getProperty()) { -// PropertyE property = new PropertyE(); -// property.setName(propertyBean.getName()); -// property.setValue(propertyBean.getValue()); -// properties.addProperties(property); -// } -// applicationContext.setProperties(properties); + PropertiesE properties = new PropertiesE(); + for (org.apache.stratos.manager.composite.application.beans.PropertyBean propertyBean : appDefinition.getProperty()) { + PropertyE property = new PropertyE(); + property.setName(propertyBean.getName()); + property.setValue(propertyBean.getValue()); + properties.addProperties(property); + } + applicationContext.setProperties(properties); } try {
