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/01 17:51:41 UTC

[1/3] stratos git commit: fixing cartridge deployment issues and global deployment policy deployment issues

Repository: stratos
Updated Branches:
  refs/heads/master 600dceb8d -> 2c07846c3


http://git-wip-us.apache.org/repos/asf/stratos/blob/2c07846c/service-stubs/org.apache.stratos.autoscaler.service.stub/src/main/resources/AutoScalerService.wsdl
----------------------------------------------------------------------
diff --git a/service-stubs/org.apache.stratos.autoscaler.service.stub/src/main/resources/AutoScalerService.wsdl b/service-stubs/org.apache.stratos.autoscaler.service.stub/src/main/resources/AutoScalerService.wsdl
index c4c056a..201acbd 100644
--- a/service-stubs/org.apache.stratos.autoscaler.service.stub/src/main/resources/AutoScalerService.wsdl
+++ b/service-stubs/org.apache.stratos.autoscaler.service.stub/src/main/resources/AutoScalerService.wsdl
@@ -1,662 +1,663 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax29="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax27="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ns="http://api.autoscaler.stratos.apache.org" xmlns:ax23="http://kubernetes.common.stratos.apache.org/xsd" xmlns:ax24="http://common.stratos.apache.org/xsd" xmlns:ax217="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax21="http://kubernetes.exception.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax219="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax214="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax221="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax210="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:http="http://schemas.xmlsoa
 p.org/wsdl/http/" xmlns:ax224="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://api.autoscaler.stratos.apache.org">
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax29="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ns="http://api.autoscaler.stratos.apache.org" xmlns:ax25="http://kubernetes.common.stratos.apache.org/xsd" xmlns:ax26="http://common.stratos.apache.org/xsd" xmlns:ax23="http://kubernetes.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax216="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax219="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax221="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax212="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax223="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax211="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:http="http://schemas.xmlso
 ap.org/wsdl/http/" xmlns:ax226="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://api.autoscaler.stratos.apache.org">
+    <wsdl:documentation>AutoScalerService</wsdl:documentation>
     <wsdl:types>
         <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd">
             <xs:complexType name="AutoscalePolicy">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="displayName" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="instanceRoundingFactor" type="xs:float"/>
-                    <xs:element minOccurs="0" name="isPublic" type="xs:boolean"/>
-                    <xs:element minOccurs="0" name="loadThresholds" nillable="true" type="ax217:LoadThresholds"/>
-                    <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+                    <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="displayName" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="instanceRoundingFactor" type="xs:float"></xs:element>
+                    <xs:element minOccurs="0" name="isPublic" type="xs:boolean"></xs:element>
+                    <xs:element minOccurs="0" name="loadThresholds" nillable="true" type="ax219:LoadThresholds"></xs:element>
+                    <xs:element minOccurs="0" name="tenantId" type="xs:int"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="LoadThresholds">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="loadAverage" nillable="true" type="ax217:LoadAverageThresholds"/>
-                    <xs:element minOccurs="0" name="memoryConsumption" nillable="true" type="ax217:MemoryConsumptionThresholds"/>
-                    <xs:element minOccurs="0" name="requestsInFlight" nillable="true" type="ax217:RequestsInFlightThresholds"/>
+                    <xs:element minOccurs="0" name="loadAverage" nillable="true" type="ax219:LoadAverageThresholds"></xs:element>
+                    <xs:element minOccurs="0" name="memoryConsumption" nillable="true" type="ax219:MemoryConsumptionThresholds"></xs:element>
+                    <xs:element minOccurs="0" name="requestsInFlight" nillable="true" type="ax219:RequestsInFlightThresholds"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="LoadAverageThresholds">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="lowerLimit" type="xs:float"/>
-                    <xs:element minOccurs="0" name="upperLimit" type="xs:float"/>
+                    <xs:element minOccurs="0" name="lowerLimit" type="xs:float"></xs:element>
+                    <xs:element minOccurs="0" name="upperLimit" type="xs:float"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="MemoryConsumptionThresholds">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="lowerLimit" type="xs:float"/>
-                    <xs:element minOccurs="0" name="upperLimit" type="xs:float"/>
+                    <xs:element minOccurs="0" name="lowerLimit" type="xs:float"></xs:element>
+                    <xs:element minOccurs="0" name="upperLimit" type="xs:float"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="RequestsInFlightThresholds">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="lowerLimit" type="xs:float"/>
-                    <xs:element minOccurs="0" name="upperLimit" type="xs:float"/>
+                    <xs:element minOccurs="0" name="lowerLimit" type="xs:float"></xs:element>
+                    <xs:element minOccurs="0" name="upperLimit" type="xs:float"></xs:element>
                 </xs:sequence>
             </xs:complexType>
         </xs:schema>
-        <xs:schema xmlns:ax225="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://pojo.applications.autoscaler.stratos.apache.org/xsd">
-            <xs:import namespace="http://common.stratos.apache.org/xsd"/>
+        <xs:schema xmlns:ax227="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://pojo.applications.autoscaler.stratos.apache.org/xsd">
+            <xs:import namespace="http://common.stratos.apache.org/xsd"></xs:import>
             <xs:complexType name="ApplicationContext">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="components" nillable="true" type="ax224:ComponentContext"/>
-                    <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="properties" nillable="true" type="ax24:Properties"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="subscribableInfoContext" nillable="true" type="ax224:SubscribableInfoContext"/>
-                    <xs:element minOccurs="0" name="teantAdminUsername" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="tenantDomain" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+                    <xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="components" nillable="true" type="ax226:ComponentContext"></xs:element>
+                    <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="properties" nillable="true" type="ax26:Properties"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="subscribableInfoContext" nillable="true" type="ax226:SubscribableInfoContext"></xs:element>
+                    <xs:element minOccurs="0" name="teantAdminUsername" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="tenantDomain" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="tenantId" type="xs:int"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="ComponentContext">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="dependencyContext" nillable="true" type="ax224:DependencyContext"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="groupContexts" nillable="true" type="ax224:GroupContext"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="subscribableContexts" nillable="true" type="ax224:SubscribableContext"/>
+                    <xs:element minOccurs="0" name="dependencyContext" nillable="true" type="ax226:DependencyContext"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="groupContexts" nillable="true" type="ax226:GroupContext"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="subscribableContexts" nillable="true" type="ax226:SubscribableContext"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="DependencyContext">
                 <xs:sequence>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="startupOrdersContexts" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="terminationBehaviour" nillable="true" type="xs:string"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="startupOrdersContexts" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="terminationBehaviour" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="GroupContext">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="autoscalingPolicy" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="xs:string"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="groupContexts" nillable="true" type="ax224:GroupContext"/>
-                    <xs:element minOccurs="0" name="groupInstanceMonitoringEnabled" type="xs:boolean"/>
-                    <xs:element minOccurs="0" name="groupMaxInstances" type="xs:int"/>
-                    <xs:element minOccurs="0" name="groupMinInstances" type="xs:int"/>
-                    <xs:element minOccurs="0" name="groupScalingEnabled" type="xs:boolean"/>
-                    <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="subscribableContexts" nillable="true" type="ax224:SubscribableContext"/>
+                    <xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="autoscalingPolicy" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="xs:string"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="groupContexts" nillable="true" type="ax226:GroupContext"></xs:element>
+                    <xs:element minOccurs="0" name="groupInstanceMonitoringEnabled" type="xs:boolean"></xs:element>
+                    <xs:element minOccurs="0" name="groupMaxInstances" type="xs:int"></xs:element>
+                    <xs:element minOccurs="0" name="groupMinInstances" type="xs:int"></xs:element>
+                    <xs:element minOccurs="0" name="groupScalingEnabled" type="xs:boolean"></xs:element>
+                    <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="subscribableContexts" nillable="true" type="ax226:SubscribableContext"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="SubscribableContext">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="type" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="type" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="SubscribableInfoContext">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="autoscalingPolicy" nillable="true" type="xs:string"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="dependencyAliases" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="maxMembers" type="xs:int"/>
-                    <xs:element minOccurs="0" name="minMembers" type="xs:int"/>
-                    <xs:element minOccurs="0" name="privateRepo" type="xs:boolean"/>
-                    <xs:element minOccurs="0" name="properties" nillable="true" type="ax24:Properties"/>
-                    <xs:element minOccurs="0" name="repoPassword" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="repoUrl" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="repoUsername" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="alias" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="autoscalingPolicy" nillable="true" type="xs:string"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="dependencyAliases" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="maxMembers" type="xs:int"></xs:element>
+                    <xs:element minOccurs="0" name="minMembers" type="xs:int"></xs:element>
+                    <xs:element minOccurs="0" name="privateRepo" type="xs:boolean"></xs:element>
+                    <xs:element minOccurs="0" name="properties" nillable="true" type="ax26:Properties"></xs:element>
+                    <xs:element minOccurs="0" name="repoPassword" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="repoUrl" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="repoUsername" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
         </xs:schema>
         <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://pojo.autoscaler.stratos.apache.org/xsd">
             <xs:complexType name="ServiceGroup">
                 <xs:sequence>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="cartridges" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="dependencies" nillable="true" type="ax221:Dependencies"/>
