You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by re...@apache.org on 2014/12/10 07:31:47 UTC

[5/5] stratos git commit: fixing application deployment flow by adding deployment policy

fixing application deployment flow by adding deployment policy


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

Branch: refs/heads/4.1.0-test
Commit: 12e669a618013232aded4b73b63b958d17b141ef
Parents: ca5d6fe
Author: reka <rt...@gmail.com>
Authored: Wed Dec 10 12:01:29 2014 +0530
Committer: reka <rt...@gmail.com>
Committed: Wed Dec 10 12:01:29 2014 +0530

----------------------------------------------------------------------
 .../autoscaler/api/AutoScalerServiceImpl.java   |   19 +-
 .../src/main/resources/AutoScalerService.wsdl   | 1266 +++++++++++-------
 2 files changed, 828 insertions(+), 457 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/12e669a6/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/api/AutoScalerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/api/AutoScalerServiceImpl.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/api/AutoScalerServiceImpl.java
index dff6909..a2b371e 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/api/AutoScalerServiceImpl.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/api/AutoScalerServiceImpl.java
@@ -102,22 +102,21 @@ public class AutoScalerServiceImpl implements AutoScalerServiceInterface {
     
     @Override
     public boolean deployDeploymentPolicy(DeploymentPolicy policy) {
-    	// Get the deployment policy
-    	DeploymentPolicy deploymentPolicy = this.getDeploymentPolicy(policy.getApplicationId());
-    	if (deploymentPolicy == null) {
-    		return false;
-    	}
-    	
-    	//Need to start the application Monitor after validation of the deployment policies.
+        try {
+            String policyId = PolicyManager.getInstance().deployDeploymentPolicy(policy);
+        } catch (InvalidPolicyException e) {
+            log.error("Error while deploying the deployment policy " + policy.getApplicationId(), e);
+        }
+        //Need to start the application Monitor after validation of the deployment policies.
         //FIXME add validation
-        validateDeploymentPolicy(deploymentPolicy);
+        validateDeploymentPolicy(policy);
         //Check whether all the clusters are there
         ApplicationHolder.acquireReadLock();
         boolean allClusterInitialized = false;
-        String appId = deploymentPolicy.getApplicationId();
+        String appId = policy.getApplicationId();
         try {
             Application application = ApplicationHolder.getApplications().
-                    getApplication(deploymentPolicy.getApplicationId());
+                    getApplication(policy.getApplicationId());
             if (application != null) {
 
                 allClusterInitialized = AutoscalerUtil.allClustersInitialized(application);