You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2013/12/10 15:54:13 UTC

[14/16] git commit: refactoring autoscaler client according to auto-scaler service changes

refactoring autoscaler client according to auto-scaler service changes


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

Branch: refs/heads/master
Commit: fd5a62653352066d4d960505e047c577129f768e
Parents: 9ce8662
Author: Nirmal Fernando <ni...@apache.org>
Authored: Tue Dec 10 20:14:30 2013 +0530
Committer: Nirmal Fernando <ni...@apache.org>
Committed: Tue Dec 10 20:14:30 2013 +0530

----------------------------------------------------------------------
 .../adc/mgt/client/AutoscalerServiceClient.java | 22 ++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/fd5a6265/components/org.apache.stratos.adc.mgt/src/main/java/org/apache/stratos/adc/mgt/client/AutoscalerServiceClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/src/main/java/org/apache/stratos/adc/mgt/client/AutoscalerServiceClient.java b/components/org.apache.stratos.adc.mgt/src/main/java/org/apache/stratos/adc/mgt/client/AutoscalerServiceClient.java
index 02bd4d4..c53a2a0 100644
--- a/components/org.apache.stratos.adc.mgt/src/main/java/org/apache/stratos/adc/mgt/client/AutoscalerServiceClient.java
+++ b/components/org.apache.stratos.adc.mgt/src/main/java/org/apache/stratos/adc/mgt/client/AutoscalerServiceClient.java
@@ -25,6 +25,8 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.adc.mgt.exception.ADCException;
 import org.apache.stratos.adc.mgt.internal.DataHolder;
+import org.apache.stratos.autoscaler.deployment.policy.DeploymentPolicy;
+import org.apache.stratos.autoscaler.policy.model.AutoscalePolicy;
 import org.apache.stratos.autoscaler.stub.AutoScalerServiceNonExistingLBExceptionException;
 import org.apache.stratos.autoscaler.stub.AutoScalerServiceStub;
 import org.apache.stratos.cloud.controller.deployment.partition.Partition;
@@ -96,13 +98,29 @@ public class AutoscalerServiceClient {
         return partition;
     }
 
-    public org.apache.stratos.cloud.controller.deployment.partition.Partition [] getPartitions (String deploymentPolicyId,
+    public org.apache.stratos.cloud.controller.deployment.partition.Partition [] getPartitionsOfGroup (String deploymentPolicyId,
                                                                                             String partitionGroupId)
             throws Exception{
 
         org.apache.stratos.cloud.controller.deployment.partition.Partition[] partitions;
         try {
-            partitions = stub.getPartitionsOfDeploymentPolicy(deploymentPolicyId, partitionGroupId);
+            partitions = stub.getPartitionsOfGroup(deploymentPolicyId, partitionGroupId);
+
+        } catch (RemoteException e) {
+            String errorMsg = "Error in getting available partitions";
+            log.error(errorMsg, e);
+            throw new Exception(errorMsg, e);
+        }
+
+        return partitions;
+    }
+    
+    public org.apache.stratos.cloud.controller.deployment.partition.Partition[]
+        getPartitionsOfDeploymentPolicy(String deploymentPolicyId) throws Exception {
+
+        org.apache.stratos.cloud.controller.deployment.partition.Partition[] partitions;
+        try {
+            partitions = stub.getPartitionsOfDeploymentPolicy(deploymentPolicyId);
 
         } catch (RemoteException e) {
             String errorMsg = "Error in getting available partitions";