-                    <xs:element minOccurs="0" name="groupscalingEnabled" type="xs:boolean"/>
-                    <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="subGroups" nillable="true" type="xs:string"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="cartridges" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="dependencies" nillable="true" type="ax223:Dependencies"></xs:element>
+                    <xs:element minOccurs="0" name="groupscalingEnabled" type="xs:boolean"></xs:element>
+                    <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="subGroups" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="Dependencies">
                 <xs:sequence>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="scalingOrders" nillable="true" type="xs:string"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="startupOrders" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="terminationBehaviour" nillable="true" type="xs:string"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="scalingOrders" nillable="true" type="xs:string"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="startupOrders" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="terminationBehaviour" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
         </xs:schema>
-        <xs:schema xmlns:ax212="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd">
-            <xs:import namespace="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
+        <xs:schema xmlns:ax214="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd">
+            <xs:import namespace="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"></xs:import>
             <xs:complexType name="DeploymentPolicy">
                 <xs:sequence>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="allPartitions" nillable="true" type="ax212:Partition"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="applicationLevelNetworkPartitions" nillable="true" type="ax212:ApplicationLevelNetworkPartition"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="childLevelNetworkPartitions" nillable="true" type="ax212:ChildLevelNetworkPartition"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="childPolicies" nillable="true" type="ax29:ChildPolicy"/>
-                    <xs:element minOccurs="0" name="childPolicyHolder" nillable="true" type="ax212:ChildPolicyHolder"/>
-                    <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="isPublic" type="xs:boolean"/>
-                    <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="allPartitions" nillable="true" type="ax214:Partition"></xs:element>
+                    <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="applicationLevelNetworkPartitions" nillable="true" type="ax214:ApplicationLevelNetworkPartition"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="childLevelNetworkPartitions" nillable="true" type="ax214:ChildLevelNetworkPartition"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="childPolicies" nillable="true" type="ax211:ChildPolicy"></xs:element>
+                    <xs:element minOccurs="0" name="childPolicyHolder" nillable="true" type="ax214:ChildPolicyHolder"></xs:element>
+                    <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="isPublic" type="xs:boolean"></xs:element>
+                    <xs:element minOccurs="0" name="tenantId" type="xs:int"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="ChildPolicy">
                 <xs:sequence>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="childLevelNetworkPartitions" nillable="true" type="ax212:ChildLevelNetworkPartition"/>
-                    <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="childLevelNetworkPartitions" nillable="true" type="ax214:ChildLevelNetworkPartition"></xs:element>
+                    <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
         </xs:schema>
         <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://application.exception.autoscaler.stratos.apache.org/xsd">
             <xs:complexType name="ApplicationDefinitionException">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
         </xs:schema>
-        <xs:schema xmlns:ax211="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd">
-            <xs:import namespace="http://common.stratos.apache.org/xsd"/>
+        <xs:schema xmlns:ax213="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd">
+            <xs:import namespace="http://common.stratos.apache.org/xsd"></xs:import>
             <xs:complexType name="Partition">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="isPublic" type="xs:boolean"/>
-                    <xs:element minOccurs="0" name="properties" nillable="true" type="ax24:Properties"/>
-                    <xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="isPublic" type="xs:boolean"></xs:element>
+                    <xs:element minOccurs="0" name="properties" nillable="true" type="ax26:Properties"></xs:element>
+                    <xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="ApplicationLevelNetworkPartition">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="activeByDefault" type="xs:boolean"/>
-                    <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="partitions" nillable="true" type="ax210:Partition"/>
+                    <xs:element minOccurs="0" name="activeByDefault" type="xs:boolean"></xs:element>
+                    <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="partitions" nillable="true" type="ax212:Partition"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="ChildLevelNetworkPartition">
                 <xs:sequence>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="childLevelPartitions" nillable="true" type="ax210:ChildLevelPartition"/>
-                    <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="min" type="xs:int"/>
-                    <xs:element minOccurs="0" name="partitionAlgo" nillable="true" type="xs:string"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="childLevelPartitions" nillable="true" type="ax212:ChildLevelPartition"></xs:element>
+                    <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="min" type="xs:int"></xs:element>
+                    <xs:element minOccurs="0" name="partitionAlgo" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="ChildLevelPartition">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="max" type="xs:int"/>
-                    <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="partitionId" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="max" type="xs:int"></xs:element>
+                    <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="partitionId" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="ChildPolicyHolder">
                 <xs:sequence>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="childLevelNetworkPartitions" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="deploymentPolicyId" nillable="true" type="xs:string"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="childLevelNetworkPartitions" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="deploymentPolicyId" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
         </xs:schema>
         <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://common.stratos.apache.org/xsd">
             <xs:complexType name="Properties">
                 <xs:sequence>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax24:Property"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax26:Property"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="Property">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="value" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="value" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
         </xs:schema>
-        <xs:schema xmlns:ax28="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax26="http://kubernetes.common.stratos.apache.org/xsd" xmlns:ax22="http://kubernetes.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax216="http://common.stratos.apache.org/xsd" xmlns:ax218="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax220="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax222="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax223="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax226="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ax215="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax213="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://api.autoscaler.stratos.apache.org">
-            <xs:import namespace="http://kubernetes.exception.autoscaler.stratos.apache.org/xsd"/>
-            <xs:import namespace="http://kubernetes.common.stratos.apache.org/xsd"/>
-            <xs:import namespace="http://policy.exception.autoscaler.stratos.apache.org/xsd"/>
-            <xs:import namespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
-            <xs:import namespace="http://exception.autoscaler.stratos.apache.org/xsd"/>
-            <xs:import namespace="http://common.stratos.apache.org/xsd"/>
-            <xs:import namespace="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
-            <xs:import namespace="http://application.exception.autoscaler.stratos.apache.org/xsd"/>
-            <xs:import namespace="http://pojo.autoscaler.stratos.apache.org/xsd"/>
-            <xs:import namespace="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"/>
-            <xs:import namespace="http://pojo.applications.autoscaler.stratos.apache.org/xsd"/>
+        <xs:schema xmlns:ax215="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax220="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax28="http://kubernetes.common.stratos.apache.org/xsd" xmlns:ax222="http://application.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax210="http://policy.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax224="http://pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax225="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd" xmlns:ax24="http://kubernetes.exception.autoscaler.stratos.apache.org/xsd" xmlns:ax217="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax228="http://pojo.applications.autoscaler.stratos.apache.org/xsd" xmlns:ax218="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://api.autoscaler.stratos.apache.org">
+            <xs:import namespace="http://kubernetes.exception.autoscaler.stratos.apache.org/xsd"></xs:import>
+            <xs:import namespace="http://kubernetes.common.stratos.apache.org/xsd"></xs:import>
+            <xs:import namespace="http://policy.exception.autoscaler.stratos.apache.org/xsd"></xs:import>
+            <xs:import namespace="http://deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"></xs:import>
+            <xs:import namespace="http://exception.autoscaler.stratos.apache.org/xsd"></xs:import>
+            <xs:import namespace="http://common.stratos.apache.org/xsd"></xs:import>
+            <xs:import namespace="http://autoscale.policy.pojo.autoscaler.stratos.apache.org/xsd"></xs:import>
+            <xs:import namespace="http://application.exception.autoscaler.stratos.apache.org/xsd"></xs:import>
+            <xs:import namespace="http://pojo.autoscaler.stratos.apache.org/xsd"></xs:import>
+            <xs:import namespace="http://network.partition.deployment.policy.pojo.autoscaler.stratos.apache.org/xsd"></xs:import>
+            <xs:import namespace="http://pojo.applications.autoscaler.stratos.apache.org/xsd"></xs:import>
             <xs:element name="AutoScalerServiceInvalidKubernetesMasterException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="InvalidKubernetesMasterException" nillable="true" type="ax21:InvalidKubernetesMasterException"/>
+                        <xs:element minOccurs="0" name="InvalidKubernetesMasterException" nillable="true" type="ax23:InvalidKubernetesMasterException"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="AutoScalerServiceNonExistingKubernetesMasterException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="NonExistingKubernetesMasterException" nillable="true" type="ax21:NonExistingKubernetesMasterException"/>
+                        <xs:element minOccurs="0" name="NonExistingKubernetesMasterException" nillable="true" type="ax23:NonExistingKubernetesMasterException"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="updateKubernetesMaster">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax26:KubernetesMaster"/>
+                        <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax28:KubernetesMaster"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="updateKubernetesMasterResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="AutoScalerServiceInvalidKubernetesHostException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="InvalidKubernetesHostException" nillable="true" type="ax21:InvalidKubernetesHostException"/>
+                        <xs:element minOccurs="0" name="InvalidKubernetesHostException" nillable="true" type="ax23:InvalidKubernetesHostException"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="AutoScalerServiceNonExistingKubernetesHostException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="NonExistingKubernetesHostException" nillable="true" type="ax21:NonExistingKubernetesHostException"/>
+                        <xs:element minOccurs="0" name="NonExistingKubernetesHostException" nillable="true" type="ax23:NonExistingKubernetesHostException"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="updateKubernetesHost">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax26:KubernetesHost"/>
+                        <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax28:KubernetesHost"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="updateKubernetesHostResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="AutoScalerServiceInvalidPolicyException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="InvalidPolicyException" nillable="true" type="ax27:InvalidPolicyException"/>
+                        <xs:element minOccurs="0" name="InvalidPolicyException" nillable="true" type="ax29:InvalidPolicyException"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="updateDeploymentPolicy">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="ax29:DeploymentPolicy"/>
+                        <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="ax215:DeploymentPolicy"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="updateDeploymentPolicyResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="AutoScalerServiceInvalidArgumentException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="InvalidArgumentException" nillable="true" type="ax214:InvalidArgumentException"/>
+                        <xs:element minOccurs="0" name="InvalidArgumentException" nillable="true" type="ax217:InvalidArgumentException"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="updateClusterMonitor">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
-                        <xs:element minOccurs="0" name="properties" nillable="true" type="ax24:Properties"/>
+                        <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"></xs:element>
+                        <xs:element minOccurs="0" name="properties" nillable="true" type="ax26:Properties"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="updateAutoScalingPolicy">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="autoscalePolicy" nillable="true" type="ax217:AutoscalePolicy"/>
+                        <xs:element minOccurs="0" name="autoscalePolicy" nillable="true" type="ax219:AutoscalePolicy"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="updateAutoScalingPolicyResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="AutoScalerServiceAutoScalerException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="AutoScalerException" nillable="true" type="ax214:AutoScalerException"/>
+                        <xs:element minOccurs="0" name="AutoScalerException" nillable="true" type="ax217:AutoScalerException"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="undeployServiceGroup">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="AutoScalerServiceApplicationDefinitionException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="ApplicationDefinitionException" nillable="true" type="ax219:ApplicationDefinitionException"/>
+                        <xs:element minOccurs="0" name="ApplicationDefinitionException" nillable="true" type="ax221:ApplicationDefinitionException"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="unDeployApplicationDefinition">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"/>
-                        <xs:element minOccurs="0" name="tenantId" type="xs:int"/>
-                        <xs:element minOccurs="0" name="tenantDomain" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="applicationId" nillable="true" type="xs:string"></xs:element>
+                        <xs:element minOccurs="0" name="tenantId" type="xs:int"></xs:element>
+                        <xs:element minOccurs="0" name="tenantDomain" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="serviceGroupExist">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="serviceName" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="serviceName" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="serviceGroupExistResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="removeKubernetesHost">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="hostId" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="hostId" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="removeKubernetesHostResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="AutoScalerServiceNonExistingKubernetesGroupException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="NonExistingKubernetesGroupException" nillable="true" type="ax21:NonExistingKubernetesGroupException"/>
+                        <xs:element minOccurs="0" name="NonExistingKubernetesGroupException" nillable="true" type="ax23:NonExistingKubernetesGroupException"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="removeKubernetesGroup">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="groupId" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="groupId" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="removeKubernetesGroupResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getValidDeploymentPoliciesforCartridge">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getValidDeploymentPoliciesforCartridgeResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:DeploymentPolicy"/>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getServiceGroups">
                 <xs:complexType>
-                    <xs:sequence/>
+                    <xs:sequence></xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getServiceGroupsResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax221:ServiceGroup"/>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax223:ServiceGroup"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getServiceGroup">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getServiceGroupResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="ax221:ServiceGroup"/>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax223:ServiceGroup"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getPartitionsOfGroup">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="deploymentPolicyId" nillable="true" type="xs:string"/>
-                        <xs:element minOccurs="0" name="groupId" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="deploymentPolicyId" nillable="true" type="xs:string"></xs:element>
+                        <xs:element minOccurs="0" name="groupId" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getPartitionsOfGroupResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax223:Partition"/>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax225:Partition"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getNetworkPartitions">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="deploymentPolicyId" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="deploymentPolicyId" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getNetworkPartitionsResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax223:ApplicationLevelNetworkPartition"/>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax225:ApplicationLevelNetworkPartition"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getMasterForKubernetesGroup">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="kubernetesGroupId" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="kubernetesGroupId" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getMasterForKubernetesGroupResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="ax26:KubernetesMaster"/>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax28:KubernetesMaster"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getKubernetesGroup">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="kubernetesGroupId" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="kubernetesGroupId" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getKubernetesGroupResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="ax26:KubernetesGroup"/>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax28:KubernetesGroup"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getHostsForKubernetesGroup">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="kubernetesGroupId" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="kubernetesGroupId" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getHostsForKubernetesGroupResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:KubernetesHost"/>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax28:KubernetesHost"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getDeploymentPolicy">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="deploymentPolicyId" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="deploymentPolicyId" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getDeploymentPolicyResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="ax29:DeploymentPolicy"/>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getAutoscalingPolicy">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="autoscalingPolicyId" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="autoscalingPolicyId" nillable="true" type="xs:string"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getAutoscalingPolicyResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="ax217:AutoscalePolicy"/>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax219:AutoscalePolicy"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getAllKubernetesGroups">
                 <xs:complexType>
-                    <xs:sequence/>
+                    <xs:sequence></xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getAllKubernetesGroupsResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:KubernetesGroup"/>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax28:KubernetesGroup"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getAllDeploymentPolicies">
                 <xs:complexType>
-                    <xs:sequence/>
+                    <xs:sequence></xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getAllDeploymentPoliciesResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax29:DeploymentPolicy"/>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax215:DeploymentPolicy"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getAllAutoScalingPolicy">
                 <xs:complexType>
-                    <xs:sequence/>
+                    <xs:sequence></xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="getAllAutoScalingPolicyResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax217:AutoscalePolicy"/>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax219:AutoscalePolicy"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="AutoScalerServiceInvalidServiceGroupException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax21:InvalidServiceGroupException"/>
+                        <xs:element minOccurs="0" name="InvalidServiceGroupException" nillable="true" type="ax23:InvalidServiceGroupException"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="deployServiceGroup">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax221:ServiceGroup"/>
+                        <xs:element minOccurs="0" name="servicegroup" nillable="true" type="ax223:ServiceGroup"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="deployApplicationDefinition">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax224:ApplicationContext"/>
+                        <xs:element minOccurs="0" name="applicationContext" nillable="true" type="ax226:ApplicationContext"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="addKubernetesHost">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="groupId" nillable="true" type="xs:string"/>
-                        <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax26:KubernetesHost"/>
+                        <xs:element minOccurs="0" name="groupId" nillable="true" type="xs:string"></xs:element>
+                        <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax28:KubernetesHost"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="addKubernetesHostResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="AutoScalerServiceInvalidKubernetesGroupException">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="InvalidKubernetesGroupException" nillable="true" type="ax21:InvalidKubernetesGroupException"/>
+                        <xs:element minOccurs="0" name="InvalidKubernetesGroupException" nillable="true" type="ax23:InvalidKubernetesGroupException"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="addKubernetesGroup">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="kubernetesGroup" nillable="true" type="ax26:KubernetesGroup"/>
+                        <xs:element minOccurs="0" name="kubernetesGroup" nillable="true" type="ax28:KubernetesGroup"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="addKubernetesGroupResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="addDeploymentPolicy">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="ax29:DeploymentPolicy"/>
+                        <xs:element minOccurs="0" name="deploymentPolicy" nillable="true" type="ax215:DeploymentPolicy"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="addDeploymentPolicyResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="addAutoScalingPolicy">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="autoscalePolicy" nillable="true" type="ax217:AutoscalePolicy"/>
+                        <xs:element minOccurs="0" name="autoscalePolicy" nillable="true" type="ax219:AutoscalePolicy"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
             <xs:element name="addAutoScalingPolicyResponse">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+                        <xs:element minOccurs="0" name="return" type="xs:boolean"></xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -664,1313 +665,1388 @@
         <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://kubernetes.exception.autoscaler.stratos.apache.org/xsd">
             <xs:complexType name="InvalidKubernetesMasterException">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="NonExistingKubernetesMasterException">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="InvalidKubernetesHostException">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="NonExistingKubernetesHostException">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="NonExistingKubernetesGroupException">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="InvalidServiceGroupException">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="InvalidKubernetesGroupException">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
         </xs:schema>
-        <xs:schema xmlns:ax25="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://kubernetes.common.stratos.apache.org/xsd">
-            <xs:import namespace="http://common.stratos.apache.org/xsd"/>
+        <xs:schema xmlns:ax27="http://common.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://kubernetes.common.stratos.apache.org/xsd">
+            <xs:import namespace="http://common.stratos.apache.org/xsd"></xs:import>
             <xs:complexType name="KubernetesHost">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="hostId" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="hostIpAddress" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="hostname" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
+                    <xs:element minOccurs="0" name="hostId" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="hostIpAddress" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="hostname" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="properties" nillable="true" type="ax27:Properties"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="KubernetesMaster">
                 <xs:complexContent>
-                    <xs:extension base="ax23:KubernetesHost">
+                    <xs:extension base="ax25:KubernetesHost">
                         <xs:sequence>
-                            <xs:element minOccurs="0" name="endpoint" nillable="true" type="xs:string"/>
+                            <xs:element minOccurs="0" name="endpoint" nillable="true" type="xs:string"></xs:element>
                         </xs:sequence>
                     </xs:extension>
                 </xs:complexContent>
             </xs:complexType>
             <xs:complexType name="KubernetesGroup">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
-                    <xs:element minOccurs="0" name="groupId" nillable="true" type="xs:string"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="kubernetesHosts" nillable="true" type="ax23:KubernetesHost"/>
-                    <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax23:KubernetesMaster"/>
-                    <xs:element minOccurs="0" name="portRange" nillable="true" type="ax23:PortRange"/>
-                    <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
+                    <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"></xs:element>
+                    <xs:element minOccurs="0" name="groupId" nillable="true" type="xs:string"></xs:element>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="kubernetesHosts" nillable="true" type="ax25:KubernetesHost"></xs:element>
+                    <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax25:KubernetesMaster"></xs:element>
+                    <xs:element minOccurs="0" name="portRange" nillable="true" type="ax25:PortRange"></xs:element>
+                    <xs:element minOccurs="0" name="properties" nillable="true" type="ax27:Properties"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="PortRange">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="lower" type="xs:int"/>
-                    <xs:element minOccurs="0" name="upper" type="xs:int"/>
+                    <xs:element minOccurs="0" name="lower" type="xs:int"></xs:element>
+                    <xs:element minOccurs="0" name="upper" type="xs:int"></xs:element>
                 </xs:sequence>
             </xs:complexType>
         </xs:schema>
         <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://policy.exception.autoscaler.stratos.apache.org/xsd">
             <xs:complexType name="InvalidPolicyException">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
         </xs:schema>
         <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://exception.autoscaler.stratos.apache.org/xsd">
             <xs:complexType name="InvalidArgumentException">
                 <xs:sequence>
-                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"></xs:element>
                 </xs:sequence>
             </xs:complexType>
             <xs:complexType name="AutoScalerException">
                 <xs:complexContent>
                     <xs:extension base="xs:RuntimeException">
-                        <xs:sequence/>
+                        <xs:sequence></xs:sequence>
                     </xs:extension>
                 </xs:complexContent>
             </xs:complexType>
         </xs:schema>
     </wsdl:types>
-    <wsdl:message name="addKubernetesGroupRequest">
-        <wsdl:part name="parameters" element="ns:addKubernetesGroup"/>
-    </wsdl:message>
-    <wsdl:message name="addKubernetesGroupResponse">
-        <wsdl:part name="parameters" element="ns:addKubernetesGroupResponse"/>
-    </wsdl:message>
-    <wsdl:message name="AutoScalerServiceInvalidKubernetesGroupException">
-        <wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidKubernetesGroupException"/>
-    </wsdl:message>
     <wsdl:message name="updateKubernetesMasterRequest">
-        <wsdl:part name="parameters" element="ns:updateKubernetesMaster"/>
+        <wsdl:part name="parameters" element="ns:updateKubernetesMaster"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="updateKubernetesMasterResponse">
-        <wsdl:part name="parameters" element="ns:updateKubernetesMasterResponse"/>
+        <wsdl:part name="parameters" element="ns:updateKubernetesMasterResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="AutoScalerServiceInvalidKubernetesMasterException">
-        <wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidKubernetesMasterException"/>
+        <wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidKubernetesMasterException"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="AutoScalerServiceNonExistingKubernetesMasterException">
-        <wsdl:part name="parameters" element="ns:AutoScalerServiceNonExistingKubernetesMasterException"/>
+        <wsdl:part name="parameters" element="ns:AutoScalerServiceNonExistingKubernetesMasterException"></wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="addKubernetesGroupRequest">
+        <wsdl:part name="parameters" element="ns:addKubernetesGroup"></wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="addKubernetesGroupResponse">
+        <wsdl:part name="parameters" element="ns:addKubernetesGroupResponse"></wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="AutoScalerServiceInvalidKubernetesGroupException">
+        <wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidKubernetesGroupException"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getServiceGroupsRequest">
-        <wsdl:part name="parameters" element="ns:getServiceGroups"/>
+        <wsdl:part name="parameters" element="ns:getServiceGroups"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getServiceGroupsResponse">
-        <wsdl:part name="parameters" element="ns:getServiceGroupsResponse"/>
+        <wsdl:part name="parameters" element="ns:getServiceGroupsResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="AutoScalerServiceAutoScalerException">
-        <wsdl:part name="parameters" element="ns:AutoScalerServiceAutoScalerException"/>
+        <wsdl:part name="parameters" element="ns:AutoScalerServiceAutoScalerException"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getPartitionsOfGroupRequest">
-        <wsdl:part name="parameters" element="ns:getPartitionsOfGroup"/>
+        <wsdl:part name="parameters" element="ns:getPartitionsOfGroup"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getPartitionsOfGroupResponse">
-        <wsdl:part name="parameters" element="ns:getPartitionsOfGroupResponse"/>
+        <wsdl:part name="parameters" element="ns:getPartitionsOfGroupResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getAllAutoScalingPolicyRequest">
-        <wsdl:part name="parameters" element="ns:getAllAutoScalingPolicy"/>
+        <wsdl:part name="parameters" element="ns:getAllAutoScalingPolicy"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getAllAutoScalingPolicyResponse">
-        <wsdl:part name="parameters" element="ns:getAllAutoScalingPolicyResponse"/>
+        <wsdl:part name="parameters" element="ns:getAllAutoScalingPolicyResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getDeploymentPolicyRequest">
-        <wsdl:part name="parameters" element="ns:getDeploymentPolicy"/>
+        <wsdl:part name="parameters" element="ns:getDeploymentPolicy"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getDeploymentPolicyResponse">
-        <wsdl:part name="parameters" element="ns:getDeploymentPolicyResponse"/>
+        <wsdl:part name="parameters" element="ns:getDeploymentPolicyResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="serviceGroupExistRequest">
-        <wsdl:part name="parameters" element="ns:serviceGroupExist"/>
+        <wsdl:part name="parameters" element="ns:serviceGroupExist"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="serviceGroupExistResponse">
-        <wsdl:part name="parameters" element="ns:serviceGroupExistResponse"/>
-    </wsdl:message>
-    <wsdl:message name="addAutoScalingPolicyRequest">
-        <wsdl:part name="parameters" element="ns:addAutoScalingPolicy"/>
-    </wsdl:message>
-    <wsdl:message name="addAutoScalingPolicyResponse">
-        <wsdl:part name="parameters" element="ns:addAutoScalingPolicyResponse"/>
-    </wsdl:message>
-    <wsdl:message name="AutoScalerServiceInvalidPolicyException">
-        <wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidPolicyException"/>
+        <wsdl:part name="parameters" element="ns:serviceGroupExistResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getMasterForKubernetesGroupRequest">
-        <wsdl:part name="parameters" element="ns:getMasterForKubernetesGroup"/>
+        <wsdl:part name="parameters" element="ns:getMasterForKubernetesGroup"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getMasterForKubernetesGroupResponse">
-        <wsdl:part name="parameters" element="ns:getMasterForKubernetesGroupResponse"/>
+        <wsdl:part name="parameters" element="ns:getMasterForKubernetesGroupResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="AutoScalerServiceNonExistingKubernetesGroupException">
-        <wsdl:part name="parameters" element="ns:AutoScalerServiceNonExistingKubernetesGroupException"/>
+        <wsdl:part name="parameters" element="ns:AutoScalerServiceNonExistingKubernetesGroupException"></wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="addAutoScalingPolicyRequest">
+        <wsdl:part name="parameters" element="ns:addAutoScalingPolicy"></wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="addAutoScalingPolicyResponse">
+        <wsdl:part name="parameters" element="ns:addAutoScalingPolicyResponse"></wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="AutoScalerServiceInvalidPolicyException">
+        <wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidPolicyException"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="unDeployApplicationDefinitionRequest">
-        <wsdl:part name="parameters" element="ns:unDeployApplicationDefinition"/>
+        <wsdl:part name="parameters" element="ns:unDeployApplicationDefinition"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="AutoScalerServiceApplicationDefinitionException">
-        <wsdl:part name="parameters" element="ns:AutoScalerServiceApplicationDefinitionException"/>
+        <wsdl:part name="parameters" element="ns:AutoScalerServiceApplicationDefinitionException"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getServiceGroupRequest">
-        <wsdl:part name="parameters" element="ns:getServiceGroup"/>
+        <wsdl:part name="parameters" element="ns:getServiceGroup"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getServiceGroupResponse">
-        <wsdl:part name="parameters" element="ns:getServiceGroupResponse"/>
-    </wsdl:message>
-    <wsdl:message name="getAllDeploymentPoliciesRequest">
-        <wsdl:part name="parameters" element="ns:getAllDeploymentPolicies"/>
-    </wsdl:message>
-    <wsdl:message name="getAllDeploymentPoliciesResponse">
-        <wsdl:part name="parameters" element="ns:getAllDeploymentPoliciesResponse"/>
+        <wsdl:part name="parameters" element="ns:getServiceGroupResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="removeKubernetesGroupRequest">
-        <wsdl:part name="parameters" element="ns:removeKubernetesGroup"/>
+        <wsdl:part name="parameters" element="ns:removeKubernetesGroup"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="removeKubernetesGroupResponse">
-        <wsdl:part name="parameters" element="ns:removeKubernetesGroupResponse"/>
+        <wsdl:part name="parameters" element="ns:removeKubernetesGroupResponse"></wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getAllDeploymentPoliciesRequest">
+        <wsdl:part name="parameters" element="ns:getAllDeploymentPolicies"></wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="getAllDeploymentPoliciesResponse">
+        <wsdl:part name="parameters" element="ns:getAllDeploymentPoliciesResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getValidDeploymentPoliciesforCartridgeRequest">
-        <wsdl:part name="parameters" element="ns:getValidDeploymentPoliciesforCartridge"/>
+        <wsdl:part name="parameters" element="ns:getValidDeploymentPoliciesforCartridge"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getValidDeploymentPoliciesforCartridgeResponse">
-        <wsdl:part name="parameters" element="ns:getValidDeploymentPoliciesforCartridgeResponse"/>
+        <wsdl:part name="parameters" element="ns:getValidDeploymentPoliciesforCartridgeResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="undeployServiceGroupRequest">
-        <wsdl:part name="parameters" element="ns:undeployServiceGroup"/>
+        <wsdl:part name="parameters" element="ns:undeployServiceGroup"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="addKubernetesHostRequest">
-        <wsdl:part name="parameters" element="ns:addKubernetesHost"/>
+        <wsdl:part name="parameters" element="ns:addKubernetesHost"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="addKubernetesHostResponse">
-        <wsdl:part name="parameters" element="ns:addKubernetesHostResponse"/>
+        <wsdl:part name="parameters" element="ns:addKubernetesHostResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="AutoScalerServiceInvalidKubernetesHostException">
-        <wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidKubernetesHostException"/>
+        <wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidKubernetesHostException"></wsdl:part>
     </wsdl:message>
+    <wsdl:message name="getAllAvailablePartitionsRequest"></wsdl:message>
+    <wsdl:message name="getAllAvailablePartitionsResponse"></wsdl:message>
     <wsdl:message name="deployApplicationDefinitionRequest">
-        <wsdl:part name="parameters" element="ns:deployApplicationDefinition"/>
+        <wsdl:part name="parameters" element="ns:deployApplicationDefinition"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getAutoscalingPolicyRequest">
-        <wsdl:part name="parameters" element="ns:getAutoscalingPolicy"/>
+        <wsdl:part name="parameters" element="ns:getAutoscalingPolicy"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getAutoscalingPolicyResponse">
-        <wsdl:part name="parameters" element="ns:getAutoscalingPolicyResponse"/>
+        <wsdl:part name="parameters" element="ns:getAutoscalingPolicyResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="updateAutoScalingPolicyRequest">
-        <wsdl:part name="parameters" element="ns:updateAutoScalingPolicy"/>
+        <wsdl:part name="parameters" element="ns:updateAutoScalingPolicy"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="updateAutoScalingPolicyResponse">
-        <wsdl:part name="parameters" element="ns:updateAutoScalingPolicyResponse"/>
+        <wsdl:part name="parameters" element="ns:updateAutoScalingPolicyResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getKubernetesGroupRequest">
-        <wsdl:part name="parameters" element="ns:getKubernetesGroup"/>
+        <wsdl:part name="parameters" element="ns:getKubernetesGroup"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getKubernetesGroupResponse">
-        <wsdl:part name="parameters" element="ns:getKubernetesGroupResponse"/>
+        <wsdl:part name="parameters" element="ns:getKubernetesGroupResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="removeKubernetesHostRequest">
-        <wsdl:part name="parameters" element="ns:removeKubernetesHost"/>
+        <wsdl:part name="parameters" element="ns:removeKubernetesHost"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="removeKubernetesHostResponse">
-        <wsdl:part name="parameters" element="ns:removeKubernetesHostResponse"/>
+        <wsdl:part name="parameters" element="ns:removeKubernetesHostResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="AutoScalerServiceNonExistingKubernetesHostException">
-        <wsdl:part name="parameters" element="ns:AutoScalerServiceNonExistingKubernetesHostException"/>
+        <wsdl:part name="parameters" element="ns:AutoScalerServiceNonExistingKubernetesHostException"></wsdl:part>
     </wsdl:message>
+    <wsdl:message name="addPartitionRequest"></wsdl:message>
+    <wsdl:message name="addPartitionResponse"></wsdl:message>
     <wsdl:message name="addDeploymentPolicyRequest">
-        <wsdl:part name="parameters" element="ns:addDeploymentPolicy"/>
+        <wsdl:part name="parameters" element="ns:addDeploymentPolicy"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="addDeploymentPolicyResponse">
-        <wsdl:part name="parameters" element="ns:addDeploymentPolicyResponse"/>
+        <wsdl:part name="parameters" element="ns:addDeploymentPolicyResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="updateClusterMonitorRequest">
-        <wsdl:part name="parameters" element="ns:updateClusterMonitor"/>
+        <wsdl:part name="parameters" element="ns:updateClusterMonitor"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="AutoScalerServiceInvalidArgumentException">
-        <wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidArgumentException"/>
+        <wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidArgumentException"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getAllKubernetesGroupsRequest">
-        <wsdl:part name="parameters" element="ns:getAllKubernetesGroups"/>
+        <wsdl:part name="parameters" element="ns:getAllKubernetesGroups"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="getAllKubernetesGroupsResponse">
-        <wsdl:part name="parameters" element="ns:getAllKubernetesGroupsResponse"/>
+        <wsdl:part name="parameters" element="ns:getAllKubernetesGroupsResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="updateDeploymentPolicyRequest">
-        <wsdl:part name="parameters" element="ns:updateDeploymentPolicy"/>
+        <wsdl:part name="parameters" element="ns:updateDeploymentPolicy"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="updateDeploymentPolicyResponse">
-        <wsdl:part name="parameters" element="ns:updateDeploymentPolicyResponse"/>
+        <wsdl:part name="parameters" element="ns:updateDeploymentPolicyResponse"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="deployServiceGroupRequest">
-        <wsdl:part name="parameters" element="ns:deployServiceGroup"/>
+        <wsdl:part name="parameters" element="ns:deployServiceGroup"></wsdl:part>
     </wsdl:message>
     <wsdl:message name="AutoScalerServiceInvalidServiceGroupException">
-        <wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidServiceGroupExce

<TRUNCATED>

[2/3] stratos git commit: fixing cartridge deployment issues and global deployment policy deployment issues

Posted by re...@apache.org.
fixing cartridge deployment issues and global deployment policy deployment issues


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

Branch: refs/heads/master
Commit: 2c07846c3b8ef6c66446908fce427e827af281d4
Parents: f6c912b
Author: reka <rt...@gmail.com>
Authored: Mon Dec 1 22:21:04 2014 +0530
Committer: reka <rt...@gmail.com>
Committed: Mon Dec 1 22:21:27 2014 +0530

----------------------------------------------------------------------
 .../autoscaler/api/AutoScalerServiceImpl.java   |   27 +
 .../AutoscalerTopologyEventReceiver.java        |  169 +-
 .../autoscaler/pojo/policy/PolicyManager.java   |    9 +
 .../pojo/policy/deployment/ChildPolicy.java     |    4 +-
 .../partition/network/ChildLevelPartition.java  |   22 +-
 .../stratos/autoscaler/util/AutoscalerUtil.java |   54 +-
 .../org.apache.stratos.cloud.controller/pom.xml |    2 -
 .../src/main/resources/META-INF/services.xml    |    2 +-
 .../clustering/DistributedObjectProvider.java   |    3 +-
 .../src/main/resources/AutoScalerService.wsdl   | 1490 +++++++++---------
 10 files changed, 982 insertions(+), 800 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/2c07846c/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 739ae9d..91745d8 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
@@ -21,6 +21,7 @@ package org.apache.stratos.autoscaler.api;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.autoscaler.applications.ApplicationHolder;
 import org.apache.stratos.autoscaler.context.AutoscalerContext;
 //import org.apache.stratos.autoscaler.NetworkPartitionLbHolder;
 import org.apache.stratos.autoscaler.applications.parser.ApplicationParser;
@@ -45,12 +46,14 @@ import org.apache.stratos.autoscaler.pojo.policy.autoscale.AutoscalePolicy;
 import org.apache.stratos.autoscaler.pojo.policy.deployment.DeploymentPolicy;
 import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.Partition;
 import org.apache.stratos.autoscaler.registry.RegistryManager;
+import org.apache.stratos.autoscaler.util.AutoscalerUtil;
 import org.apache.stratos.common.Properties;
 import org.apache.stratos.common.Property;
 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.messaging.domain.applications.Application;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
 import org.apache.stratos.metadata.client.defaults.DefaultMetaDataServiceClient;
 import org.apache.stratos.metadata.client.defaults.MetaDataServiceClient;
 import org.apache.stratos.metadata.client.exception.MetaDataServiceClientException;
@@ -112,6 +115,30 @@ public class AutoScalerServiceImpl implements AutoScalerServiceInterface {
         boolean hasDeployed = PolicyManager.getInstance().deployDeploymentPolicy(deploymentPolicy);
         //Need to start the application Monitor after validation of the deployment policies.
 
+        //Check whether all the clusters are there
+        ApplicationHolder.acquireReadLock();
+        boolean allClusterInitialized = false;
+
+        try {
+            Application application = ApplicationHolder.getApplications().
+                    getApplication(deploymentPolicy.getApplicationId());
+            if(application != null) {
+                allClusterInitialized = AutoscalerUtil.allClustersInitialized(application);
+            }
+
+        } finally {
+            ApplicationHolder.releaseReadLock();
+        }
+
+        if(allClusterInitialized) {
+            AutoscalerUtil.getInstance().
+                    startApplicationMonitor(deploymentPolicy.getApplicationId());
+
+        } else {
+            log.info("The application clusters are not yet created. " +
+                    "Waiting for them to be created");
+        }
+
         return hasDeployed;
     }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c07846c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
index 73bd6db..98c0afa 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
@@ -27,14 +27,14 @@ import org.apache.stratos.autoscaler.context.cluster.ClusterContextFactory;
 import org.apache.stratos.autoscaler.context.cluster.VMClusterContext;
 import org.apache.stratos.autoscaler.event.publisher.ClusterStatusEventPublisher;
 import org.apache.stratos.autoscaler.event.publisher.InstanceNotificationPublisher;
-import org.apache.stratos.autoscaler.exception.application.DependencyBuilderException;
-import org.apache.stratos.autoscaler.exception.application.TopologyInConsistentException;
 import org.apache.stratos.autoscaler.exception.partition.PartitionValidationException;
 import org.apache.stratos.autoscaler.exception.policy.PolicyValidationException;
-import org.apache.stratos.autoscaler.monitor.MonitorFactory;
 import org.apache.stratos.autoscaler.monitor.cluster.AbstractClusterMonitor;
 import org.apache.stratos.autoscaler.monitor.component.ApplicationMonitor;
 import org.apache.stratos.autoscaler.monitor.events.ClusterStatusEvent;
+import org.apache.stratos.autoscaler.pojo.policy.PolicyManager;
+import org.apache.stratos.autoscaler.pojo.policy.deployment.DeploymentPolicy;
+import org.apache.stratos.autoscaler.util.AutoscalerUtil;
 import org.apache.stratos.autoscaler.util.ServiceReferenceHolder;
 import org.apache.stratos.messaging.domain.applications.Application;
 import org.apache.stratos.messaging.domain.applications.Applications;
@@ -143,7 +143,17 @@ public class AutoscalerTopologyEventReceiver implements Runnable {
                         if (applications != null) {
                             for (Application application : applications.getApplications().values()) {
                                 if (allClustersInitialized(application)) {
-                                    startApplicationMonitor(application.getUniqueIdentifier());
+                                    DeploymentPolicy policy = PolicyManager.getInstance().
+                                            getDeploymentPolicyByApplication(
+                                                    application.getUniqueIdentifier());
+                                    if(policy != null) {
+                                        AutoscalerUtil.getInstance().
+                                                startApplicationMonitor(application.getUniqueIdentifier());
+                                    } else {
+                                        log.info("The relevant application policy is not yet " +
+                                                "deployed for this [application] " +
+                                                application.getUniqueIdentifier());
+                                    }
                                 } else {
                                     log.error("Complete Topology is not consistent with the applications " +
                                             "which got persisted");
@@ -175,7 +185,7 @@ public class AutoscalerTopologyEventReceiver implements Runnable {
                         //acquire read lock
                         ApplicationHolder.acquireReadLock();
                         //start the application monitor
-                        startApplicationMonitor(appId);
+                        //startApplicationMonitor(appId);
                     } catch (Exception e) {
                         String msg = "Error processing event " + e.getLocalizedMessage();
                         log.error(msg, e);
@@ -432,81 +442,81 @@ public class AutoscalerTopologyEventReceiver implements Runnable {
         });
 
         topologyEventReceiver.addEventListener(new ClusterInstanceCreatedEventListener() {
-            @Override
-            protected void onEvent(Event event) {
-
-                ClusterInstanceCreatedEvent clusterInstanceCreatedEvent =
-                        (ClusterInstanceCreatedEvent) event;
-                AbstractClusterMonitor clusterMonitor = AutoscalerContext.getInstance().
-                        getClusterMonitor(clusterInstanceCreatedEvent.getClusterId());
-                String instanceId = ((ClusterInstanceCreatedEvent) event).getInstanceId();
-                //FIXME to take lock when clusterMonitor is running
-                if (clusterMonitor != null) {
-                    TopologyManager.acquireReadLockForCluster(clusterInstanceCreatedEvent.getServiceName(),
-                            clusterInstanceCreatedEvent.getClusterId());
-
-                    try {
-                        Service service = TopologyManager.getTopology().
-                                getService(clusterInstanceCreatedEvent.getServiceName());
-
-                        if (service != null) {
-                            Cluster cluster = service.getCluster(clusterInstanceCreatedEvent.getClusterId());
-                            if (cluster != null) {
-                                try {
-                                    if (cluster.isKubernetesCluster()) {
-                                        clusterMonitor.setClusterContext(
-                                                ClusterContextFactory.getKubernetesClusterContext(
-                                                                            instanceId,
-                                                                            cluster));
-                                    } else {
-                                        VMClusterContext clusterContext =
-                                                (VMClusterContext) clusterMonitor.getClusterContext();
-                                        if (clusterContext == null) {
-                                            clusterMonitor.setClusterContext(
-                                                    ClusterContextFactory.
-                                                            getVMServiceClusterContext(instanceId,
-                                                                                        cluster));
-                                        } else {
-                                            clusterContext.addInstanceContext(instanceId, cluster);
-                                        }
-
-                                    }
-                                    if (clusterMonitor.hasMonitoringStarted().compareAndSet(false, true)) {
-                                        clusterMonitor.startScheduler();
-                                        log.info("Monitoring task for Cluster Monitor with cluster id " +
-                                                clusterInstanceCreatedEvent.getClusterId() + " started successfully");
-                                    }
-                                } catch (PolicyValidationException e) {
-                                    log.error(e.getMessage(), e);
-                                } catch (PartitionValidationException e) {
-                                    log.error(e.getMessage(), e);
-                                }
-                            }
-
-                            } else {
-                                log.error("Service " + clusterInstanceCreatedEvent.getServiceName() +
-                                        " not found, no cluster instance added to ClusterMonitor " +
-                                        clusterInstanceCreatedEvent.getClusterId());
-                            }
-
-                        }finally{
-                            TopologyManager.releaseReadLockForCluster(clusterInstanceCreatedEvent.getServiceName(),
-                                    clusterInstanceCreatedEvent.getClusterId());
-                        }
-
-                    }else{
-                        log.error("No Cluster Monitor found for cluster id " +
-                                clusterInstanceCreatedEvent.getClusterId());
-                    }
-                }
-            }
-
-            );
-        }
+                                                   @Override
+                                                   protected void onEvent(Event event) {
+
+                                                       ClusterInstanceCreatedEvent clusterInstanceCreatedEvent =
+                                                               (ClusterInstanceCreatedEvent) event;
+                                                       AbstractClusterMonitor clusterMonitor = AutoscalerContext.getInstance().
+                                                               getClusterMonitor(clusterInstanceCreatedEvent.getClusterId());
+                                                       String instanceId = ((ClusterInstanceCreatedEvent) event).getInstanceId();
+                                                       //FIXME to take lock when clusterMonitor is running
+                                                       if (clusterMonitor != null) {
+                                                           TopologyManager.acquireReadLockForCluster(clusterInstanceCreatedEvent.getServiceName(),
+                                                                   clusterInstanceCreatedEvent.getClusterId());
+
+                                                           try {
+                                                               Service service = TopologyManager.getTopology().
+                                                                       getService(clusterInstanceCreatedEvent.getServiceName());
+
+                                                               if (service != null) {
+                                                                   Cluster cluster = service.getCluster(clusterInstanceCreatedEvent.getClusterId());
+                                                                   if (cluster != null) {
+                                                                       try {
+                                                                           if (cluster.isKubernetesCluster()) {
+                                                                               clusterMonitor.setClusterContext(
+                                                                                       ClusterContextFactory.getKubernetesClusterContext(
+                                                                                               instanceId,
+                                                                                               cluster));
+                                                                           } else {
+                                                                               VMClusterContext clusterContext =
+                                                                                       (VMClusterContext) clusterMonitor.getClusterContext();
+                                                                               if (clusterContext == null) {
+                                                                                   clusterMonitor.setClusterContext(
+                                                                                           ClusterContextFactory.
+                                                                                                   getVMServiceClusterContext(instanceId,
+                                                                                                           cluster));
+                                                                               } else {
+                                                                                   clusterContext.addInstanceContext(instanceId, cluster);
+                                                                               }
+
+                                                                           }
+                                                                           if (clusterMonitor.hasMonitoringStarted().compareAndSet(false, true)) {
+                                                                               clusterMonitor.startScheduler();
+                                                                               log.info("Monitoring task for Cluster Monitor with cluster id " +
+                                                                                       clusterInstanceCreatedEvent.getClusterId() + " started successfully");
+                                                                           }
+                                                                       } catch (PolicyValidationException e) {
+                                                                           log.error(e.getMessage(), e);
+                                                                       } catch (PartitionValidationException e) {
+                                                                           log.error(e.getMessage(), e);
+                                                                       }
+                                                                   }
+
+                                                               } else {
+                                                                   log.error("Service " + clusterInstanceCreatedEvent.getServiceName() +
+                                                                           " not found, no cluster instance added to ClusterMonitor " +
+                                                                           clusterInstanceCreatedEvent.getClusterId());
+                                                               }
+
+                                                           } finally {
+                                                               TopologyManager.releaseReadLockForCluster(clusterInstanceCreatedEvent.getServiceName(),
+                                                                       clusterInstanceCreatedEvent.getClusterId());
+                                                           }
+
+                                                       } else {
+                                                           log.error("No Cluster Monitor found for cluster id " +
+                                                                   clusterInstanceCreatedEvent.getClusterId());
+                                                       }
+                                                   }
+                                               }
+
+        );
+    }
 
-                /**
-                 * Terminate load balancer topology receiver thread.
-                 */
+    /**
+     * Terminate load balancer topology receiver thread.
+     */
 
     public void terminate() {
         topologyEventReceiver.terminate();
@@ -514,5 +524,4 @@ public class AutoscalerTopologyEventReceiver implements Runnable {
     }
 
 
-
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c07846c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java
index 31a1f74..ca9a4a7 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/PolicyManager.java
@@ -286,4 +286,13 @@ public class PolicyManager {
         return deploymentPolicyListMap.get(id);
     }
 
+    public DeploymentPolicy getDeploymentPolicyByApplication(String appId) {
+        for(DeploymentPolicy deploymentPolicy : deploymentPolicyListMap.values()) {
+            if(deploymentPolicy.getApplicationId().equals(appId)) {
+                return deploymentPolicy;
+            }
+        }
+        return null;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c07846c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/ChildPolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/ChildPolicy.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/ChildPolicy.java
index 1f4a8b4..9d78dcf 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/ChildPolicy.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/ChildPolicy.java
@@ -20,10 +20,12 @@ package org.apache.stratos.autoscaler.pojo.policy.deployment;
 
 import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.ChildLevelNetworkPartition;
 
+import java.io.Serializable;
+
 /**
  * This will keep the Children's policy in an application
  */
-public class ChildPolicy {
+public class ChildPolicy implements Serializable {
     private String id;
 
     private ChildLevelNetworkPartition[] childLevelNetworkPartitions;

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c07846c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/partition/network/ChildLevelPartition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/partition/network/ChildLevelPartition.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/partition/network/ChildLevelPartition.java
index 691cb07..8c3b140 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/partition/network/ChildLevelPartition.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/partition/network/ChildLevelPartition.java
@@ -19,17 +19,13 @@
 
 package org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network;
 
-public class ChildLevelPartition {
+import java.io.Serializable;
+
+public class ChildLevelPartition implements Serializable {
     private String partitionId;
     private String networkPartitionId;
     private int max;
 
-    public ChildLevelPartition(String partitionId, String networkPartitionId, int max) {
-        this.partitionId = partitionId;
-        this.networkPartitionId = networkPartitionId;
-        this.max = max;
-    }
-
     public int getMax() {
         return max;
     }
@@ -41,4 +37,16 @@ public class ChildLevelPartition {
     public String getPartitionId() {
         return partitionId;
     }
+
+    public void setPartitionId(String partitionId) {
+        this.partitionId = partitionId;
+    }
+
+    public void setNetworkPartitionId(String networkPartitionId) {
+        this.networkPartitionId = networkPartitionId;
+    }
+
+    public void setMax(int max) {
+        this.max = max;
+    }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c07846c/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 077a1a4..476e8bb 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
@@ -38,6 +38,10 @@ import org.apache.stratos.common.Properties;
 import org.apache.stratos.common.Property;
 import org.apache.stratos.messaging.domain.applications.Application;
 import org.apache.stratos.messaging.domain.applications.Applications;
+import org.apache.stratos.messaging.domain.applications.ClusterDataHolder;
+import org.apache.stratos.messaging.domain.topology.Service;
+import org.apache.stratos.messaging.domain.topology.Topology;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
 
 
 /**
@@ -51,6 +55,13 @@ public class AutoscalerUtil {
 
     }
 
+    public static AutoscalerUtil getInstance() {
+        return Holder.INSTANCE;
+    }
+    private static class Holder {
+        private static final AutoscalerUtil INSTANCE = new AutoscalerUtil();
+    }
+
     public static Applications  getApplications () {
 
         Applications applications;
@@ -88,6 +99,47 @@ public class AutoscalerUtil {
         return clusterId.substring(0, clusterId.indexOf("."));
     }
 
+    public static boolean allClustersInitialized(Application application) {
+        boolean allClustersInitialized = false;
+        for (ClusterDataHolder holder : application.getClusterDataRecursively()) {
+            TopologyManager.acquireReadLockForCluster(holder.getServiceType(),
+                    holder.getClusterId());
+
+            try {
+                Topology topology = TopologyManager.getTopology();
+                if (topology != null) {
+                    Service service = topology.getService(holder.getServiceType());
+                    if (service != null) {
+                        if (service.clusterExists(holder.getClusterId())) {
+                            allClustersInitialized = true;
+                            return allClustersInitialized;
+                        } else {
+                            if (log.isDebugEnabled()) {
+                                log.debug("[Cluster] " + holder.getClusterId() + " is not found in " +
+                                        "the Topology");
+                            }
+                            allClustersInitialized = false;
+                        }
+                    } else {
+                        if (log.isDebugEnabled()) {
+                            log.debug("Service is null in the CompleteTopologyEvent");
+                        }
+                    }
+                } else {
+                    if (log.isDebugEnabled()) {
+                        log.debug("Topology is null in the CompleteTopologyEvent");
+                    }
+                }
+            } finally {
+                TopologyManager.releaseReadLockForCluster(holder.getServiceType(),
+                        holder.getClusterId());
+            }
+        }
+        return allClustersInitialized;
+    }
+
+
+
     /*public static LbClusterMonitor getLBClusterMonitor(Cluster cluster) throws PolicyValidationException, PartitionValidationException {
         // FIXME fix the following code to correctly update
         // AutoscalerContext context = AutoscalerContext.getInstance();
@@ -297,7 +349,7 @@ public class AutoscalerUtil {
         return toCommonProperties(properties);
     }
 
-    protected synchronized void startApplicationMonitor(String applicationId) {
+    public synchronized void startApplicationMonitor(String applicationId) {
         Thread th = null;
         if (AutoscalerContext.getInstance().getAppMonitor(applicationId) == null) {
             th = new Thread(new ApplicationMonitorAdder(applicationId));

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c07846c/components/org.apache.stratos.cloud.controller/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/pom.xml b/components/org.apache.stratos.cloud.controller/pom.xml
index 5889c1d..1a9445a 100644
--- a/components/org.apache.stratos.cloud.controller/pom.xml
+++ b/components/org.apache.stratos.cloud.controller/pom.xml
@@ -49,12 +49,10 @@
                         <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                         <Bundle-Name>${project.artifactId}</Bundle-Name>
                         <Export-Package>
-			    !org.apache.stratos.cloud.controller.services.impl.*,
 			    !org.apache.stratos.cloud.controller.internal.*,
 			    org.apache.stratos.cloud.controller.*,
                         </Export-Package>
                         <Private-Package>
-			    org.apache.stratos.cloud.controller.services.impl.*,
 			    org.apache.stratos.cloud.controller.internal.*,
                         </Private-Package>
                         <Import-Package>

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c07846c/components/org.apache.stratos.cloud.controller/src/main/resources/META-INF/services.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/resources/META-INF/services.xml b/components/org.apache.stratos.cloud.controller/src/main/resources/META-INF/services.xml
index f0283f5..3f365e7 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/resources/META-INF/services.xml
+++ b/components/org.apache.stratos.cloud.controller/src/main/resources/META-INF/services.xml
@@ -22,7 +22,7 @@
 
 <serviceGroup>
     <service name="CloudControllerService" scope="application">
-        <parameter name="ServiceClass">org.apache.stratos.cloud.controller.services.CloudControllerServiceImpl</parameter>
+        <parameter name="ServiceClass">org.apache.stratos.cloud.controller.services.impl.CloudControllerServiceImpl</parameter>
         <messageReceivers>
         <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
         <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c07846c/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/clustering/DistributedObjectProvider.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/clustering/DistributedObjectProvider.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/clustering/DistributedObjectProvider.java
index fe47ca4..428d3da 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/clustering/DistributedObjectProvider.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/clustering/DistributedObjectProvider.java
@@ -26,6 +26,7 @@ import com.hazelcast.core.IMap;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -34,7 +35,7 @@ import java.util.concurrent.ConcurrentHashMap;
 /**
  * Provides objects to be managed in distributed and non-distributed environments.
  */
-public class DistributedObjectProvider {
+public class DistributedObjectProvider implements Serializable {
     private static final Log log = LogFactory.getLog(DistributedObjectProvider.class);
 
     private final boolean clustered;


[3/3] stratos git commit: adding applicatin id to dep policy and changing app creation after deploying deployment policy

Posted by re...@apache.org.
adding applicatin id to dep policy and changing app creation after deploying deployment policy


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

Branch: refs/heads/master
Commit: f6c912b0ef14d4991012f143c991ab5377e97679
Parents: 600dceb
Author: reka <rt...@gmail.com>
Authored: Mon Dec 1 18:13:29 2014 +0530
Committer: reka <rt...@gmail.com>
Committed: Mon Dec 1 22:21:27 2014 +0530

----------------------------------------------------------------------
 .../autoscaler/api/AutoScalerServiceImpl.java   |  5 +-
 .../AutoscalerTopologyEventReceiver.java        | 71 ----------------
 .../pojo/policy/deployment/ChildPolicy.java     |  2 +-
 .../policy/deployment/DeploymentPolicy.java     |  9 +++
 .../stratos/autoscaler/util/AutoscalerUtil.java | 85 ++++++++++++++++++++
 5 files changed, 99 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/f6c912b0/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 84705f8..739ae9d 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
@@ -109,7 +109,10 @@ public class AutoScalerServiceImpl implements AutoScalerServiceInterface {
 
     @Override
     public boolean addDeploymentPolicy(DeploymentPolicy deploymentPolicy) throws InvalidPolicyException {
-        return PolicyManager.getInstance().deployDeploymentPolicy(deploymentPolicy);
+        boolean hasDeployed = PolicyManager.getInstance().deployDeploymentPolicy(deploymentPolicy);
+        //Need to start the application Monitor after validation of the deployment policies.
+
+        return hasDeployed;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/stratos/blob/f6c912b0/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
index f41466b..73bd6db 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
@@ -513,77 +513,6 @@ public class AutoscalerTopologyEventReceiver implements Runnable {
         terminated = true;
     }
 
-    protected synchronized void startApplicationMonitor(String applicationId) {
-        Thread th = null;
-        if (AutoscalerContext.getInstance().getAppMonitor(applicationId) == null) {
-            th = new Thread(new ApplicationMonitorAdder(applicationId));
-        }
-        if (th != null) {
-            th.start();
-        } else {
-            if (log.isDebugEnabled()) {
-                log.debug(String
-                        .format("Application monitor thread already exists: " +
-                                "[application] %s ", applicationId));
-            }
-        }
-    }
-
-    private class ApplicationMonitorAdder implements Runnable {
-        private String appId;
-
-        public ApplicationMonitorAdder(String appId) {
-            this.appId = appId;
-        }
-
-        public void run() {
-            ApplicationMonitor applicationMonitor = null;
-            int retries = 5;
-            boolean success = false;
-            do {
-                try {
-                    Thread.sleep(5000);
-                } catch (InterruptedException e1) {
-                }
-                try {
-                    long start = System.currentTimeMillis();
-                    if (log.isDebugEnabled()) {
-                        log.debug("application monitor is going to be started for [application] " +
-                                appId);
-                    }
-                    try {
-                        applicationMonitor = MonitorFactory.getApplicationMonitor(appId);
-                    } catch (PolicyValidationException e) {
-                        String msg = "Application monitor creation failed for Application: ";
-                        log.warn(msg, e);
-                        retries--;
-                    }
-                    long end = System.currentTimeMillis();
-                    log.info("Time taken to start app monitor: " + (end - start) / 1000);
-                    success = true;
-                } catch (DependencyBuilderException e) {
-                    String msg = "Application monitor creation failed for Application: ";
-                    log.warn(msg, e);
-                    retries--;
-                } catch (TopologyInConsistentException e) {
-                    String msg = "Application monitor creation failed for Application: ";
-                    log.warn(msg, e);
-                    retries--;
-                }
-            } while (!success && retries != 0);
 
-            if (applicationMonitor == null) {
-                String msg = "Application monitor creation failed, even after retrying for 5 times, "
-                        + "for Application: " + appId;
-                log.error(msg);
-                throw new RuntimeException(msg);
-            }
 
-            AutoscalerContext.getInstance().addAppMonitor(applicationMonitor);
-            if (log.isInfoEnabled()) {
-                log.info(String.format("Application monitor has been added successfully: " +
-                        "[application] %s", applicationMonitor.getId()));
-            }
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/f6c912b0/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/ChildPolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/ChildPolicy.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/ChildPolicy.java
index 04f7d9f..1f4a8b4 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/ChildPolicy.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/pojo/policy/deployment/ChildPolicy.java
@@ -21,7 +21,7 @@ package org.apache.stratos.autoscaler.pojo.policy.deployment;
 import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.ChildLevelNetworkPartition;
 
 /**
- * Created by reka on 12/1/14.
+ * This will keep the Children's policy in an application
  */
 public class ChildPolicy {
     private String id;

http://git-wip-us.apache.org/repos/asf/stratos/blob/f6c912b0/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 378c40b..ef3eacd 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
@@ -36,6 +36,7 @@ public class DeploymentPolicy implements Serializable{
 
     private static final long serialVersionUID = 5675507196284400099L;
     private String id;
+    private String applicationId;
     private String description;
     private boolean isPublic;
     private ApplicationLevelNetworkPartition[] applicationLevelNetworkPartitions;
@@ -222,4 +223,12 @@ public class DeploymentPolicy implements Serializable{
             this.childPolicies = Arrays.copyOf(childPolicies, childPolicies.length);
         }
     }
+
+    public String getApplicationId() {
+        return applicationId;
+    }
+
+    public void setApplicationId(String applicationId) {
+        this.applicationId = applicationId;
+    }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/f6c912b0/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 5b80264..077a1a4 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
@@ -27,6 +27,12 @@ import javax.xml.namespace.QName;
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.autoscaler.context.AutoscalerContext;
+import org.apache.stratos.autoscaler.exception.application.DependencyBuilderException;
+import org.apache.stratos.autoscaler.exception.application.TopologyInConsistentException;
+import org.apache.stratos.autoscaler.exception.policy.PolicyValidationException;
+import org.apache.stratos.autoscaler.monitor.MonitorFactory;
+import org.apache.stratos.autoscaler.monitor.component.ApplicationMonitor;
 import org.apache.stratos.autoscaler.registry.RegistryManager;
 import org.apache.stratos.common.Properties;
 import org.apache.stratos.common.Property;
@@ -78,6 +84,10 @@ public class AutoscalerUtil {
         RegistryManager.getInstance().removeApplication(applicationId);
     }
 
+    public static String getAliasFromClusterId(String clusterId) {
+        return clusterId.substring(0, clusterId.indexOf("."));
+    }
+
     /*public static LbClusterMonitor getLBClusterMonitor(Cluster cluster) throws PolicyValidationException, PartitionValidationException {
         // FIXME fix the following code to correctly update
         // AutoscalerContext context = AutoscalerContext.getInstance();
@@ -287,6 +297,81 @@ public class AutoscalerUtil {
         return toCommonProperties(properties);
     }
 
+    protected synchronized void startApplicationMonitor(String applicationId) {
+        Thread th = null;
+        if (AutoscalerContext.getInstance().getAppMonitor(applicationId) == null) {
+            th = new Thread(new ApplicationMonitorAdder(applicationId));
+        }
+        if (th != null) {
+            th.start();
+        } else {
+            if (log.isDebugEnabled()) {
+                log.debug(String
+                        .format("Application monitor thread already exists: " +
+                                "[application] %s ", applicationId));
+            }
+        }
+    }
+
+    private class ApplicationMonitorAdder implements Runnable {
+        private String appId;
+
+        public ApplicationMonitorAdder(String appId) {
+            this.appId = appId;
+        }
+
+        public void run() {
+            ApplicationMonitor applicationMonitor = null;
+            int retries = 5;
+            boolean success = false;
+            do {
+                try {
+                    Thread.sleep(5000);
+                } catch (InterruptedException e1) {
+                }
+                try {
+                    long start = System.currentTimeMillis();
+                    if (log.isDebugEnabled()) {
+                        log.debug("application monitor is going to be started for [application] " +
+                                appId);
+                    }
+                    try {
+                        applicationMonitor = MonitorFactory.getApplicationMonitor(appId);
+                    } catch (PolicyValidationException e) {
+                        String msg = "Application monitor creation failed for Application: ";
+                        log.warn(msg, e);
+                        retries--;
+                    }
+                    long end = System.currentTimeMillis();
+                    log.info("Time taken to start app monitor: " + (end - start) / 1000);
+                    success = true;
+                } catch (DependencyBuilderException e) {
+                    String msg = "Application monitor creation failed for Application: ";
+                    log.warn(msg, e);
+                    retries--;
+                } catch (TopologyInConsistentException e) {
+                    String msg = "Application monitor creation failed for Application: ";
+                    log.warn(msg, e);
+                    retries--;
+                }
+            } while (!success && retries != 0);
+
+            if (applicationMonitor == null) {
+                String msg = "Application monitor creation failed, even after retrying for 5 times, "
+                        + "for Application: " + appId;
+                log.error(msg);
+                throw new RuntimeException(msg);
+            }
+
+            AutoscalerContext.getInstance().addAppMonitor(applicationMonitor);
+            if (log.isInfoEnabled()) {
+                log.info(String.format("Application monitor has been added successfully: " +
+                        "[application] %s", applicationMonitor.getId()));
+            }
+        }
+    }
+
+
 //    public static LbClusterMonitor getLbClusterMonitor(Cluster cluster) throws PolicyValidationException, PartitionValidationException {
 //        if (null == cluster) {
 //               return null;