You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2014/09/11 01:12:43 UTC
[01/12] git commit: Fixing STRATOS-762
Repository: stratos
Updated Branches:
refs/heads/docker-integration 2787399f6 -> 4979f64ab
Fixing STRATOS-762
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/79e59127
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/79e59127
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/79e59127
Branch: refs/heads/docker-integration
Commit: 79e59127e4f1e2a24f0ab5d24a65e8a6a5905f14
Parents: 7f1c44a
Author: dim lee <ad...@abc.com>
Authored: Fri Aug 29 05:55:33 2014 +0530
Committer: dim lee <ad...@abc.com>
Committed: Fri Aug 29 05:55:33 2014 +0530
----------------------------------------------------------------------
.../java/org/apache/stratos/manager/dto/Cartridge.java | 11 +++++++++++
.../stratos/rest/endpoint/services/ServiceUtils.java | 1 +
2 files changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/79e59127/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/Cartridge.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/Cartridge.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/Cartridge.java
index 18090c6..2b7a56f 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/Cartridge.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/Cartridge.java
@@ -52,6 +52,8 @@ public class Cartridge implements Comparable<Cartridge> {
//LB cluster id
private String lbClusterId;
+
+ private String clusterId;
private String[] accessURLs;
private PortMapping[] portMappings;
@@ -293,4 +295,13 @@ public class Cartridge implements Comparable<Cartridge> {
public void setServiceGroup(String serviceGroup) {
this.serviceGroup = serviceGroup;
}
+
+ public String getClusterId() {
+ return clusterId;
+ }
+
+ public void setClusterId(String clusterId) {
+ this.clusterId = clusterId;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/79e59127/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
index 5b1a01e..e34f95b 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
@@ -877,6 +877,7 @@ public class ServiceUtils {
cartridge.setLbClusterId(subscription.getLbClusterId());
}
+ cartridge.setClusterId(subscription.getClusterDomain());
cartridge.setStatus(subscription.getSubscriptionStatus());
cartridge.setPortMappings(subscription.getCartridgeInfo()
.getPortMappings());
[11/12] Add java2wsdl plugin for AS
Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/4979f64a/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
----------------------------------------------------------------------
diff --git a/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl b/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
index 887c658..14d6162 100644
--- a/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
+++ b/service-stubs/org.apache.stratos.cloud.controller.service.stub/src/main/resources/CloudControllerService.wsdl
@@ -1,210 +1,209 @@
-<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://impl.controller.cloud.stratos.apache.org" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax25="http://partition.deployment.controller.cloud.stratos.apache.org/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax23="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:ax21="http://pojo.controller.cloud.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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://impl.controller.cloud.stratos.apache.org">
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://impl.controller.cloud.stratos.apache.org" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax23="http://partition.deployment.controller.cloud.stratos.apache.org/xsd" xmlns:ax24="http://pojo.controller.cloud.stratos.apache.org/xsd" xmlns:ax21="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" 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://impl.controller.cloud.stratos.apache.org">
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://exception.controller.cloud.stratos.apache.org/xsd">
- <xs:complexType name="UnregisteredCartridgeException">
+ <xs:complexType name="InvalidPartitionException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidCartridgeDefinitionException">
+ <xs:complexType name="InvalidCartridgeTypeException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidIaasProviderException">
+ <xs:complexType name="UnregisteredClusterException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidCartridgeTypeException">
+ <xs:complexType name="InvalidMemberException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidPartitionException">
+ <xs:complexType name="InvalidClusterException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidMemberException">
+ <xs:complexType name="UnregisteredCartridgeException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InvalidClusterException">
+ <xs:complexType name="InvalidIaasProviderException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="UnregisteredClusterException">
+ <xs:complexType name="InvalidCartridgeDefinitionException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax27="http://partition.deployment.controller.cloud.stratos.apache.org/xsd" xmlns:ax24="http://exception.controller.cloud.stratos.apache.org/xsd" xmlns:ax22="http://pojo.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.controller.cloud.stratos.apache.org">
- <xs:import namespace="http://pojo.controller.cloud.stratos.apache.org/xsd"/>
+ <xs:schema xmlns:ax28="http://pojo.controller.cloud.stratos.apache.org/xsd" xmlns:ax26="http://partition.deployment.controller.cloud.stratos.apache.org/xsd" xmlns:ax22="http://exception.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://impl.controller.cloud.stratos.apache.org">
<xs:import namespace="http://exception.controller.cloud.stratos.apache.org/xsd"/>
<xs:import namespace="http://partition.deployment.controller.cloud.stratos.apache.org/xsd"/>
- <xs:element name="getClusterContext">
+ <xs:import namespace="http://pojo.controller.cloud.stratos.apache.org/xsd"/>
+ <xs:element name="CloudControllerServiceInvalidPartitionException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="InvalidPartitionException" nillable="true" type="ax21:InvalidPartitionException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getClusterContextResponse">
+ <xs:element name="validatePartition">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax21:ClusterContext"/>
+ <xs:element minOccurs="0" name="partition" nillable="true" type="ax26:Partition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceUnregisteredCartridgeException">
+ <xs:element name="validatePartitionResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="UnregisteredCartridgeException" nillable="true" type="ax23:UnregisteredCartridgeException"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="registerService">
+ <xs:element name="CloudControllerServiceInvalidCartridgeTypeException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="registrant" nillable="true" type="ax21:Registrant"/>
+ <xs:element minOccurs="0" name="InvalidCartridgeTypeException" nillable="true" type="ax21:InvalidCartridgeTypeException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="registerServiceResponse">
+ <xs:element name="validateDeploymentPolicy">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="partitions" nillable="true" type="ax26:Partition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidCartridgeDefinitionException">
+ <xs:element name="validateDeploymentPolicyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidCartridgeDefinitionException" nillable="true" type="ax23:InvalidCartridgeDefinitionException"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidIaasProviderException">
+ <xs:element name="CloudControllerServiceUnregisteredClusterException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidIaasProviderException" nillable="true" type="ax23:InvalidIaasProviderException"/>
+ <xs:element minOccurs="0" name="UnregisteredClusterException" nillable="true" type="ax21:UnregisteredClusterException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="deployCartridgeDefinition">
+ <xs:element name="unregisterService">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridgeConfig" nillable="true" type="ax21:CartridgeConfig"/>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidCartridgeTypeException">
+ <xs:element name="undeployCartridgeDefinition">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidCartridgeTypeException" nillable="true" type="ax23:InvalidCartridgeTypeException"/>
+ <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="undeployCartridgeDefinition">
+ <xs:element name="CloudControllerServiceInvalidMemberException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="InvalidMemberException" nillable="true" type="ax21:InvalidMemberException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidPartitionException">
+ <xs:element name="terminateInstance">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidPartitionException" nillable="true" type="ax23:InvalidPartitionException"/>
+ <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="validatePartition">
+ <xs:element name="CloudControllerServiceInvalidClusterException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="partition" nillable="true" type="ax27:Partition"/>
+ <xs:element minOccurs="0" name="InvalidClusterException" nillable="true" type="ax21:InvalidClusterException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="validatePartitionResponse">
+ <xs:element name="terminateAllInstances">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="validateDeploymentPolicy">
+ <xs:element name="CloudControllerServiceUnregisteredCartridgeException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="partitions" nillable="true" type="ax27:Partition"/>
+ <xs:element minOccurs="0" name="UnregisteredCartridgeException" nillable="true" type="ax21:UnregisteredCartridgeException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="validateDeploymentPolicyResponse">
+ <xs:element name="CloudControllerServiceInvalidIaasProviderException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="InvalidIaasProviderException" nillable="true" type="ax21:InvalidIaasProviderException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="startInstance">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="memberContext" nillable="true" type="ax21:MemberContext"/>
+ <xs:element minOccurs="0" name="memberContext" nillable="true" type="ax28:MemberContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="startInstanceResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax21:MemberContext"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax28:MemberContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidMemberException">
+ <xs:element name="registerService">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidMemberException" nillable="true" type="ax23:InvalidMemberException"/>
+ <xs:element minOccurs="0" name="registrant" nillable="true" type="ax28:Registrant"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="terminateInstance">
+ <xs:element name="registerServiceResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceInvalidClusterException">
+ <xs:element name="getRegisteredCartridges">
<xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" name="InvalidClusterException" nillable="true" type="ax23:InvalidClusterException"/>
- </xs:sequence>
+ <xs:sequence/>
</xs:complexType>
</xs:element>
- <xs:element name="terminateAllInstances">
+ <xs:element name="getRegisteredCartridgesResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="CloudControllerServiceUnregisteredClusterException">
+ <xs:element name="getClusterContext">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="UnregisteredClusterException" nillable="true" type="ax23:UnregisteredClusterException"/>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="unregisterService">
+ <xs:element name="getClusterContextResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax28:ClusterContext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -218,48 +217,72 @@
<xs:element name="getCartridgeInfoResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax21:CartridgeInfo"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax28:CartridgeInfo"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getRegisteredCartridges">
+ <xs:element name="CloudControllerServiceInvalidCartridgeDefinitionException">
<xs:complexType>
- <xs:sequence/>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="InvalidCartridgeDefinitionException" nillable="true" type="ax21:InvalidCartridgeDefinitionException"/>
+ </xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getRegisteredCartridgesResponse">
+ <xs:element name="deployCartridgeDefinition">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="cartridgeConfig" nillable="true" type="ax28:CartridgeConfig"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
- <xs:schema xmlns:ax26="http://pojo.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.deployment.controller.cloud.stratos.apache.org/xsd">
- <xs:import namespace="http://pojo.controller.cloud.stratos.apache.org/xsd"/>
- <xs:complexType name="Partition">
+ <xs:schema xmlns:ax27="http://partition.deployment.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://pojo.controller.cloud.stratos.apache.org/xsd">
+ <xs:import namespace="http://partition.deployment.controller.cloud.stratos.apache.org/xsd"/>
+ <xs:complexType name="Properties">
<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="partitionMax" type="xs:int"/>
- <xs:element minOccurs="0" name="partitionMin" type="xs:int"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax21:Properties"/>
- <xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax24:Property"/>
</xs:sequence>
</xs:complexType>
- </xs:schema>
- <xs:schema xmlns:ax28="http://partition.deployment.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://pojo.controller.cloud.stratos.apache.org/xsd">
- <xs:import namespace="http://partition.deployment.controller.cloud.stratos.apache.org/xsd"/>
- <xs:complexType name="ClusterContext">
+ <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:sequence>
+ </xs:complexType>
+ <xs:complexType name="MemberContext">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="allocatedIpAddress" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="initTime" type="xs:long"/>
+ <xs:element minOccurs="0" name="instanceId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="lbClusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="nodeId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="partition" nillable="true" type="ax27:Partition"/>
+ <xs:element minOccurs="0" name="privateIpAddress" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax24:Properties"/>
+ <xs:element minOccurs="0" name="publicIpAddress" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Registrant">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="autoScalerPolicyName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="deploymentPolicyName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="lbCluster" type="xs:boolean"/>
<xs:element minOccurs="0" name="payload" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="timeoutInMillis" type="xs:long"/>
- <xs:element minOccurs="0" name="volumeRequired" type="xs:boolean"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax21:Volume"/>
+ <xs:element minOccurs="0" name="persistence" nillable="true" type="ax24:Persistence"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax24:Properties"/>
+ <xs:element minOccurs="0" name="tenantRange" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Persistence">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="persistanceRequired" type="xs:boolean"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax24:Volume"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Volume">
@@ -274,52 +297,74 @@
<xs:element minOccurs="0" name="volumeId" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="Registrant">
+ <xs:complexType name="ClusterContext">
<xs:sequence>
- <xs:element minOccurs="0" name="autoScalerPolicyName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="deploymentPolicyName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="hostName" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="lbCluster" type="xs:boolean"/>
<xs:element minOccurs="0" name="payload" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="persistence" nillable="true" type="ax21:Persistence"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax21:Properties"/>
- <xs:element minOccurs="0" name="tenantRange" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="timeoutInMillis" type="xs:long"/>
+ <xs:element minOccurs="0" name="volumeRequired" type="xs:boolean"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax24:Volume"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="Persistence">
+ <xs:complexType name="CartridgeInfo">
<xs:sequence>
- <xs:element minOccurs="0" name="persistanceRequired" type="xs:boolean"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="volumes" nillable="true" type="ax21:Volume"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="appTypes" nillable="true" type="ax24:AppType"/>
+ <xs:element minOccurs="0" name="baseDir" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="defaultAutoscalingPolicy" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="defaultDeploymentPolicy" nillable="true" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="deploymentDirs" nillable="true" type="xs:string"/>
+ <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="hostName" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="lbConfig" nillable="true" type="ax24:LoadbalancerConfig"/>
+ <xs:element minOccurs="0" name="multiTenant" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="persistence" nillable="true" type="ax24:Persistence"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="portMappings" nillable="true" type="ax24:PortMapping"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax24:Property"/>
+ <xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="serviceGroup" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="type" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="version" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="Properties">
+ <xs:complexType name="AppType">
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax21:Property"/>
+ <xs:element minOccurs="0" name="appSpecificMapping" type="xs:boolean"/>
+ <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="Property">
+ <xs:complexType name="LoadbalancerConfig">
<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="properties" nillable="true" type="ax24:Properties"/>
+ <xs:element minOccurs="0" name="type" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="PortMapping">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="port" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="protocol" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="proxyPort" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CartridgeConfig">
<xs:sequence>
<xs:element minOccurs="0" name="baseDir" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="container" nillable="true" type="ax21:Container"/>
+ <xs:element minOccurs="0" name="container" nillable="true" type="ax24:Container"/>
<xs:element minOccurs="0" name="defaultAutoscalingPolicy" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="defaultDeploymentPolicy" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="deploymentDirs" nillable="true" type="xs:string"/>
<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="hostName" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="iaasConfigs" nillable="true" type="ax21:IaasConfig"/>
- <xs:element minOccurs="0" name="lbConfig" nillable="true" type="ax21:LoadbalancerConfig"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="iaasConfigs" nillable="true" type="ax24:IaasConfig"/>
+ <xs:element minOccurs="0" name="lbConfig" nillable="true" type="ax24:LoadbalancerConfig"/>
<xs:element minOccurs="0" name="multiTenant" type="xs:boolean"/>
- <xs:element minOccurs="0" name="persistence" nillable="true" type="ax21:Persistence"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="portMappings" nillable="true" type="ax21:PortMapping"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax21:Properties"/>
+ <xs:element minOccurs="0" name="persistence" nillable="true" type="ax24:Persistence"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="portMappings" nillable="true" type="ax24:PortMapping"/>
+ <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="serviceGroup" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="type" nillable="true" type="xs:string"/>
@@ -341,16 +386,16 @@
<xs:element minOccurs="0" name="imageId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="maxInstanceLimit" type="xs:int"/>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="networkInterfaces" nillable="true" type="ax21:NetworkInterfaces"/>
+ <xs:element minOccurs="0" name="networkInterfaces" nillable="true" type="ax24:NetworkInterfaces"/>
<xs:element minOccurs="0" name="payload" nillable="true" type="xs:base64Binary"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax21:Properties"/>
+ <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="type" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NetworkInterfaces">
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="networkInterfaces" nillable="true" type="ax21:NetworkInterface"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="networkInterfaces" nillable="true" type="ax24:NetworkInterface"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NetworkInterface">
@@ -360,61 +405,17 @@
<xs:element minOccurs="0" name="portUuid" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="LoadbalancerConfig">
- <xs:sequence>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax21:Properties"/>
- <xs:element minOccurs="0" name="type" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="PortMapping">
- <xs:sequence>
- <xs:element minOccurs="0" name="port" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="protocol" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="proxyPort" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="MemberContext">
- <xs:sequence>
- <xs:element minOccurs="0" name="allocatedIpAddress" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="cartridgeType" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="clusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="initTime" type="xs:long"/>
- <xs:element minOccurs="0" name="instanceId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="lbClusterId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="memberId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="networkPartitionId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="nodeId" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="partition" nillable="true" type="ax28:Partition"/>
- <xs:element minOccurs="0" name="privateIpAddress" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax21:Properties"/>
- <xs:element minOccurs="0" name="publicIpAddress" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="CartridgeInfo">
+ </xs:schema>
+ <xs:schema xmlns:ax25="http://pojo.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.deployment.controller.cloud.stratos.apache.org/xsd">
+ <xs:import namespace="http://pojo.controller.cloud.stratos.apache.org/xsd"/>
+ <xs:complexType name="Partition">
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="appTypes" nillable="true" type="ax21:AppType"/>
- <xs:element minOccurs="0" name="baseDir" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="defaultAutoscalingPolicy" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="defaultDeploymentPolicy" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="deploymentDirs" nillable="true" type="xs:string"/>
<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="hostName" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="lbConfig" nillable="true" type="ax21:LoadbalancerConfig"/>
- <xs:element minOccurs="0" name="multiTenant" type="xs:boolean"/>
- <xs:element minOccurs="0" name="persistence" nillable="true" type="ax21:Persistence"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="portMappings" nillable="true" type="ax21:PortMapping"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax21:Property"/>
+ <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="partitionMax" type="xs:int"/>
+ <xs:element minOccurs="0" name="partitionMin" type="xs:int"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
<xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="serviceGroup" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="type" nillable="true" type="xs:string"/>
- <xs:element minOccurs="0" name="version" nillable="true" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="AppType">
- <xs:sequence>
- <xs:element minOccurs="0" name="appSpecificMapping" type="xs:boolean"/>
- <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
@@ -588,18 +589,6 @@
<soap:fault use="literal" name="CloudControllerServiceInvalidCartridgeTypeException"/>
</wsdl:fault>
</wsdl:operation>
- <wsdl:operation name="terminateInstance">
- <soap:operation soapAction="urn:terminateInstance" style="document"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:fault name="CloudControllerServiceInvalidMemberException">
- <soap:fault use="literal" name="CloudControllerServiceInvalidMemberException"/>
- </wsdl:fault>
- <wsdl:fault name="CloudControllerServiceInvalidCartridgeTypeException">
- <soap:fault use="literal" name="CloudControllerServiceInvalidCartridgeTypeException"/>
- </wsdl:fault>
- </wsdl:operation>
<wsdl:operation name="registerService">
<soap:operation soapAction="urn:registerService" style="document"/>
<wsdl:input>
@@ -612,6 +601,18 @@
<soap:fault use="literal" name="CloudControllerServiceUnregisteredCartridgeException"/>
</wsdl:fault>
</wsdl:operation>
+ <wsdl:operation name="terminateInstance">
+ <soap:operation soapAction="urn:terminateInstance" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:fault name="CloudControllerServiceInvalidMemberException">
+ <soap:fault use="literal" name="CloudControllerServiceInvalidMemberException"/>
+ </wsdl:fault>
+ <wsdl:fault name="CloudControllerServiceInvalidCartridgeTypeException">
+ <soap:fault use="literal" name="CloudControllerServiceInvalidCartridgeTypeException"/>
+ </wsdl:fault>
+ </wsdl:operation>
<wsdl:operation name="deployCartridgeDefinition">
<soap:operation soapAction="urn:deployCartridgeDefinition" style="document"/>
<wsdl:input>
@@ -726,18 +727,6 @@
<soap12:fault use="literal" name="CloudControllerServiceInvalidCartridgeTypeException"/>
</wsdl:fault>
</wsdl:operation>
- <wsdl:operation name="terminateInstance">
- <soap12:operation soapAction="urn:terminateInstance" style="document"/>
- <wsdl:input>
- <soap12:body use="literal"/>
- </wsdl:input>
- <wsdl:fault name="CloudControllerServiceInvalidMemberException">
- <soap12:fault use="literal" name="CloudControllerServiceInvalidMemberException"/>
- </wsdl:fault>
- <wsdl:fault name="CloudControllerServiceInvalidCartridgeTypeException">
- <soap12:fault use="literal" name="CloudControllerServiceInvalidCartridgeTypeException"/>
- </wsdl:fault>
- </wsdl:operation>
<wsdl:operation name="registerService">
<soap12:operation soapAction="urn:registerService" style="document"/>
<wsdl:input>
@@ -750,6 +739,18 @@
<soap12:fault use="literal" name="CloudControllerServiceUnregisteredCartridgeException"/>
</wsdl:fault>
</wsdl:operation>
+ <wsdl:operation name="terminateInstance">
+ <soap12:operation soapAction="urn:terminateInstance" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:fault name="CloudControllerServiceInvalidMemberException">
+ <soap12:fault use="literal" name="CloudControllerServiceInvalidMemberException"/>
+ </wsdl:fault>
+ <wsdl:fault name="CloudControllerServiceInvalidCartridgeTypeException">
+ <soap12:fault use="literal" name="CloudControllerServiceInvalidCartridgeTypeException"/>
+ </wsdl:fault>
+ </wsdl:operation>
<wsdl:operation name="deployCartridgeDefinition">
<soap12:operation soapAction="urn:deployCartridgeDefinition" style="document"/>
<wsdl:input>
@@ -855,12 +856,6 @@
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="terminateInstance">
- <http:operation location="terminateInstance"/>
- <wsdl:input>
- <mime:content type="text/xml" part="parameters"/>
- </wsdl:input>
- </wsdl:operation>
<wsdl:operation name="registerService">
<http:operation location="registerService"/>
<wsdl:input>
@@ -870,6 +865,12 @@
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="terminateInstance">
+ <http:operation location="terminateInstance"/>
+ <wsdl:input>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:input>
+ </wsdl:operation>
<wsdl:operation name="deployCartridgeDefinition">
<http:operation location="deployCartridgeDefinition"/>
<wsdl:input>
[08/12] git commit: Add initial Kubernetes model
Posted by ra...@apache.org.
Add initial Kubernetes model
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/c3cd37e5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/c3cd37e5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/c3cd37e5
Branch: refs/heads/docker-integration
Commit: c3cd37e541633348304aaa3f10673c004e46d9bd
Parents: 4999fa8
Author: Akila Perera <ra...@gmail.com>
Authored: Thu Sep 11 03:45:27 2014 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Thu Sep 11 03:45:27 2014 +0530
----------------------------------------------------------------------
.../org.apache.stratos.autoscaler/pom.xml | 6 +
.../autoscaler/api/AutoScalerServiceImpl.java | 292 +++++++++++--------
.../InvalidKubernetesGroupException.java | 49 ++++
.../InvalidKubernetesHostException.java | 49 ++++
.../InvalidKubernetesMasterException.java | 27 ++
.../NonExistingKubernetesGroupException.java | 49 ++++
.../NonExistingKubernetesHostException.java | 48 +++
.../NonExistingKubernetesMasterException.java | 48 +++
.../interfaces/AutoScalerServiceInterface.java | 170 +++++++----
.../kubernetes/KubernetesManager.java | 26 ++
.../common/kubernetes/KubernetesGroup.java | 66 +++++
.../common/kubernetes/KubernetesHost.java | 70 +++++
.../common/kubernetes/KubernetesMaster.java | 36 +++
.../stratos/common/kubernetes/PortRange.java | 44 +++
.../stratos/common/kubernetes/Properties.java | 46 +++
.../stratos/common/kubernetes/Property.java | 62 ++++
.../KubernetesGroupDoesNotExistException.java | 65 +++++
.../KubernetesHostAlreadyDeployedException.java | 65 +++++
.../KubernetesHostDoesNotExistException.java | 67 +++++
.../KubernetesMasterDoesNotExistException.java | 68 +++++
.../rest/endpoint/services/ServiceUtils.java | 194 +++++++-----
.../rest/endpoint/services/StratosAdmin.java | 83 ++++++
.../src/main/resources/AutoScalerService.wsdl | 8 +
23 files changed, 1380 insertions(+), 258 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.autoscaler/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/pom.xml b/components/org.apache.stratos.autoscaler/pom.xml
index 35d03da..9234fc0 100644
--- a/components/org.apache.stratos.autoscaler/pom.xml
+++ b/components/org.apache.stratos.autoscaler/pom.xml
@@ -153,6 +153,12 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.common</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.utils</artifactId>
<version>4.2.0</version>
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/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 897fd4e..22b6a0d 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
@@ -23,123 +23,163 @@ import org.apache.commons.logging.LogFactory;
import org.apache.stratos.autoscaler.NetworkPartitionLbHolder;
import org.apache.stratos.autoscaler.client.cloud.controller.CloudControllerClient;
import org.apache.stratos.autoscaler.deployment.policy.DeploymentPolicy;
-import org.apache.stratos.autoscaler.exception.InvalidPartitionException;
-import org.apache.stratos.autoscaler.exception.InvalidPolicyException;
-import org.apache.stratos.autoscaler.exception.NonExistingLBException;
-import org.apache.stratos.autoscaler.exception.PartitionValidationException;
+import org.apache.stratos.autoscaler.exception.*;
import org.apache.stratos.autoscaler.interfaces.AutoScalerServiceInterface;
import org.apache.stratos.autoscaler.partition.PartitionGroup;
import org.apache.stratos.autoscaler.partition.PartitionManager;
import org.apache.stratos.autoscaler.policy.PolicyManager;
import org.apache.stratos.autoscaler.policy.model.AutoscalePolicy;
import org.apache.stratos.cloud.controller.stub.deployment.partition.Partition;
+import org.apache.stratos.common.kubernetes.KubernetesGroup;
+import org.apache.stratos.common.kubernetes.KubernetesHost;
+import org.apache.stratos.common.kubernetes.KubernetesMaster;
import java.util.ArrayList;
/**
* Auto Scaler Service API is responsible getting Partitions and Policies.
*/
-public class AutoScalerServiceImpl implements AutoScalerServiceInterface{
-
- private static final Log log = LogFactory.getLog(AutoScalerServiceImpl.class);
- PartitionManager partitionManager = PartitionManager.getInstance();
-
- public Partition[] getAllAvailablePartitions(){
- return partitionManager.getAllPartitions();
- }
-
- public DeploymentPolicy[] getAllDeploymentPolicies(){
- return PolicyManager.getInstance().getDeploymentPolicyList();
- }
-
- public AutoscalePolicy[] getAllAutoScalingPolicy(){
- return PolicyManager.getInstance().getAutoscalePolicyList();
- }
-
- @Override
- public DeploymentPolicy[] getValidDeploymentPoliciesforCartridge(String cartridgeType) {
- ArrayList<DeploymentPolicy> validPolicies = new ArrayList<DeploymentPolicy>();
-
- for(DeploymentPolicy deploymentPolicy : this.getAllDeploymentPolicies()){
+public class AutoScalerServiceImpl implements AutoScalerServiceInterface {
+
+ private static final Log log = LogFactory.getLog(AutoScalerServiceImpl.class);
+ PartitionManager partitionManager = PartitionManager.getInstance();
+
+ public Partition[] getAllAvailablePartitions() {
+ return partitionManager.getAllPartitions();
+ }
+
+ public DeploymentPolicy[] getAllDeploymentPolicies() {
+ return PolicyManager.getInstance().getDeploymentPolicyList();
+ }
+
+ public AutoscalePolicy[] getAllAutoScalingPolicy() {
+ return PolicyManager.getInstance().getAutoscalePolicyList();
+ }
+
+ @Override
+ public DeploymentPolicy[] getValidDeploymentPoliciesforCartridge(String cartridgeType) {
+ ArrayList<DeploymentPolicy> validPolicies = new ArrayList<DeploymentPolicy>();
+
+ for (DeploymentPolicy deploymentPolicy : this.getAllDeploymentPolicies()) {
try {
// call CC API
CloudControllerClient.getInstance().validateDeploymentPolicy(cartridgeType, deploymentPolicy);
// if this deployment policy is valid for this cartridge, add it.
- validPolicies.add(deploymentPolicy);
+ validPolicies.add(deploymentPolicy);
} catch (PartitionValidationException ignoredException) {
// if this policy doesn't valid for the given cartridge, add a debug log.
if (log.isDebugEnabled()) {
- log.debug("Deployment policy [id] "+deploymentPolicy.getId()
- +" is not valid for Cartridge [type] "+cartridgeType, ignoredException);
+ log.debug("Deployment policy [id] " + deploymentPolicy.getId()
+ + " is not valid for Cartridge [type] " + cartridgeType, ignoredException);
}
}
- }
- return validPolicies.toArray(new DeploymentPolicy[0]);
- }
+ }
+ return validPolicies.toArray(new DeploymentPolicy[0]);
+ }
- @Override
- public boolean addPartition(Partition partition) throws InvalidPartitionException {
+ @Override
+ public boolean addPartition(Partition partition) throws InvalidPartitionException {
return partitionManager.addNewPartition(partition);
- }
-
- @Override
- public boolean addDeploymentPolicy(DeploymentPolicy depPolicy) throws InvalidPolicyException {
- return PolicyManager.getInstance().deployDeploymentPolicy(depPolicy);
- }
-
- @Override
- public boolean addAutoScalingPolicy(AutoscalePolicy aspolicy) throws InvalidPolicyException {
- return PolicyManager.getInstance().deployAutoscalePolicy(aspolicy);
- }
-
- @Override
- public Partition getPartition(String partitionId) {
- return partitionManager.getPartitionById(partitionId);
- }
-
- @Override
- public DeploymentPolicy getDeploymentPolicy(String deploymentPolicyId) {
- return PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyId);
- }
-
- @Override
- public AutoscalePolicy getAutoscalingPolicy(String autoscalingPolicyId) {
- return PolicyManager.getInstance().getAutoscalePolicy(autoscalingPolicyId);
- }
-
- @Override
- public PartitionGroup[] getPartitionGroups(String deploymentPolicyId) {
- return PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyId).getPartitionGroups();
- }
-
- public Partition[] getPartitionsOfDeploymentPolicy(String deploymentPolicyId) {
- DeploymentPolicy depPol = this.getDeploymentPolicy(deploymentPolicyId);
- if(null == depPol) {
- return null;
- }
-
- return depPol.getAllPartitions();
- }
-
- @Override
+ }
+
+ @Override
+ public boolean addDeploymentPolicy(DeploymentPolicy depPolicy) throws InvalidPolicyException {
+ return PolicyManager.getInstance().deployDeploymentPolicy(depPolicy);
+ }
+
+ @Override
+ public boolean addAutoScalingPolicy(AutoscalePolicy aspolicy) throws InvalidPolicyException {
+ return PolicyManager.getInstance().deployAutoscalePolicy(aspolicy);
+ }
+
+ @Override
+ public Partition getPartition(String partitionId) {
+ return partitionManager.getPartitionById(partitionId);
+ }
+
+ @Override
+ public DeploymentPolicy getDeploymentPolicy(String deploymentPolicyId) {
+ return PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyId);
+ }
+
+ @Override
+ public AutoscalePolicy getAutoscalingPolicy(String autoscalingPolicyId) {
+ return PolicyManager.getInstance().getAutoscalePolicy(autoscalingPolicyId);
+ }
+
+ @Override
+ public PartitionGroup[] getPartitionGroups(String deploymentPolicyId) {
+ return PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyId).getPartitionGroups();
+ }
+
+ public Partition[] getPartitionsOfDeploymentPolicy(String deploymentPolicyId) {
+ DeploymentPolicy depPol = this.getDeploymentPolicy(deploymentPolicyId);
+ if (null == depPol) {
+ return null;
+ }
+
+ return depPol.getAllPartitions();
+ }
+
+
+ @Override
+ public boolean addKubernetesGroup(KubernetesGroup kubernetesGroup) throws InvalidKubernetesGroupException {
+ //TODO
+ return false;
+ }
+
+ @Override
+ public boolean addKubernetesHost(String groupId, KubernetesHost kubernetesHost) throws
+ InvalidKubernetesHostException, NonExistingKubernetesGroupException {
+ //TODO
+ return false;
+ }
+
+ @Override
+ public boolean updateKubernetesHost(String groupId, KubernetesHost kubernetesHost) throws
+ InvalidKubernetesHostException, NonExistingKubernetesGroupException {
+ //TODO
+ return false;
+ }
+
+ @Override
+ public boolean removeKubernetesGroup(String groupId) throws NonExistingKubernetesGroupException {
+ //TODO
+ return false;
+ }
+
+ @Override
+ public boolean removeKubernetesHost(String hostId) throws NonExistingKubernetesHostException {
+ //TODO
+ return false;
+ }
+
+ @Override
+ public boolean updateKubernetesMaster(KubernetesMaster kubernetesMaster) throws
+ NonExistingKubernetesMasterException {
+ //TODO
+ return false;
+ }
+
+ @Override
public Partition[] getPartitionsOfGroup(String deploymentPolicyId, String groupId) {
DeploymentPolicy depPol = this.getDeploymentPolicy(deploymentPolicyId);
- if(null == depPol) {
+ if (null == depPol) {
return null;
}
-
+
PartitionGroup group = depPol.getPartitionGroup(groupId);
-
- if(group == null) {
+
+ if (group == null) {
return null;
}
-
+
return group.getPartitions();
}
-
- public void checkLBExistenceAgainstPolicy(String lbClusterId, String deploymentPolicyId) throws NonExistingLBException {
-
- boolean exist = false;
+
+ public void checkLBExistenceAgainstPolicy(String lbClusterId, String deploymentPolicyId) throws NonExistingLBException {
+
+ boolean exist = false;
for (PartitionGroup partitionGroup : PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyId).getPartitionGroups()) {
NetworkPartitionLbHolder nwPartitionLbHolder = partitionManager.getNetworkPartitionLbHolder(partitionGroup.getId());
@@ -149,16 +189,16 @@ public class AutoScalerServiceImpl implements AutoScalerServiceInterface{
break;
}
}
-
- if(!exist) {
- String msg = "LB with [cluster id] "+lbClusterId+
- " does not exist in any network partition of [Deployment Policy] "+deploymentPolicyId;
+
+ if (!exist) {
+ String msg = "LB with [cluster id] " + lbClusterId +
+ " does not exist in any network partition of [Deployment Policy] " + deploymentPolicyId;
log.error(msg);
throw new NonExistingLBException(msg);
}
- }
-
- public boolean checkDefaultLBExistenceAgainstPolicy(String deploymentPolicyId) {
+ }
+
+ public boolean checkDefaultLBExistenceAgainstPolicy(String deploymentPolicyId) {
for (PartitionGroup partitionGroup : PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyId).getPartitionGroups()) {
@@ -167,23 +207,23 @@ public class AutoScalerServiceImpl implements AutoScalerServiceInterface{
if (!nwPartitionLbHolder.isDefaultLBExist()) {
if (log.isDebugEnabled()) {
log.debug("Default LB does not exist in [network partition] " +
- nwPartitionLbHolder.getNetworkPartitionId() + " of [Deployment Policy] " +
- deploymentPolicyId);
+ nwPartitionLbHolder.getNetworkPartitionId() + " of [Deployment Policy] " +
+ deploymentPolicyId);
}
return false;
}
}
-
+
return true;
-
+
}
- public String getDefaultLBClusterId (String deploymentPolicyName) {
- if(log.isDebugEnabled()) {
- log.debug("Default LB Cluster Id for Deployment Policy ["+deploymentPolicyName+"] ");
- }
+ public String getDefaultLBClusterId(String deploymentPolicyName) {
+ if (log.isDebugEnabled()) {
+ log.debug("Default LB Cluster Id for Deployment Policy [" + deploymentPolicyName + "] ");
+ }
for (PartitionGroup partitionGroup : PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyName).getPartitionGroups()) {
NetworkPartitionLbHolder nwPartitionLbHolder = partitionManager.getNetworkPartitionLbHolder(partitionGroup.getId());
@@ -202,30 +242,30 @@ public class AutoScalerServiceImpl implements AutoScalerServiceInterface{
return null;
}
-
- public boolean checkServiceLBExistenceAgainstPolicy(String serviceName, String deploymentPolicyId) {
+
+ public boolean checkServiceLBExistenceAgainstPolicy(String serviceName, String deploymentPolicyId) {
for (PartitionGroup partitionGroup : PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyId).getPartitionGroups()) {
- NetworkPartitionLbHolder nwPartitionLbHolder = partitionManager.getNetworkPartitionLbHolder(partitionGroup.getId());
+ NetworkPartitionLbHolder nwPartitionLbHolder = partitionManager.getNetworkPartitionLbHolder(partitionGroup.getId());
- if (!nwPartitionLbHolder.isServiceLBExist(serviceName)) {
- if (log.isDebugEnabled()) {
- log.debug("Service LB [service name] "+serviceName+" does not exist in [network partition] " +
- nwPartitionLbHolder.getNetworkPartitionId() + " of [Deployment Policy] " +
- deploymentPolicyId);
+ if (!nwPartitionLbHolder.isServiceLBExist(serviceName)) {
+ if (log.isDebugEnabled()) {
+ log.debug("Service LB [service name] " + serviceName + " does not exist in [network partition] " +
+ nwPartitionLbHolder.getNetworkPartitionId() + " of [Deployment Policy] " +
+ deploymentPolicyId);
- }
- return false;
}
+ return false;
+ }
}
-
+
return true;
-
+
}
- public String getServiceLBClusterId (String serviceType, String deploymentPolicyName) {
+ public String getServiceLBClusterId(String serviceType, String deploymentPolicyName) {
for (PartitionGroup partitionGroup : PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyName).getPartitionGroups()) {
@@ -233,7 +273,7 @@ public class AutoScalerServiceImpl implements AutoScalerServiceInterface{
if (nwPartitionLbHolder.isServiceLBExist(serviceType)) {
if (log.isDebugEnabled()) {
- log.debug("Service LB [service name] "+serviceType+" does not exist in [network partition] " +
+ log.debug("Service LB [service name] " + serviceType + " does not exist in [network partition] " +
nwPartitionLbHolder.getNetworkPartitionId() + " of [Deployment Policy] " +
deploymentPolicyName);
@@ -245,27 +285,27 @@ public class AutoScalerServiceImpl implements AutoScalerServiceInterface{
return null;
}
-
- public boolean checkClusterLBExistenceAgainstPolicy(String clusterId, String deploymentPolicyId) {
+
+ public boolean checkClusterLBExistenceAgainstPolicy(String clusterId, String deploymentPolicyId) {
for (PartitionGroup partitionGroup : PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyId).getPartitionGroups()) {
- NetworkPartitionLbHolder nwPartitionLbHolder = partitionManager.getNetworkPartitionLbHolder(partitionGroup.getId());
+ NetworkPartitionLbHolder nwPartitionLbHolder = partitionManager.getNetworkPartitionLbHolder(partitionGroup.getId());
- if (!nwPartitionLbHolder.isClusterLBExist(clusterId)) {
- if (log.isDebugEnabled()) {
- log.debug("Cluster LB [cluster id] "+clusterId+" does not exist in [network partition] " +
- nwPartitionLbHolder.getNetworkPartitionId() + " of [Deployment Policy] " +
- deploymentPolicyId);
+ if (!nwPartitionLbHolder.isClusterLBExist(clusterId)) {
+ if (log.isDebugEnabled()) {
+ log.debug("Cluster LB [cluster id] " + clusterId + " does not exist in [network partition] " +
+ nwPartitionLbHolder.getNetworkPartitionId() + " of [Deployment Policy] " +
+ deploymentPolicyId);
- }
- return false;
}
+ return false;
+ }
}
-
+
return true;
-
+
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/InvalidKubernetesGroupException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/InvalidKubernetesGroupException.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/InvalidKubernetesGroupException.java
new file mode 100644
index 0000000..4613d22
--- /dev/null
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/InvalidKubernetesGroupException.java
@@ -0,0 +1,49 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+package org.apache.stratos.autoscaler.exception;
+
+/**
+ * Exception class for handling invalid Kubernetes Group
+ */
+public class InvalidKubernetesGroupException extends Exception {
+
+ private String message;
+
+ public InvalidKubernetesGroupException(String message, Exception exception){
+ super(message, exception);
+ this.message = message;
+ }
+
+ public InvalidKubernetesGroupException(Exception exception){
+ super(exception);
+ }
+
+ public InvalidKubernetesGroupException(String msg){
+ super(msg);
+ this.message = msg;
+ }
+
+ @Override
+ public String getMessage() {
+ return this.message;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/InvalidKubernetesHostException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/InvalidKubernetesHostException.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/InvalidKubernetesHostException.java
new file mode 100644
index 0000000..461ec26
--- /dev/null
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/InvalidKubernetesHostException.java
@@ -0,0 +1,49 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+package org.apache.stratos.autoscaler.exception;
+
+/**
+ * Exception class for handling invalid Kubernetes Host
+ */
+public class InvalidKubernetesHostException extends Exception {
+
+ private String message;
+
+ public InvalidKubernetesHostException(String message, Exception exception){
+ super(message, exception);
+ this.message = message;
+ }
+
+ public InvalidKubernetesHostException(Exception exception){
+ super(exception);
+ }
+
+ public InvalidKubernetesHostException(String msg){
+ super(msg);
+ this.message = msg;
+ }
+
+ @Override
+ public String getMessage() {
+ return this.message;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/InvalidKubernetesMasterException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/InvalidKubernetesMasterException.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/InvalidKubernetesMasterException.java
new file mode 100644
index 0000000..341e03d
--- /dev/null
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/InvalidKubernetesMasterException.java
@@ -0,0 +1,27 @@
+package org.apache.stratos.autoscaler.exception;
+
+/**
+ * Exception class for handling invalid Kubernetes Master
+ */
+public class InvalidKubernetesMasterException extends Exception {
+ private String message;
+
+ public InvalidKubernetesMasterException(String message, Exception exception){
+ super(message, exception);
+ this.message = message;
+ }
+
+ public InvalidKubernetesMasterException(Exception exception){
+ super(exception);
+ }
+
+ public InvalidKubernetesMasterException(String msg){
+ super(msg);
+ this.message = msg;
+ }
+
+ @Override
+ public String getMessage() {
+ return this.message;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/NonExistingKubernetesGroupException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/NonExistingKubernetesGroupException.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/NonExistingKubernetesGroupException.java
new file mode 100644
index 0000000..0024911
--- /dev/null
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/NonExistingKubernetesGroupException.java
@@ -0,0 +1,49 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+package org.apache.stratos.autoscaler.exception;
+
+/**
+ * Exception class for handling non-existing Kubernetes Group
+ */
+public class NonExistingKubernetesGroupException extends Exception {
+
+ private String message;
+
+ public NonExistingKubernetesGroupException(String message, Exception exception){
+ super(message, exception);
+ this.message = message;
+ }
+
+ public NonExistingKubernetesGroupException(Exception exception){
+ super(exception);
+ }
+
+ public NonExistingKubernetesGroupException(String msg){
+ super(msg);
+ this.message = msg;
+ }
+
+ @Override
+ public String getMessage() {
+ return this.message;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/NonExistingKubernetesHostException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/NonExistingKubernetesHostException.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/NonExistingKubernetesHostException.java
new file mode 100644
index 0000000..283631c
--- /dev/null
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/NonExistingKubernetesHostException.java
@@ -0,0 +1,48 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+package org.apache.stratos.autoscaler.exception;
+
+/**
+ * Exception class for handling non-existing Kubernetes Host
+ */
+public class NonExistingKubernetesHostException extends Exception {
+ private String message;
+
+ public NonExistingKubernetesHostException(String message, Exception exception){
+ super(message, exception);
+ this.message = message;
+ }
+
+ public NonExistingKubernetesHostException(Exception exception){
+ super(exception);
+ }
+
+ public NonExistingKubernetesHostException(String msg){
+ super(msg);
+ this.message = msg;
+ }
+
+ @Override
+ public String getMessage() {
+ return this.message;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/NonExistingKubernetesMasterException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/NonExistingKubernetesMasterException.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/NonExistingKubernetesMasterException.java
new file mode 100644
index 0000000..2e9a666
--- /dev/null
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/NonExistingKubernetesMasterException.java
@@ -0,0 +1,48 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+package org.apache.stratos.autoscaler.exception;
+
+/**
+ * Exception class for handling non-existing Kubernetes Master
+ */
+public class NonExistingKubernetesMasterException extends Exception {
+ private String message;
+
+ public NonExistingKubernetesMasterException(String message, Exception exception){
+ super(message, exception);
+ this.message = message;
+ }
+
+ public NonExistingKubernetesMasterException(Exception exception){
+ super(exception);
+ }
+
+ public NonExistingKubernetesMasterException(String msg){
+ super(msg);
+ this.message = msg;
+ }
+
+ @Override
+ public String getMessage() {
+ return this.message;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/interfaces/AutoScalerServiceInterface.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/interfaces/AutoScalerServiceInterface.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/interfaces/AutoScalerServiceInterface.java
index 9f289ab..e6a73a0 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/interfaces/AutoScalerServiceInterface.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/interfaces/AutoScalerServiceInterface.java
@@ -1,4 +1,3 @@
-package org.apache.stratos.autoscaler.interfaces;
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -20,70 +19,135 @@ package org.apache.stratos.autoscaler.interfaces;
*
*/
+package org.apache.stratos.autoscaler.interfaces;
import org.apache.stratos.autoscaler.deployment.policy.DeploymentPolicy;
-import org.apache.stratos.autoscaler.exception.InvalidPartitionException;
-import org.apache.stratos.autoscaler.exception.InvalidPolicyException;
-import org.apache.stratos.autoscaler.exception.NonExistingLBException;
+import org.apache.stratos.autoscaler.exception.*;
import org.apache.stratos.autoscaler.partition.PartitionGroup;
import org.apache.stratos.autoscaler.policy.model.AutoscalePolicy;
import org.apache.stratos.cloud.controller.stub.deployment.partition.Partition;
+import org.apache.stratos.common.kubernetes.KubernetesGroup;
+import org.apache.stratos.common.kubernetes.KubernetesHost;
+import org.apache.stratos.common.kubernetes.KubernetesMaster;
public interface AutoScalerServiceInterface {
-
- public Partition[] getAllAvailablePartitions();
- public boolean addPartition(Partition partition) throws InvalidPartitionException;
-
- public DeploymentPolicy[] getAllDeploymentPolicies();
- public boolean addDeploymentPolicy(DeploymentPolicy depPolicy) throws InvalidPolicyException;
-
- public AutoscalePolicy[] getAllAutoScalingPolicy();
- public boolean addAutoScalingPolicy(AutoscalePolicy aspolicy) throws InvalidPolicyException;
-
- public DeploymentPolicy[] getValidDeploymentPoliciesforCartridge(String cartridgeType);
-
- public Partition getPartition (String partitionId);
- public DeploymentPolicy getDeploymentPolicy (String deploymentPolicyId);
- public AutoscalePolicy getAutoscalingPolicy (String autoscalingPolicyId);
- public PartitionGroup[] getPartitionGroups (String deploymentPolicyId);
- public Partition[] getPartitionsOfGroup(String deploymentPolicyId, String partitionGroup);
- public Partition[] getPartitionsOfDeploymentPolicy(String deploymentPolicyId);
-
- /**
- * Check existence of a lb cluster in network partitions of a given policy.
- * @param lbClusterId
- * @param deploymentPolicyId
- * @throws NonExistingLBException if the lb cluster id cannot be found in any of the network partitions.
- */
- public void checkLBExistenceAgainstPolicy(String lbClusterId, String deploymentPolicyId) throws NonExistingLBException;
-
- /**
- * Check the existence of default lb in network partitions of a given policy.
- * @param deploymentPolicyId
- * @return true if the LB exists in all the network partitions of this policy,
- * false if a LB couldn't find even in one network partition.
- */
- public boolean checkDefaultLBExistenceAgainstPolicy(String deploymentPolicyId);
-
- /**
- * Check the existence of per cluster lb in network partitions of a given policy.
- * @param clusterId cluster id of the service cluster which requires a dedicated LB.
- * @param deploymentPolicyId
- * @return true if the cluster based LB exists in all the network partitions of this policy,
+
+ public Partition[] getAllAvailablePartitions();
+
+ public boolean addPartition(Partition partition) throws InvalidPartitionException;
+
+ public DeploymentPolicy[] getAllDeploymentPolicies();
+
+ public boolean addDeploymentPolicy(DeploymentPolicy depPolicy) throws InvalidPolicyException;
+
+ public AutoscalePolicy[] getAllAutoScalingPolicy();
+
+ public boolean addAutoScalingPolicy(AutoscalePolicy aspolicy) throws InvalidPolicyException;
+
+ public DeploymentPolicy[] getValidDeploymentPoliciesforCartridge(String cartridgeType);
+
+ public Partition getPartition(String partitionId);
+
+ public DeploymentPolicy getDeploymentPolicy(String deploymentPolicyId);
+
+ public AutoscalePolicy getAutoscalingPolicy(String autoscalingPolicyId);
+
+ public PartitionGroup[] getPartitionGroups(String deploymentPolicyId);
+
+ public Partition[] getPartitionsOfGroup(String deploymentPolicyId, String partitionGroup);
+
+ public Partition[] getPartitionsOfDeploymentPolicy(String deploymentPolicyId);
+
+ /**
+ * Register a Kubernetes cluster.
+ *
+ * @param kubernetesGroup
+ * @throws InvalidKubernetesGroupException
+ */
+ public boolean addKubernetesGroup(KubernetesGroup kubernetesGroup) throws InvalidKubernetesGroupException;
+
+ /**
+ * Add a Kubernetes host to a Kubernetes Group.
+ *
+ * @param groupId
+ * @param kubernetesHost
+ * @throws InvalidKubernetesHostException
+ */
+ public boolean addKubernetesHost(String groupId, KubernetesHost kubernetesHost) throws
+ InvalidKubernetesHostException, NonExistingKubernetesGroupException;
+
+ /**
+ * Update a Kubernetes host.
+ *
+ * @param groupId * @param kubernetesHost
+ * @throws InvalidKubernetesHostException
+ */
+ public boolean updateKubernetesHost(String groupId, KubernetesHost kubernetesHost) throws
+ InvalidKubernetesHostException, NonExistingKubernetesGroupException;
+
+ /**
+ * Remove a Kubernetes host.
+ *
+ * @param groupId
+ * @throws NonExistingKubernetesGroupException
+ */
+ public boolean removeKubernetesGroup(String groupId) throws NonExistingKubernetesGroupException;
+
+ /**
+ * Update a Kubernetes host.
+ *
+ * @param hostId
+ * @throws InvalidKubernetesHostException
+ */
+ public boolean removeKubernetesHost(String hostId) throws NonExistingKubernetesHostException;
+
+ /**
+ * Update a Kubernetes Master in a Kubernetes Group.
+ *
+ * @param kubernetesMaster
+ * @throws NonExistingKubernetesMasterException
+ */
+ public boolean updateKubernetesMaster(KubernetesMaster kubernetesMaster) throws NonExistingKubernetesMasterException;
+
+ /**
+ * Check existence of a lb cluster in network partitions of a given policy.
+ *
+ * @param lbClusterId
+ * @param deploymentPolicyId
+ * @throws NonExistingLBException if the lb cluster id cannot be found in any of the network partitions.
+ */
+ public void checkLBExistenceAgainstPolicy(String lbClusterId, String deploymentPolicyId) throws NonExistingLBException;
+
+ /**
+ * Check the existence of default lb in network partitions of a given policy.
+ *
+ * @param deploymentPolicyId
+ * @return true if the LB exists in all the network partitions of this policy,
+ * false if a LB couldn't find even in one network partition.
+ */
+ public boolean checkDefaultLBExistenceAgainstPolicy(String deploymentPolicyId);
+
+ /**
+ * Check the existence of per cluster lb in network partitions of a given policy.
+ *
+ * @param clusterId cluster id of the service cluster which requires a dedicated LB.
+ * @param deploymentPolicyId
+ * @return true if the cluster based LB exists in all the network partitions of this policy,
* false if a LB couldn't find even in one network partition.
- */
- public boolean checkClusterLBExistenceAgainstPolicy(String clusterId, String deploymentPolicyId);
-
- /**
+ */
+ public boolean checkClusterLBExistenceAgainstPolicy(String clusterId, String deploymentPolicyId);
+
+ /**
* Check the existence of per service lb in network partitions of a given policy.
- * @param serviceName service name of the service cluster which requires a dedicated LB.
- * @param deploymentPolicyId
+ *
+ * @param serviceName service name of the service cluster which requires a dedicated LB.
+ * @param deploymentPolicyId
* @return true if the service based LB exists in all the network partitions of this policy,
* false if a LB couldn't find even in one network partition.
*/
- public boolean checkServiceLBExistenceAgainstPolicy(String serviceName, String deploymentPolicyId);
+ public boolean checkServiceLBExistenceAgainstPolicy(String serviceName, String deploymentPolicyId);
- public String getDefaultLBClusterId (String deploymentPolicyName);
+ public String getDefaultLBClusterId(String deploymentPolicyName);
- public String getServiceLBClusterId (String serviceType, String deploymentPolicyName);
+ public String getServiceLBClusterId(String serviceType, String deploymentPolicyName);
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/kubernetes/KubernetesManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/kubernetes/KubernetesManager.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/kubernetes/KubernetesManager.java
new file mode 100644
index 0000000..3aef357
--- /dev/null
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/kubernetes/KubernetesManager.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.autoscaler.kubernetes;
+
+/**
+ * The model class for managing Kubernetes groups.
+ */
+public class KubernetesManager {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesGroup.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesGroup.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesGroup.java
new file mode 100644
index 0000000..aaf97a0
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesGroup.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.common.kubernetes;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * The model class for KubernetesGroup definition.
+ */
+public class KubernetesGroup implements Serializable {
+
+ private String groupId;
+ private List<KubernetesHost> kubernetesHosts;
+ private List<KubernetesMaster> kubernetesMasters;
+ private PortRange portRange;
+
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+
+ public List<KubernetesHost> getKubernetesHosts() {
+ return kubernetesHosts;
+ }
+
+ public void setKubernetesHosts(List<KubernetesHost> kubernetesHosts) {
+ this.kubernetesHosts = kubernetesHosts;
+ }
+
+ public List<KubernetesMaster> getKubernetesMasters() {
+ return kubernetesMasters;
+ }
+
+ public void setKubernetesMasters(List<KubernetesMaster> kubernetesMasters) {
+ this.kubernetesMasters = kubernetesMasters;
+ }
+
+ public PortRange getPortRange() {
+ return portRange;
+ }
+
+ public void setPortRange(PortRange portRange) {
+ this.portRange = portRange;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesHost.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesHost.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesHost.java
new file mode 100644
index 0000000..3b1da30
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesHost.java
@@ -0,0 +1,70 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+package org.apache.stratos.common.kubernetes;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.Serializable;
+
+/**
+ * The model class for KubernetesHost beans. This represents a Kubernetes CoreOS host instance
+ */
+public class KubernetesHost implements Serializable {
+ private static final Log log = LogFactory.getLog(KubernetesHost.class);
+ protected String hostId;
+ protected String hostname;
+ protected String hostIpAddress;
+ protected Properties properties = new Properties();
+
+ public String getHostId() {
+ return hostId;
+ }
+
+ public void setHostId(String hostId) {
+ this.hostId = hostId;
+ }
+
+ public String getHostname() {
+ return hostname;
+ }
+
+ public void setHostname(String hostname) {
+ this.hostname = hostname;
+ }
+
+ public String getHostIpAddress() {
+ return hostIpAddress;
+ }
+
+ public void setHostIpAddress(String hostIpAddress) {
+ this.hostIpAddress = hostIpAddress;
+ }
+
+ public Properties getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Properties properties) {
+ this.properties = properties;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesMaster.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesMaster.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesMaster.java
new file mode 100644
index 0000000..6316e28
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesMaster.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+package org.apache.stratos.common.kubernetes;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.Serializable;
+
+/**
+ * The model class for KubernetesMaster beans. This represents a Kubernetes CoreOS master host instance
+ */
+public class KubernetesMaster extends KubernetesHost implements Serializable {
+ private static final Log log = LogFactory.getLog(KubernetesMaster.class);
+
+ private String endpoint;
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/PortRange.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/PortRange.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/PortRange.java
new file mode 100644
index 0000000..6252643
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/PortRange.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.common.kubernetes;
+
+/**
+ * The model class for PortRange definition.
+ */
+public class PortRange {
+ int upper;
+ int lower;
+
+ public int getUpper() {
+ return upper;
+ }
+
+ public void setUpper(int upper) {
+ this.upper = upper;
+ }
+
+ public int getLower() {
+ return lower;
+ }
+
+ public void setLower(int lower) {
+ this.lower = lower;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Properties.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Properties.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Properties.java
new file mode 100644
index 0000000..559b49f
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Properties.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.common.kubernetes;
+
+import java.io.Serializable;
+import java.util.Arrays;
+
+/**
+ * Had to wrap {@link Property} array using a class, since there's a bug in current
+ * stub generation.
+ */
+public class Properties implements Serializable{
+
+ private static final long serialVersionUID = 1986895299288322592L;
+ private Property[] properties;
+
+ public Property[] getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Property[] properties) {
+ this.properties = properties;
+ }
+
+ @Override
+ public String toString() {
+ return "Properties [properties=" + Arrays.toString(properties) + "]";
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Property.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Property.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Property.java
new file mode 100644
index 0000000..1ea7459
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Property.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.common.kubernetes;
+
+import java.io.Serializable;
+
+/**
+ * Holds a property
+ */
+public class Property implements Serializable{
+
+ private static final long serialVersionUID = -2191782657999410197L;
+ private String name;
+ private String value;
+
+ public Property(){
+
+ }
+
+ public Property(String name, String value){
+ this.setName(name);
+ this.setValue(value);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return "Property [name=" + name + ", value=" + value + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesGroupDoesNotExistException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesGroupDoesNotExistException.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesGroupDoesNotExistException.java
new file mode 100644
index 0000000..fe0524c
--- /dev/null
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesGroupDoesNotExistException.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.rest.endpoint.exception;
+
+import javax.ws.rs.core.Response;
+
+public class KubernetesGroupDoesNotExistException extends RestAPIException {
+ private String message;
+ private Response.Status httpStatusCode;
+
+ public KubernetesGroupDoesNotExistException() {
+ super();
+ }
+
+ public KubernetesGroupDoesNotExistException(String message, Throwable cause) {
+ super(message, cause);
+ this.message = message;
+ }
+
+ public KubernetesGroupDoesNotExistException(Response.Status httpStatusCode, String message, Throwable cause) {
+ super(message, cause);
+ this.message = message;
+ this.httpStatusCode = httpStatusCode;
+ }
+
+ public KubernetesGroupDoesNotExistException(String message) {
+ super(message);
+ this.message = message;
+ }
+
+ public KubernetesGroupDoesNotExistException(Response.Status httpStatusCode, String message) {
+ super(message);
+ this.message = message;
+ this.httpStatusCode = httpStatusCode;
+ }
+
+ public KubernetesGroupDoesNotExistException(Throwable cause) {
+ super(cause);
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public Response.Status getHTTPStatusCode() {
+ return httpStatusCode;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesHostAlreadyDeployedException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesHostAlreadyDeployedException.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesHostAlreadyDeployedException.java
new file mode 100644
index 0000000..c5d8dcf
--- /dev/null
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesHostAlreadyDeployedException.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.rest.endpoint.exception;
+
+import javax.ws.rs.core.Response;
+
+public class KubernetesHostAlreadyDeployedException extends RestAPIException {
+ private String message;
+ private Response.Status httpStatusCode;
+
+ public KubernetesHostAlreadyDeployedException() {
+ super();
+ }
+
+ public KubernetesHostAlreadyDeployedException(String message, Throwable cause) {
+ super(message, cause);
+ this.message = message;
+ }
+
+ public KubernetesHostAlreadyDeployedException(Response.Status httpStatusCode, String message, Throwable cause) {
+ super(message, cause);
+ this.message = message;
+ this.httpStatusCode = httpStatusCode;
+ }
+
+ public KubernetesHostAlreadyDeployedException(String message) {
+ super(message);
+ this.message = message;
+ }
+
+ public KubernetesHostAlreadyDeployedException(Response.Status httpStatusCode, String message) {
+ super(message);
+ this.message = message;
+ this.httpStatusCode = httpStatusCode;
+ }
+
+ public KubernetesHostAlreadyDeployedException(Throwable cause) {
+ super(cause);
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public Response.Status getHTTPStatusCode() {
+ return httpStatusCode;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesHostDoesNotExistException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesHostDoesNotExistException.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesHostDoesNotExistException.java
new file mode 100644
index 0000000..a9fa73a
--- /dev/null
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesHostDoesNotExistException.java
@@ -0,0 +1,67 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+package org.apache.stratos.rest.endpoint.exception;
+
+import javax.ws.rs.core.Response;
+
+public class KubernetesHostDoesNotExistException extends RestAPIException {
+ private String message;
+ private Response.Status httpStatusCode;
+
+ public KubernetesHostDoesNotExistException() {
+ super();
+ }
+
+ public KubernetesHostDoesNotExistException(String message, Throwable cause) {
+ super(message, cause);
+ this.message = message;
+ }
+
+ public KubernetesHostDoesNotExistException(Response.Status httpStatusCode, String message, Throwable cause) {
+ super(message, cause);
+ this.message = message;
+ this.httpStatusCode = httpStatusCode;
+ }
+
+ public KubernetesHostDoesNotExistException(String message) {
+ super(message);
+ this.message = message;
+ }
+
+ public KubernetesHostDoesNotExistException(Response.Status httpStatusCode, String message) {
+ super(message);
+ this.message = message;
+ this.httpStatusCode = httpStatusCode;
+ }
+
+ public KubernetesHostDoesNotExistException(Throwable cause) {
+ super(cause);
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public Response.Status getHTTPStatusCode() {
+ return httpStatusCode;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesMasterDoesNotExistException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesMasterDoesNotExistException.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesMasterDoesNotExistException.java
new file mode 100644
index 0000000..c611da9
--- /dev/null
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesMasterDoesNotExistException.java
@@ -0,0 +1,68 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+package org.apache.stratos.rest.endpoint.exception;
+
+import javax.ws.rs.core.Response;
+
+public class KubernetesMasterDoesNotExistException extends RestAPIException {
+
+ private String message;
+ private Response.Status httpStatusCode;
+
+ public KubernetesMasterDoesNotExistException() {
+ super();
+ }
+
+ public KubernetesMasterDoesNotExistException(String message, Throwable cause) {
+ super(message, cause);
+ this.message = message;
+ }
+
+ public KubernetesMasterDoesNotExistException(Response.Status httpStatusCode, String message, Throwable cause) {
+ super(message, cause);
+ this.message = message;
+ this.httpStatusCode = httpStatusCode;
+ }
+
+ public KubernetesMasterDoesNotExistException(String message) {
+ super(message);
+ this.message = message;
+ }
+
+ public KubernetesMasterDoesNotExistException(Response.Status httpStatusCode, String message) {
+ super(message);
+ this.message = message;
+ this.httpStatusCode = httpStatusCode;
+ }
+
+ public KubernetesMasterDoesNotExistException(Throwable cause) {
+ super(cause);
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public Response.Status getHTTPStatusCode() {
+ return httpStatusCode;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
index e3b96e6..8878b53 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
@@ -32,13 +32,19 @@ import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidIaa
import org.apache.stratos.cloud.controller.stub.pojo.CartridgeConfig;
import org.apache.stratos.cloud.controller.stub.pojo.CartridgeInfo;
import org.apache.stratos.cloud.controller.stub.pojo.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.manager.client.AutoscalerServiceClient;
import org.apache.stratos.manager.client.CloudControllerServiceClient;
import org.apache.stratos.manager.deploy.service.Service;
import org.apache.stratos.manager.deploy.service.ServiceDeploymentManager;
import org.apache.stratos.manager.dto.Cartridge;
import org.apache.stratos.manager.dto.SubscriptionInfo;
-import org.apache.stratos.manager.exception.*;
+import org.apache.stratos.manager.exception.ADCException;
+import org.apache.stratos.manager.exception.DomainMappingExistsException;
+import org.apache.stratos.manager.exception.NotSubscribedException;
+import org.apache.stratos.manager.exception.ServiceDoesNotExistException;
import org.apache.stratos.manager.manager.CartridgeSubscriptionManager;
import org.apache.stratos.manager.repository.RepositoryNotification;
import org.apache.stratos.manager.subscription.CartridgeSubscription;
@@ -63,10 +69,12 @@ import org.apache.stratos.rest.endpoint.bean.cartridge.definition.ServiceDefinit
import org.apache.stratos.rest.endpoint.bean.repositoryNotificationInfoBean.Payload;
import org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean;
import org.apache.stratos.rest.endpoint.bean.util.converter.PojoConverter;
+import org.apache.stratos.rest.endpoint.exception.KubernetesGroupDoesNotExistException;
+import org.apache.stratos.rest.endpoint.exception.KubernetesMasterDoesNotExistException;
import org.apache.stratos.rest.endpoint.exception.RestAPIException;
+
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
-
import java.rmi.RemoteException;
import java.util.*;
import java.util.regex.Pattern;
@@ -82,7 +90,7 @@ public class ServiceUtils {
private static ServiceDeploymentManager serviceDeploymentManager = new ServiceDeploymentManager();
static void deployCartridge(CartridgeDefinitionBean cartridgeDefinitionBean, ConfigurationContext ctxt,
- String userName, String tenantDomain) throws RestAPIException {
+ String userName, String tenantDomain) throws RestAPIException {
log.info("Starting to deploy a Cartridge [type] " + cartridgeDefinitionBean.type);
@@ -182,6 +190,33 @@ public class ServiceUtils {
}
}
+
+ public static void deployKubernetesGroup(KubernetesGroup kubernetesGroup) {
+ //TODO
+ }
+
+ public static void deployKubernetesHost(String kubernetesGroupId, KubernetesHost kubernetesHost) {
+ //TODO
+ }
+
+ public static void updateKubernetesMaster(KubernetesMaster kubernetesMaster) throws KubernetesMasterDoesNotExistException {
+ //TODO
+ }
+
+ public static KubernetesGroup[] getAvailableKubernetesGroups() {
+ //TODO
+ return null;
+ }
+
+ public static KubernetesGroup getKubernetesGroup(String kubernetesGroupId) {
+ //TODO
+ return null;
+ }
+
+ public static void undeployKubernetesGroup(String kubernetesGroupId) throws KubernetesGroupDoesNotExistException {
+ //TODO
+ }
+
public static void deployAutoscalingPolicy(AutoscalePolicy autoscalePolicyBean) throws RestAPIException {
//log.info("***** " + cartridgeDefinitionBean.toString() + " *****");
@@ -491,7 +526,7 @@ public class ServiceUtils {
}
/*if(lbCartridges == null || lbCartridges.isEmpty()) {
- String msg = "Load balancer Cartridges are not available.";
+ String msg = "Load balancer Cartridges are not available.";
log.error(msg);
throw new RestAPIException(msg) ;
}*/
@@ -649,7 +684,7 @@ public class ServiceUtils {
if (service == null) {
return null;
- }else{
+ } else {
return PojoConverter.convertToServiceDefinitionBean(service);
}
}
@@ -702,7 +737,7 @@ public class ServiceUtils {
}
- static List<Cartridge> getSubscriptions (String cartridgeSearchString, String serviceGroup, ConfigurationContext configurationContext) throws RestAPIException {
+ static List<Cartridge> getSubscriptions(String cartridgeSearchString, String serviceGroup, ConfigurationContext configurationContext) throws RestAPIException {
List<Cartridge> cartridges = new ArrayList<Cartridge>();
if (log.isDebugEnabled()) {
@@ -883,18 +918,19 @@ public class ServiceUtils {
}
}
}
- if(subscription.getCartridgeInfo().getServiceGroup() != null) {
- cartridge.setServiceGroup(subscription.getCartridgeInfo().getServiceGroup());
+ if (subscription.getCartridgeInfo().getServiceGroup() != null) {
+ cartridge.setServiceGroup(subscription.getCartridgeInfo().getServiceGroup());
}
- return cartridge;
-
- } catch (Exception e) {
- String msg = "Unable to extract the Cartridge from subscription. Cause: "+e.getMessage();
- log.error(msg);
- throw new RestAPIException(msg);
- }
-
- }
+ return cartridge;
+
+ } catch (Exception e) {
+ String msg = "Unable to extract the Cartridge from subscription. Cause: " + e.getMessage();
+ log.error(msg);
+ throw new RestAPIException(msg);
+ }
+
+ }
+
static Pattern getSearchStringPattern(String searchString) {
if (log.isDebugEnabled()) {
log.debug("Creating search pattern for " + searchString);
@@ -950,9 +986,9 @@ public class ServiceUtils {
public static CartridgeSubscription getCartridgeSubscription(String alias, ConfigurationContext configurationContext) {
return CartridgeSubscriptionManager.getCartridgeSubscription(ApplicationManagementUtil.getTenantId(configurationContext), alias);
}
-
- static SubscriptionInfo subscribe(CartridgeInfoBean cartridgeInfoBean, ConfigurationContext configurationContext, String tenantUsername, String tenantDomain)
- throws RestAPIException{
+
+ static SubscriptionInfo subscribe(CartridgeInfoBean cartridgeInfoBean, ConfigurationContext configurationContext, String tenantUsername, String tenantDomain)
+ throws RestAPIException {
SubscriptionData subscriptionData = new SubscriptionData();
subscriptionData.setCartridgeType(cartridgeInfoBean.getCartridgeType());
@@ -970,10 +1006,10 @@ public class ServiceUtils {
subscriptionData.setServiceGroup(cartridgeInfoBean.getServiceGroup());
PersistenceBean persistenceBean = cartridgeInfoBean.getPersistence();
- if(persistenceBean != null) {
+ if (persistenceBean != null) {
subscriptionData.setPersistence(PojoConverter.getPersistence(persistenceBean));
}
- if(cartridgeInfoBean.getProperty() != null){
+ if (cartridgeInfoBean.getProperty() != null) {
subscriptionData.setProperties(PojoConverter.getProperties(cartridgeInfoBean.getProperty()));
}
@@ -993,12 +1029,12 @@ public class ServiceUtils {
*/
//subscribe
SubscriptionInfo subscriptionInfo = null;
- try{
- subscriptionInfo = CartridgeSubscriptionManager.subscribeToCartridgeWithProperties(subscriptionData);
- }catch(Exception e){
- throw new RestAPIException(e.getMessage(), e);
+ try {
+ subscriptionInfo = CartridgeSubscriptionManager.subscribeToCartridgeWithProperties(subscriptionData);
+ } catch (Exception e) {
+ throw new RestAPIException(e.getMessage(), e);
}
-
+
return subscriptionInfo;
}
@@ -1045,22 +1081,22 @@ public class ServiceUtils {
return arrCluster;
}
-
- public static org.apache.stratos.rest.endpoint.bean.topology.Cluster[] getClustersForCartridgeType(String cartridgeType) {
-
- Set<Cluster> clusterSet = TopologyClusterInformationModel
- .getInstance()
- .getClusters(cartridgeType);
- List<org.apache.stratos.rest.endpoint.bean.topology.Cluster> clusters = new ArrayList<org.apache.stratos.rest.endpoint.bean.topology.Cluster>();
- for (Cluster cluster : clusterSet) {
- clusters.add(PojoConverter.populateClusterPojos(cluster));
- }
- org.apache.stratos.rest.endpoint.bean.topology.Cluster[] arrCluster = new org.apache.stratos.rest.endpoint.bean.topology.Cluster[clusters
- .size()];
- arrCluster = clusters.toArray(arrCluster);
- return arrCluster;
-
- }
+
+ public static org.apache.stratos.rest.endpoint.bean.topology.Cluster[] getClustersForCartridgeType(String cartridgeType) {
+
+ Set<Cluster> clusterSet = TopologyClusterInformationModel
+ .getInstance()
+ .getClusters(cartridgeType);
+ List<org.apache.stratos.rest.endpoint.bean.topology.Cluster> clusters = new ArrayList<org.apache.stratos.rest.endpoint.bean.topology.Cluster>();
+ for (Cluster cluster : clusterSet) {
+ clusters.add(PojoConverter.populateClusterPojos(cluster));
+ }
+ org.apache.stratos.rest.endpoint.bean.topology.Cluster[] arrCluster = new org.apache.stratos.rest.endpoint.bean.topology.Cluster[clusters
+ .size()];
+ arrCluster = clusters.toArray(arrCluster);
+ return arrCluster;
+
+ }
// return the cluster id for the lb. This is a temp fix.
/*private static String subscribeToLb(String cartridgeType, String loadBalancedCartridgeType, String lbAlias,
@@ -1111,7 +1147,7 @@ public class ServiceUtils {
static void unsubscribe(String alias, String tenantDomain) throws RestAPIException {
try {
- CartridgeSubscriptionManager.unsubscribeFromCartridge(tenantDomain, alias);
+ CartridgeSubscriptionManager.unsubscribeFromCartridge(tenantDomain, alias);
} catch (ADCException e) {
String msg = "Failed to unsubscribe from [alias] " + alias + ". Cause: " + e.getMessage();
@@ -1133,7 +1169,7 @@ public class ServiceUtils {
* @param clusterSubdomain
*/
static void deployService(String cartridgeType, String alias, String autoscalingPolicy, String deploymentPolicy,
- String tenantDomain, String tenantUsername, int tenantId, String clusterDomain, String clusterSubdomain, String tenantRange) throws RestAPIException {
+ String tenantDomain, String tenantUsername, int tenantId, String clusterDomain, String clusterSubdomain, String tenantRange) throws RestAPIException {
log.info("Deploying service..");
try {
serviceDeploymentManager.deployService(cartridgeType, autoscalingPolicy, deploymentPolicy, tenantId, tenantRange, tenantDomain, tenantUsername);
@@ -1149,9 +1185,9 @@ public class ServiceUtils {
try {
serviceDeploymentManager.undeployService(serviceType);
- }catch(ServiceDoesNotExistException ex){
+ } catch (ServiceDoesNotExistException ex) {
throw ex;
- }catch (Exception e) {
+ } catch (Exception e) {
String msg = "Failed to undeploy service cluster definition of type " + serviceType + " Cause: " + e.getMessage();
log.error(msg, e);
throw new RestAPIException(msg, e);
@@ -1183,9 +1219,9 @@ public class ServiceUtils {
}
public static void addSubscriptionDomains(ConfigurationContext configurationContext, String cartridgeType,
- String subscriptionAlias,
- SubscriptionDomainRequest request)
- throws RestAPIException {
+ String subscriptionAlias,
+ SubscriptionDomainRequest request)
+ throws RestAPIException {
try {
int tenantId = ApplicationManagementUtil.getTenantId(configurationContext);
@@ -1198,10 +1234,10 @@ public class ServiceUtils {
}
for (org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean subscriptionDomain : request.domains) {
-
- CartridgeSubscriptionManager.addSubscriptionDomain(tenantId, subscriptionAlias,
- subscriptionDomain.domainName, subscriptionDomain.applicationContext);
- }
+
+ CartridgeSubscriptionManager.addSubscriptionDomain(tenantId, subscriptionAlias,
+ subscriptionDomain.domainName, subscriptionDomain.applicationContext);
+ }
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RestAPIException(e.getMessage(), e);
@@ -1228,7 +1264,7 @@ public class ServiceUtils {
}
public static List<SubscriptionDomainBean> getSubscriptionDomains(ConfigurationContext configurationContext, String cartridgeType,
- String subscriptionAlias) throws RestAPIException {
+ String subscriptionAlias) throws RestAPIException {
try {
int tenantId = ApplicationManagementUtil.getTenantId(configurationContext);
return PojoConverter.populateSubscriptionDomainPojos(CartridgeSubscriptionManager.getSubscriptionDomains(tenantId, subscriptionAlias));
@@ -1237,32 +1273,32 @@ public class ServiceUtils {
throw new RestAPIException(e.getMessage(), e);
}
}
-
- public static SubscriptionDomainBean getSubscriptionDomain(ConfigurationContext configurationContext, String cartridgeType,
- String subscriptionAlias, String domain) throws RestAPIException {
- try {
- int tenantId = ApplicationManagementUtil
- .getTenantId(configurationContext);
- SubscriptionDomainBean subscriptionDomain = PojoConverter.populateSubscriptionDomainPojo(CartridgeSubscriptionManager.getSubscriptionDomain(tenantId,
- subscriptionAlias, domain));
-
- if (subscriptionDomain == null) {
- String message = "Could not find a subscription [domain] "+domain+ " for Cartridge [type] "
- +cartridgeType+ " and [alias] "+subscriptionAlias;
- log.error(message);
- throw new RestAPIException(Status.NOT_FOUND, message);
- }
-
- return subscriptionDomain;
-
- } catch (Exception e) {
- log.error(e.getMessage(), e);
- throw new RestAPIException(e.getMessage(), e);
- }
- }
+
+ public static SubscriptionDomainBean getSubscriptionDomain(ConfigurationContext configurationContext, String cartridgeType,
+ String subscriptionAlias, String domain) throws RestAPIException {
+ try {
+ int tenantId = ApplicationManagementUtil
+ .getTenantId(configurationContext);
+ SubscriptionDomainBean subscriptionDomain = PojoConverter.populateSubscriptionDomainPojo(CartridgeSubscriptionManager.getSubscriptionDomain(tenantId,
+ subscriptionAlias, domain));
+
+ if (subscriptionDomain == null) {
+ String message = "Could not find a subscription [domain] " + domain + " for Cartridge [type] "
+ + cartridgeType + " and [alias] " + subscriptionAlias;
+ log.error(message);
+ throw new RestAPIException(Status.NOT_FOUND, message);
+ }
+
+ return subscriptionDomain;
+
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ throw new RestAPIException(e.getMessage(), e);
+ }
+ }
public static void removeSubscriptionDomain(ConfigurationContext configurationContext, String cartridgeType,
- String subscriptionAlias, String domain) throws RestAPIException, DomainMappingExistsException {
+ String subscriptionAlias, String domain) throws RestAPIException, DomainMappingExistsException {
try {
int tenantId = ApplicationManagementUtil.getTenantId(configurationContext);
CartridgeSubscriptionManager.removeSubscriptionDomain(tenantId, subscriptionAlias, domain);
[09/12] git commit: Merge branch 'master' of
github.com:apache/stratos into kubernetis-host-register
Posted by ra...@apache.org.
Merge branch 'master' of github.com:apache/stratos into kubernetis-host-register
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/2ea9d037
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/2ea9d037
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/2ea9d037
Branch: refs/heads/docker-integration
Commit: 2ea9d03725355eff9ca579735cb67f066ea1885c
Parents: c3cd37e 24c84ad
Author: Akila Perera <ra...@gmail.com>
Authored: Thu Sep 11 03:45:41 2014 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Thu Sep 11 03:45:41 2014 +0530
----------------------------------------------------------------------
.../java/org/apache/stratos/manager/dto/Cartridge.java | 11 +++++++++++
.../stratos/rest/endpoint/services/ServiceUtils.java | 1 +
2 files changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/2ea9d037/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
----------------------------------------------------------------------
[02/12] re-organizing puppet modules
Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/conf/tomcat/catalina-server.xml.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/conf/tomcat/catalina-server.xml.erb b/tools/puppet3/modules/appserver/templates/conf/tomcat/catalina-server.xml.erb
new file mode 100644
index 0000000..4ed8eff
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/conf/tomcat/catalina-server.xml.erb
@@ -0,0 +1,98 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<Server port="8005" shutdown="SHUTDOWN">
+
+ <Service className="org.wso2.carbon.tomcat.ext.service.ExtendedStandardService" name="Catalina">
+
+ <!--
+ optional attributes:
+
+ proxyPort="80"
+ -->
+ <Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
+ port="9763"
+ proxyPort="<%= @http_proxy_port %>"
+ redirectPort="9443"
+ bindOnInit="false"
+ maxHttpHeaderSize="8192"
+ acceptorThreadCount="2"
+ maxThreads="250"
+ minSpareThreads="50"
+ disableUploadTimeout="false"
+ connectionUploadTimeout="120000"
+ maxKeepAliveRequests="200"
+ acceptCount="200"
+ server="WSO2 Carbon Server"
+ compression="on"
+ compressionMinSize="2048"
+ noCompressionUserAgents="gozilla, traviata"
+ compressableMimeType="text/html,text/javascript,application/x-javascript,application/javascript,application/xml,text/css,application/xslt+xml,text/xsl,image/gif,image/jpg,image/jpeg"
+ URIEncoding="UTF-8"/>
+
+ <!--
+ optional attributes:
+
+ proxyPort="443"
+ -->
+ <Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
+ port="9443"
+ proxyPort="<%= @https_proxy_port %>"
+ bindOnInit="false"
+ sslProtocol="TLS"
+ maxHttpHeaderSize="8192"
+ acceptorThreadCount="2"
+ maxThreads="250"
+ minSpareThreads="50"
+ disableUploadTimeout="false"
+ enableLookups="false"
+ connectionUploadTimeout="120000"
+ maxKeepAliveRequests="200"
+ acceptCount="200"
+ server="WSO2 Carbon Server"
+ clientAuth="false"
+ compression="on"
+ scheme="https"
+ secure="true"
+ SSLEnabled="true"
+ compressionMinSize="2048"
+ noCompressionUserAgents="gozilla, traviata"
+ compressableMimeType="text/html,text/javascript,application/x-javascript,application/javascript,application/xml,text/css,application/xslt+xml,text/xsl,image/gif,image/jpg,image/jpeg"
+ URIEncoding="UTF-8"/>
+
+
+
+ <Engine name="Catalina" defaultHost="localhost">
+
+ <!--Realm className="org.apache.catalina.realm.MemoryRealm" pathname="${carbon.home}/repository/conf/tomcat/tomcat-users.xml"/-->
+
+ <Realm className="org.wso2.carbon.tomcat.ext.realms.CarbonTomcatRealm"/>
+
+ <Host name="localhost" unpackWARs="true" deployOnStartup="false" autoDeploy="false" appBase="${carbon.home}/repository/deployment/server/webapps/">
+ <Valve className="org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve"/>
+ <Valve className="org.apache.catalina.valves.AccessLogValve" directory="${carbon.home}/repository/logs"
+ prefix="http_access_" suffix=".log"
+ pattern="combined" />
+ <Valve className="org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve" threshold="600"/>
+ <Valve className="org.wso2.carbon.tomcat.ext.valves.CompositeValve"/>
+ <Valve className="org.wso2.carbon.bam.webapp.stat.publisher.WebAppStatisticPublisherValve"/>
+ <Valve className="org.wso2.carbon.statistics.webapp.RequestIntercepterValve"/>
+ </Host>
+ </Engine>
+ </Service>
+</Server>
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/conf/user-mgt.xml.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/conf/user-mgt.xml.erb b/tools/puppet3/modules/appserver/templates/conf/user-mgt.xml.erb
new file mode 100644
index 0000000..a760b69
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/conf/user-mgt.xml.erb
@@ -0,0 +1,356 @@
+<!--
+ ~ Copyright WSO2, Inc. (http://wso2.com)
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<UserManager>
+ <Realm>
+ <Configuration>
+ <AddAdmin>true</AddAdmin>
+ <AdminRole>admin</AdminRole>
+ <AdminUser>
+ <UserName><%= @admin_username %></UserName>
+ <Password><%= @admin_password %></Password>
+ </AdminUser>
+ <EveryOneRoleName>everyone</EveryOneRoleName> <!-- By default users in this role sees the registry root -->
+ <%- if @cloud == true or @clustering == true -%>
+ <Property name="dataSource">jdbc/<%= @userstore_database %></Property>
+ <%- else -%>
+ <Property name="dataSource">jdbc/WSO2CarbonDB</Property>
+ <%- end -%>
+ </Configuration>
+ <!-- Following is the default user store manager. This user store manager is based on embedded-apacheds LDAP. It reads/writes users and roles into the default apacheds LDAP user store. Descriptions about each of the following properties can be found in user management documentation of the respective product. In case if user core cache domain is needed to identify uniquely set property <Property name="UserCoreCacheIdentifier">domain</Property>
+ Note: Do not comment within UserStoreManager tags. Cause, specific tag names are used as tokens when building configurations for products. -->
+ <!--UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager">
+ <Property name="TenantManager">org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager</Property>
+ <Property name="ConnectionURL">ldap://localhost:${Ports.EmbeddedLDAP.LDAPServerPort}</Property>
+ <Property name="ConnectionName">uid=admin,ou=system</Property>
+ <Property name="ConnectionPassword">admin</Property>
+ <Property name="Disabled">false</Property>
+ <Property name="passwordHashMethod">SHA</Property>
+ <Property name="UserNameListFilter">(objectClass=person)</Property>
+ <Property name="UserEntryObjectClass">wso2Person</Property>
+ <Property name="UserSearchBase">ou=Users,dc=wso2,dc=org</Property>
+ <Property name="UserNameSearchFilter">(&(objectClass=person)(uid=?))</Property>
+ <Property name="UserNameAttribute">uid</Property>
+ <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
+ <Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
+ <Property name="UsernameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
+ <Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
+ <Property name="RolenameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
+ <Property name="ReadGroups">true</Property>
+ <Property name="WriteGroups">true</Property>
+ <Property name="EmptyRolesAllowed">true</Property>
+ <Property name="GroupSearchBase">ou=Groups,dc=wso2,dc=org</Property>
+ <Property name="GroupNameListFilter">(objectClass=groupOfNames)</Property>
+ <Property name="GroupEntryObjectClass">groupOfNames</Property>
+ <Property name="GroupNameSearchFilter">(&(objectClass=groupOfNames)(cn=?))</Property>
+ <Property name="GroupNameAttribute">cn</Property>
+ <Property name="SharedGroupNameAttribute">cn</Property>
+ <Property name="SharedGroupSearchBase">ou=SharedGroups,dc=wso2,dc=org</Property>
+ <Property name="SharedGroupEntryObjectClass">groupOfNames</Property>
+ <Property name="SharedGroupNameListFilter">(objectClass=groupOfNames)</Property>
+ <Property name="SharedGroupNameSearchFilter">(&(objectClass=groupOfNames)(cn=?))</Property>
+ <Property name="SharedTenantNameListFilter">(objectClass=organizationalUnit)</Property>
+ <Property name="SharedTenantNameAttribute">ou</Property>
+ <Property name="SharedTenantObjectClass">organizationalUnit</Property>
+ <Property name="MembershipAttribute">member</Property>
+ <Property name="UserRolesCacheEnabled">true</Property>
+ <Property name="UserDNPattern">uid={0},ou=Users,dc=wso2,dc=org</Property>
+ <Property name="MaxRoleNameListLength">100</Property>
+ <Property name="MaxUserNameListLength">100</Property>
+ <Property name="SCIMEnabled">false</Property>
+ </UserStoreManager-->
+
+ <!-- Following is the configuration for internal JDBC user store. This user store manager is based on JDBC. In case if application needs to manage passwords externally set property <Property name="PasswordsExternallyManaged">true</Property>. In case if user core cache domain is needed to identify uniquely set property <Property name="UserCoreCacheIdentifier">domain</Property>. Furthermore properties, IsEmailUserName and DomainCalculation are readonly properties.
+ Note: Do not comment within UserStoreManager tags. Cause, specific tag names are used as tokens when building configurations for products. -->
+ <UserStoreManager class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
+ <Property name="TenantManager">org.wso2.carbon.user.core.tenant.JDBCTenantManager</Property>
+ <Property name="ReadOnly">false</Property>
+ <Property name="MaxUserNameListLength">100</Property>
+ <Property name="IsEmailUserName">false</Property>
+ <Property name="DomainCalculation">default</Property>
+ <Property name="PasswordDigest">SHA-256</Property>
+ <Property name="StoreSaltedPassword">true</Property>
+ <Property name="ReadGroups">true</Property>
+ <Property name="WriteGroups">true</Property>
+ <Property name="UserNameUniqueAcrossTenants">false</Property>
+ <Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property>
+ <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
+ <Property name="UsernameJavaRegEx">^[^~!#$;%^*+={}\\|\\\\<>,\'\"]{3,30}$</Property>
+ <Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
+ <Property name="RolenameJavaRegEx">^[^~!#$;%^*+={}\\|\\\\<>,\'\"]{3,30}$</Property>
+ <Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
+ <Property name="UserRolesCacheEnabled">true</Property>
+ <Property name="MaxRoleNameListLength">100</Property>
+ <Property name="MaxUserNameListLength">100</Property>
+ <Property name="SharedGroupEnabled">false</Property>
+ <Property name="SCIMEnabled">false</Property>
+ <%- if @usermgt -%>
+ <Property name="PasswordsExternallyManaged">true</Property>
+ <%- end -%>
+ </UserStoreManager>
+
+ <%- if @usermgt == 'readonly_ldap' -%>
+ <%= scope.function_template(['appserver/conf/user-mgt/_roldap.erb']) -%>
+ <%- elsif @usermgt == 'readwrite_ldap' -%>
+ <%= scope.function_template(['appserver/conf/user-mgt/_rwldap.erb']) -%>
+ <%- end -%>
+
+ <!-- If product is using an external LDAP as the user store in READ ONLY mode, use following user manager.
+ In case if user core cache domain is needed to identify uniquely set property <Property name="UserCoreCacheIdentifier">domain</Property>
+ -->
+ <!--UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager">
+ <Property name="TenantManager">org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager</Property>
+ <Property name="ReadOnly">true</Property>
+ <Property name="Disabled">false</Property>
+ <Property name="MaxUserNameListLength">100</Property>
+ <Property name="ConnectionURL">ldap://localhost:10389</Property>
+ <Property name="ConnectionName">uid=admin,ou=system</Property>
+ <Property name="ConnectionPassword">admin</Property>
+ <Property name="passwordHashMethod">PLAIN_TEXT</Property>
+ <Property name="UserSearchBase">ou=system</Property>
+ <Property name="UserNameListFilter">(objectClass=person)</Property>
+ <Property name="UserNameSearchFilter">(&(objectClass=person)(uid=?))</Property>
+ <Property name="UserNameAttribute">uid</Property>
+ <Property name="ReadGroups">true</Property>
+ <Property name="GroupSearchBase">ou=system</Property>
+ <Property name="GroupNameListFilter">(objectClass=groupOfNames)</Property>
+ <Property name="GroupNameSearchFilter">(&(objectClass=groupOfNames)(cn=?))</Property>
+ <Property name="GroupNameAttribute">cn</Property>
+ <Property name="SharedGroupNameAttribute">cn</Property>
+ <Property name="SharedGroupSearchBase">ou=SharedGroups,dc=wso2,dc=org</Property>
+ <Property name="SharedGroupNameListFilter">(objectClass=groupOfNames)</Property>
+ <Property name="SharedTenantNameListFilter">(objectClass=organizationalUnit)</Property>
+ <Property name="SharedTenantNameAttribute">ou</Property>
+ <Property name="SharedTenantObjectClass">organizationalUnit</Property>
+ <Property name="MembershipAttribute">member</Property>
+ <Property name="UserRolesCacheEnabled">true</Property>
+ <Property name="ReplaceEscapeCharactersAtUserLogin">true</Property>
+ <Property name="MaxRoleNameListLength">100</Property>
+ <Property name="MaxUserNameListLength">100</Property>
+ <Property name="SCIMEnabled">false</Property>
+ </UserStoreManager-->
+
+ <!-- Active directory configuration is as follows.
+ In case if user core cache domain is needed to identify uniquely set property <Property name="UserCoreCacheIdentifier">domain</Property>
+ There are few special properties for "Active Directory".
+ They are :
+ 1.Referral - (comment out this property if this feature is not reuired) This enables LDAP referral support.
+ 2.BackLinksEnabled - (Do not comment, set to true or false) In some cases LDAP works with BackLinksEnabled. In which role is stored
+ at user level. Depending on this value we need to change the Search Base within code.
+ 3.isADLDSRole - (Do not comment) Set to true if connecting to an AD LDS instance else set to false.
+ -->
+ <!--UserStoreManager class="org.wso2.carbon.user.core.ldap.ActiveDirectoryUserStoreManager">
+ <Property name="TenantManager">org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager</Property>
+ <Property name="defaultRealmName">WSO2.ORG</Property>
+ <Property name="Disabled">false</Property>
+ <Property name="kdcEnabled">false</Property>
+ <Property name="ConnectionURL">ldaps://10.100.1.100:636</Property>
+ <Property name="ConnectionName">CN=admin,CN=Users,DC=WSO2,DC=Com</Property>
+ <Property name="ConnectionPassword">A1b2c3d4</Property>
+ <Property name="passwordHashMethod">PLAIN_TEXT</Property>
+ <Property name="UserSearchBase">CN=Users,DC=WSO2,DC=Com</Property>
+ <Property name="UserEntryObjectClass">user</Property>
+ <Property name="UserNameAttribute">cn</Property>
+ <Property name="isADLDSRole">false</Property>
+ <Property name="userAccountControl">512</Property>
+ <Property name="UserNameListFilter">(objectClass=user)</Property>
+ <Property name="UserNameSearchFilter">(&(objectClass=user)(cn=?))</Property>
+ <Property name="UsernameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
+ <Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
+ <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
+ <Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
+ <Property name="RolenameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
+ <Property name="ReadGroups">true</Property>
+ <Property name="WriteGroups">true</Property>
+ <Property name="EmptyRolesAllowed">true</Property>
+ <Property name="GroupSearchBase">CN=Users,DC=WSO2,DC=Com</Property>
+ <Property name="GroupEntryObjectClass">group</Property>
+ <Property name="GroupNameAttribute">cn</Property>
+ <Property name="SharedGroupNameAttribute">cn</Property>
+ <Property name="SharedGroupSearchBase">ou=SharedGroups,dc=wso2,dc=org</Property>
+ <Property name="SharedGroupEntryObjectClass">groups</Property>
+ <Property name="SharedTenantNameListFilter">(object=organizationalUnit)</Property>
+ <Property name="SharedTenantNameAttribute">ou</Property>
+ <Property name="SharedTenantObjectClass">organizationalUnit</Property>
+ <Property name="MembershipAttribute">member</Property>
+ <Property name="GroupNameListFilter">(objectcategory=group)</Property>
+ <Property name="GroupNameSearchFilter">(&(objectClass=group)(cn=?))</Property>
+ <Property name="UserRolesCacheEnabled">true</Property>
+ <Property name="Referral">follow</Property>
+ <Property name="BackLinksEnabled">true</Property>
+ <Property name="MaxRoleNameListLength">100</Property>
+ <Property name="MaxUserNameListLength">100</Property>
+ <Property name="SCIMEnabled">false</Property>
+ </UserStoreManager-->
+
+ <!-- If product is using an external LDAP as the user store in read/write mode, use following user manager
+ In case if user core cache domain is needed to identify uniquely set property <Property name="UserCoreCacheIdentifier">domain</Property>
+ -->
+ <!--UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager">
+ <Property name="TenantManager">org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager</Property>
+ <Property name="ConnectionURL">ldap://localhost:10389</Property>
+ <Property name="Disabled">false</Property>
+ <Property name="ConnectionName">uid=admin,ou=system</Property>
+ <Property name="ConnectionPassword">secret</Property>
+ <Property name="passwordHashMethod">PLAIN_TEXT</Property>
+ <Property name="UserNameListFilter">(objectClass=person)</Property>
+ <Property name="UserEntryObjectClass">inetOrgPerson</Property>
+ <Property name="UserSearchBase">ou=system</Property>
+ <Property name="UserNameSearchFilter">(&(objectClass=person)(uid=?))</Property>
+ <Property name="UserNameAttribute">uid</Property>
+ <Property name="UsernameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
+ <Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
+ <Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
+ <Property name="RolenameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
+ <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
+ <Property name="ReadGroups">true</Property>
+ <Property name="WriteGroups">true</Property>
+ <Property name="EmptyRolesAllowed">false</Property>
+ <Property name="GroupSearchBase">ou=system</Property>
+ <Property name="GroupNameListFilter">(objectClass=groupOfNames)</Property>
+ <Property name="GroupEntryObjectClass">groupOfNames</Property>
+ <Property name="GroupNameSearchFilter">(&(objectClass=groupOfNames)(cn=?))</Property>
+ <Property name="GroupNameAttribute">cn</Property>
+ <Property name="SharedGroupNameAttribute">cn</Property>
+ <Property name="SharedGroupSearchBase">ou=SharedGroups,dc=wso2,dc=org</Property>
+ <Property name="SharedGroupEntryObjectClass">groupOfNames</Property>
+ <Property name="SharedGroupNameListFilter">(objectClass=groupOfNames)</Property>
+ <Property name="SharedGroupNameSearchFilter">(&(objectClass=groupOfNames)(cn=?))</Property>
+ <Property name="SharedTenantNameListFilter">(objectClass=organizationalUnit)</Property>
+ <Property name="SharedTenantNameAttribute">ou</Property>
+ <Property name="SharedTenantObjectClass">organizationalUnit</Property>
+ <Property name="MembershipAttribute">member</Property>
+ <Property name="UserRolesCacheEnabled">true</Property>
+ <Property name="ReplaceEscapeCharactersAtUserLogin">true</Property>
+ <Property name="MaxRoleNameListLength">100</Property>
+ <Property name="MaxUserNameListLength">100</Property>
+ <Property name="SCIMEnabled">false</Property>
+ </UserStoreManager-->
+
+ <!-- Following user manager is used by Identity Server (IS) as its default user manager.
+ IS will do token replacement when building the product. Therefore do not change the syntax.
+ If "kdcEnabled" parameter is true, IS will allow service principle management. Thus "ServicePasswordJavaRegEx", "ServiceNameJavaRegEx"
+ properties control the service name format and service password formats.
+ In case if user core cache domain is needed to identify uniquely set property <Property name="UserCoreCacheIdentifier">domain</Property>
+ -->
+ <!--ISUserStoreManager class="org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager">
+ <Property name="TenantManager">org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager</Property>
+ <Property name="defaultRealmName">WSO2.ORG</Property>
+ <Property name="kdcEnabled">false</Property>
+ <Property name="Disabled">false</Property>
+ <Property name="ConnectionURL">ldap://localhost:${Ports.EmbeddedLDAP.LDAPServerPort}</Property>
+ <Property name="ConnectionName">uid=admin,ou=system</Property>
+ <Property name="ConnectionPassword">admin</Property>
+ <Property name="passwordHashMethod">SHA</Property>
+ <Property name="UserNameListFilter">(objectClass=person)</Property>
+ <Property name="UserEntryObjectClass">identityPerson</Property>
+ <Property name="UserSearchBase">ou=Users,dc=wso2,dc=org</Property>
+ <Property name="UserNameSearchFilter">(&(objectClass=person)(uid=?))</Property>
+ <Property name="UserNameAttribute">uid</Property>
+ <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
+ <Property name="ServicePasswordJavaRegEx">^[\\S]{5,30}$</Property>
+ <Property name="ServiceNameJavaRegEx">^[\\S]{2,30}/[\\S]{2,30}$</Property>
+ <Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
+ <Property name="UsernameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
+ <Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
+ <Property name="RolenameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
+ <Property name="ReadGroups">true</Property>
+ <Property name="WriteGroups">true</Property>
+ <Property name="EmptyRolesAllowed">true</Property>
+ <Property name="GroupSearchBase">ou=Groups,dc=wso2,dc=org</Property>
+ <Property name="GroupNameListFilter">(objectClass=groupOfNames)</Property>
+ <Property name="GroupEntryObjectClass">groupOfNames</Property>
+ <Property name="GroupNameSearchFilter">(&(objectClass=groupOfNames)(cn=?))</Property>
+ <Property name="GroupNameAttribute">cn</Property>
+ <Property name="SharedGroupNameAttribute">cn</Property>
+ <Property name="SharedGroupSearchBase">ou=SharedGroups,dc=wso2,dc=org</Property>
+ <Property name="SharedGroupEntryObjectClass">groupOfNames</Property>
+ <Property name="SharedGroupNameListFilter">(objectClass=groupOfNames)</Property>
+ <Property name="SharedGroupNameSearchFilter">(&(objectClass=groupOfNames)(cn=?))</Property>
+ <Property name="SharedTenantNameListFilter">(objectClass=organizationalUnit)</Property>
+ <Property name="SharedTenantNameAttribute">ou</Property>
+ <Property name="SharedTenantObjectClass">organizationalUnit</Property>
+ <Property name="MembershipAttribute">member</Property>
+ <Property name="UserRolesCacheEnabled">true</Property>
+ <Property name="UserDNPattern">uid={0},ou=Users,dc=wso2,dc=org</Property>
+ <Property name="RoleDNPattern">cn={0},ou=Groups,dc=wso2,dc=org</Property>
+ <Property name="SCIMEnabled">true</Property>
+ <Property name="MaxRoleNameListLength">100</Property>
+ <Property name="MaxUserNameListLength">100</Property>
+ </ISUserStoreManager-->
+
+ <!-- Following configuration is for the CassandraUserStoreManager. The CassandraUserStoreManager is capable of using a Cassandra
+ database as a user store. This user manager supports multiple credentials for authentication. Credential types can be defined
+ and configured in the following configuration. The CassandraUserStoreManager does not ships with the any of the WSO2 Carbon
+ Servers by default, therefor Cassandra user manager component needs to be installed to the Carbon Server befor using.
+
+ And if this CassandraUserStoreManager is used as the primary user store with multi tenants, it should also implement a
+ compatible TenantManager and set property <Property name="TenantManager">FULL_QUALIFIED_TENANT_MANAGER_CLASS_NAME</Property>.
+ -->
+ <!--UserStoreManager class="org.wso2.carbon.user.cassandra.CassandraUserStoreManager">
+ <Property name="Keyspace">User_KS3</Property>
+ <Property name="Host">localhost</Property>
+ <Property name="Port">9160</Property>
+ <Property name="PasswordDigest">SHA-256</Property>
+ <Property name="StoreSaltedPassword">true</Property>
+ <Property name="AuthenticateWithAnyCredential">true</Property>
+ <Property name="DomainName">multipleCredentialUserStoreDomain</Property>
+ <MultipleCredentials>
+ <Credential type="Default">org.wso2.carbon.user.cassandra.credentialtypes.EmailCredential</Credential>
+ <Credential type="Email">org.wso2.carbon.user.cassandra.credentialtypes.EmailCredential</Credential>
+ <Credential type="PhoneNumber">org.wso2.carbon.user.cassandra.credentialtypes.PhoneNumberCredential</Credential>
+ <Credential type="Device">org.wso2.carbon.user.cassandra.credentialtypes.DeviceCredential</Credential>
+ <Credential type="External">org.wso2.carbon.user.cassandra.credentialtypes.ExternalProviderCredential</Credential>
+ </MultipleCredentials>
+ </UserStoreManager-->
+
+ <AuthorizationManager
+ class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager">
+ <Property name="AdminRoleManagementPermissions">/permission</Property>
+ <Property name="AuthorizationCacheEnabled">true</Property>
+ </AuthorizationManager>
+ </Realm>
+</UserManager>
+
+<!--*******Description of some of the configuration properties used in user-mgt.xml*********************************
+
+DomainName - This property must be used by all secondary user store managers in multiple user store configuration.
+ DomainName is a unique identifier given to the user store. Users must provide both the domain name and
+ username at log-in as "DomainName\Username"
+
+UserRolesCacheEnabled - This is to indicate whether to cache role list of a user. By default it is set to true.
+ You may need to disable it if user-roles are changed by external means and need to reflect
+ those changes in the carbon product immediately.
+
+ReplaceEscapeCharactersAtUserLogin - This is to configure whether escape characters in user name needs to be replaced at user login.
+ Currently the identified escape characters that needs to be replaced are '\' & '\\'
+
+UserDNPattern - This property will be used when authenticating users. During authentication we do a bind. But if the user is login with
+ email address or some other property we need to first lookup LDAP and retreive DN for the user. This involves an additional step.
+ If UserDNPattern is specified the DN will be contructed using the pattern specified in this property. Performance of this is much better than looking
+ up DN and binding user.
+
+RoleDNPattern - This property will be used when checking whether user has been assigned to a given role. Rather than searching the role in search base, by
+ using this property direct search can be done.
+
+passwordHashMethod - This says how the password should be stored. Allowed values are as follows,
+ SHA - Uses SHA digest method
+ MD5 - Uses MD 5 digest method
+ PLAIN_TEXT - Plain text passwords
+ In addition to above this supports all digest methods supported by http://docs.oracle.com/javase/6/docs/api/java/security/MessageDigest.html.
+
+DisplayNameAttribute - this is to have a dedicated LDAP attribute to display an entity(User/Role) in UI, in addition to the UserNameAttribute which is used for IS-UserStore interactions.
+-->
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/conf/user-mgt/_roldap.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/conf/user-mgt/_roldap.erb b/tools/puppet3/modules/appserver/templates/conf/user-mgt/_roldap.erb
new file mode 100644
index 0000000..d199df7
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/conf/user-mgt/_roldap.erb
@@ -0,0 +1,32 @@
+ <UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager">
+ <Property name="TenantManager">org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager</Property>
+ <Property name="ReadOnly">true</Property>
+ <Property name="Disabled">false</Property>
+ <Property name="MaxUserNameListLength">100</Property>
+ <Property name="ConnectionURL"><%= @ldap_connection_uri %></Property>
+ <Property name="ConnectionName"><%= @bind_dn %></Property>
+ <Property name="ConnectionPassword"><%= @bind_dn_password %></Property>
+ <Property name="passwordHashMethod">SHA</Property>
+ <Property name="UserSearchBase"><%= @user_search_base %></Property>
+ <Property name="UserNameListFilter">(objectClass=person)</Property>
+ <Property name="UserNameSearchFilter">(&(objectClass=person)(uid=?))</Property>
+ <Property name="UserNameAttribute">uid</Property>
+ <Property name="ReadGroups">true</Property>
+ <Property name="GroupSearchBase"><%= @group_search_base %></Property>
+ <Property name="GroupNameListFilter">(objectClass=groupOfNames)</Property>
+ <Property name="GroupNameSearchFilter">(&(objectClass=groupOfNames)(cn=?))</Property>
+ <Property name="GroupNameAttribute">cn</Property>
+ <Property name="SharedGroupNameAttribute">cn</Property>
+ <Property name="SharedGroupSearchBase"><%= @sharedgroup_search_base %></Property>
+ <Property name="SharedGroupNameListFilter">(objectClass=groupOfNames)</Property>
+ <Property name="SharedTenantNameListFilter">(objectClass=organizationalUnit)</Property>
+ <Property name="SharedTenantNameAttribute">ou</Property>
+ <Property name="SharedTenantObjectClass">organizationalUnit</Property>
+ <Property name="MembershipAttribute">member</Property>
+ <Property name="UserRolesCacheEnabled">true</Property>
+ <Property name="ReplaceEscapeCharactersAtUserLogin">true</Property>
+ <Property name="MaxRoleNameListLength">100</Property>
+ <Property name="MaxUserNameListLength">100</Property>
+ <Property name="SCIMEnabled">false</Property>
+ </UserStoreManager>
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/conf/user-mgt/_rwldap.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/conf/user-mgt/_rwldap.erb b/tools/puppet3/modules/appserver/templates/conf/user-mgt/_rwldap.erb
new file mode 100644
index 0000000..b480984
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/conf/user-mgt/_rwldap.erb
@@ -0,0 +1,41 @@
+ <UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager">
+ <Property name="TenantManager">org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager</Property>
+ <Property name="ConnectionURL"><%= @ldap_connection_uri %></Property>
+ <Property name="Disabled">false</Property>
+ <Property name="ConnectionName"><%= @bind_dn %></Property>
+ <Property name="ConnectionPassword"><%= @bind_dn_password %></Property>
+ <Property name="passwordHashMethod">SHA</Property>
+ <Property name="UserNameListFilter">(objectClass=person)</Property>
+ <Property name="UserEntryObjectClass">inetOrgPerson</Property>
+ <Property name="UserSearchBase"><%= @user_search_base %></Property>
+ <Property name="UserNameSearchFilter">(&(objectClass=person)(uid=?))</Property>
+ <Property name="UserNameAttribute">uid</Property>
+ <Property name="UsernameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
+ <Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
+ <Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
+ <Property name="RolenameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
+ <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
+ <Property name="ReadGroups">true</Property>
+ <Property name="WriteGroups">true</Property>
+ <Property name="EmptyRolesAllowed">false</Property>
+ <Property name="GroupSearchBase"><%= @group_search_base %></Property>
+ <Property name="GroupNameListFilter">(objectClass=groupOfNames)</Property>
+ <Property name="GroupEntryObjectClass">groupOfNames</Property>
+ <Property name="GroupNameSearchFilter">(&(objectClass=groupOfNames)(cn=?))</Property>
+ <Property name="GroupNameAttribute">cn</Property>
+ <Property name="SharedGroupNameAttribute">cn</Property>
+ <Property name="SharedGroupSearchBase"><%= @sharedgroup_search_base %></Property>
+ <Property name="SharedGroupEntryObjectClass">groupOfNames</Property>
+ <Property name="SharedGroupNameListFilter">(objectClass=groupOfNames)</Property>
+ <Property name="SharedGroupNameSearchFilter">(&(objectClass=groupOfNames)(cn=?))</Property>
+ <Property name="SharedTenantNameListFilter">(objectClass=organizationalUnit)</Property>
+ <Property name="SharedTenantNameAttribute">ou</Property>
+ <Property name="SharedTenantObjectClass">organizationalUnit</Property>
+ <Property name="MembershipAttribute">member</Property>
+ <Property name="UserRolesCacheEnabled">true</Property>
+ <Property name="ReplaceEscapeCharactersAtUserLogin">true</Property>
+ <Property name="MaxRoleNameListLength">100</Property>
+ <Property name="MaxUserNameListLength">100</Property>
+ <Property name="SCIMEnabled">false</Property>
+ </UserStoreManager>
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/haproxy/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/haproxy/manifests/init.pp b/tools/puppet3/modules/haproxy/manifests/init.pp
index f8ce3ed..dfbc4f9 100755
--- a/tools/puppet3/modules/haproxy/manifests/init.pp
+++ b/tools/puppet3/modules/haproxy/manifests/init.pp
@@ -35,6 +35,9 @@ class haproxy(
tag($service_code)
+ require java
+ class {'agent':}
+
$service_templates = [
'bin/haproxy-extension.sh',
'conf/jndi.properties',
@@ -67,4 +70,7 @@ class haproxy(
Haproxy::Push_templates[$service_templates],
];
}
+
+ # install stratos_base before java before haproxy before agent
+ Class['stratos_base'] -> Class['java'] -> Class['agent'] -> Class['haproxy']
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/jboss/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/jboss/manifests/init.pp b/tools/puppet3/modules/jboss/manifests/init.pp
index 57c3a6b..5ec75d4 100644
--- a/tools/puppet3/modules/jboss/manifests/init.pp
+++ b/tools/puppet3/modules/jboss/manifests/init.pp
@@ -33,6 +33,14 @@ class jboss (
$extra_jars = []
) {
+ require java
+
+ $custom_agent_templates = ['extensions/artifacts-updated.sh']
+ class {'agent':
+ custom_templates => $custom_agent_templates,
+ module=>'jboss'
+ }
+
include '::jboss::config'
# Application Server
@@ -46,4 +54,6 @@ class jboss (
java_opts => $java_opts,
}
+ #install stratos_base before java before jboss before agent
+ Class['stratos_base'] -> Class['java'] -> Class['agent'] -> Class['jboss']
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/jboss/templates/agent/extensions/artifacts-updated.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/jboss/templates/agent/extensions/artifacts-updated.sh.erb b/tools/puppet3/modules/jboss/templates/agent/extensions/artifacts-updated.sh.erb
new file mode 100755
index 0000000..6635515
--- /dev/null
+++ b/tools/puppet3/modules/jboss/templates/agent/extensions/artifacts-updated.sh.erb
@@ -0,0 +1,30 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed once the update artifacts
+# event is received and they are copied to the given path.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo `date`": Artifacts Updated Event" | tee -a $log
+
+chown -R <%= @jboss_user %>:<%= @jboss_group %> <%= @docroot %>
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/lb/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/lb/manifests/init.pp b/tools/puppet3/modules/lb/manifests/init.pp
index 3a9a866..1025c3f 100755
--- a/tools/puppet3/modules/lb/manifests/init.pp
+++ b/tools/puppet3/modules/lb/manifests/init.pp
@@ -39,12 +39,14 @@ class lb (
$target = '/mnt',
) inherits params {
-
$deployment_code = 'lb'
$carbon_version = $version
$service_code = 'load-balancer'
$carbon_home = "${target}/apache-stratos-${service_code}-${carbon_version}"
+ require java
+ class {'agent':}
+
$service_templates = [
'conf/axis2/axis2.xml',
'conf/loadbalancer.conf',
@@ -106,4 +108,7 @@ class lb (
Lb::Importssl[$deployment_code]
],
}
+
+ # install stratos_base before java before lb before agent
+ Class['stratos_base'] -> Class['java'] -> Class['agent'] -> Class['lb']
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/lb/manifests/initialize.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/lb/manifests/initialize.pp b/tools/puppet3/modules/lb/manifests/initialize.pp
index 63c8bb6..4331516 100755
--- a/tools/puppet3/modules/lb/manifests/initialize.pp
+++ b/tools/puppet3/modules/lb/manifests/initialize.pp
@@ -19,11 +19,11 @@
define lb::initialize ($repo, $version, $service, $local_dir, $target, $mode, $owner,) {
- file {
- "/${local_dir}/apache-stratos-${service}-${version}.zip":
- ensure => present,
- source => "puppet:///modules/lb/apache-stratos-${service}-${version}.zip";
- }
+# file {
+# "/${local_dir}/apache-stratos-${service}-${version}.zip":
+# ensure => present,
+# source => "puppet:///modules/lb/apache-stratos-${service}-${version}.zip";
+# }
exec {
"creating_target_for_${name}":
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/mysql/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/mysql/manifests/init.pp b/tools/puppet3/modules/mysql/manifests/init.pp
index 070862b..175ba92 100644
--- a/tools/puppet3/modules/mysql/manifests/init.pp
+++ b/tools/puppet3/modules/mysql/manifests/init.pp
@@ -17,6 +17,14 @@
class mysql{
+ require java
+
+ $custom_agent_templates = ['extensions/instance-started.sh']
+ class {'agent':
+ custom_templates => $custom_agent_templates,
+ module=>'mysql'
+ }
+
if $stratos_mysql_password {
$root_password = $stratos_mysql_password
}
@@ -96,4 +104,6 @@ class mysql{
require => File['/etc/apache2/sites-enabled/000-default'];
}
+ # install stratos_base before java before mysql before agent
+ Class['stratos_base'] -> Class['java'] -> Class['agent'] -> Class['mysql']
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/mysql/templates/agent/extensions/instance-started.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/mysql/templates/agent/extensions/instance-started.sh.erb b/tools/puppet3/modules/mysql/templates/agent/extensions/instance-started.sh.erb
new file mode 100755
index 0000000..1babac5
--- /dev/null
+++ b/tools/puppet3/modules/mysql/templates/agent/extensions/instance-started.sh.erb
@@ -0,0 +1,43 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed once the instance is started.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo `date`": Instance Started Event: " | tee -a $log
+
+export PATH='/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'
+
+PASSWD=`facter -p stratos_mysql_password`
+
+/etc/init.d/mysql start
+
+# Set mysql password
+mysqladmin -uroot password "$PASSWD"
+
+# Remove other users
+mysql -uroot -p"$PASSWD" -Bse "DELETE from mysql.user WHERE password=''"
+
+# Set root user with remote access
+mysql -uroot -p"$PASSWD" -Bse "CREATE USER 'root'@'%' IDENTIFIED BY '${PASSWD}'"
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/nodejs/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/nodejs/manifests/init.pp b/tools/puppet3/modules/nodejs/manifests/init.pp
index 7292a46..e31dbd8 100644
--- a/tools/puppet3/modules/nodejs/manifests/init.pp
+++ b/tools/puppet3/modules/nodejs/manifests/init.pp
@@ -17,6 +17,14 @@
class nodejs {
+ require java
+
+ $custom_agent_templates = ['extensions/start-servers.sh']
+ class {'agent':
+ custom_templates => $custom_agent_templates,
+ module=>'nodejs'
+ }
+
$target = '/mnt'
if $stratos_app_path {
@@ -65,5 +73,8 @@ class nodejs {
try_sleep => 2,
require => Exec['Install libraries'];
}
+
+ # install stratos_base before java before nodejs before agent
+ Class['stratos_base'] -> Class['java'] -> Class['agent'] -> Class['nodejs']
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/nodejs/templates/agent/extensions/start-servers.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/nodejs/templates/agent/extensions/start-servers.sh.erb b/tools/puppet3/modules/nodejs/templates/agent/extensions/start-servers.sh.erb
new file mode 100755
index 0000000..52c6c9a
--- /dev/null
+++ b/tools/puppet3/modules/nodejs/templates/agent/extensions/start-servers.sh.erb
@@ -0,0 +1,32 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed to start the servers.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo "Starting servers" | tee -a $log
+
+export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
+NODEJS_HOME=<%= @stratos_app_path %>
+npm install express
+node web.js > /dev/null 2&1 &
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/php/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/php/manifests/init.pp b/tools/puppet3/modules/php/manifests/init.pp
index e33953b..2078388 100755
--- a/tools/puppet3/modules/php/manifests/init.pp
+++ b/tools/puppet3/modules/php/manifests/init.pp
@@ -21,6 +21,15 @@
class php () {
+
+ require java
+
+ $custom_agent_templates = ['extensions/artifacts-updated.sh']
+ class {'agent':
+ custom_templates => $custom_agent_templates,
+ module=>'php'
+ }
+
$packages = [
'build-essential',
'mysql-client',
@@ -131,4 +140,6 @@ class php () {
];
}
+ #install stratos_base before java before php before agent
+ Class['stratos_base'] -> Class['java'] -> Class['agent'] -> Class['php']
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/php/templates/agent/extensions/artifacts-updated.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/php/templates/agent/extensions/artifacts-updated.sh.erb b/tools/puppet3/modules/php/templates/agent/extensions/artifacts-updated.sh.erb
new file mode 100755
index 0000000..4a94c2a
--- /dev/null
+++ b/tools/puppet3/modules/php/templates/agent/extensions/artifacts-updated.sh.erb
@@ -0,0 +1,30 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed once the update artifacts
+# event is received and they are copied to the given path.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo `date`": Artifacts Updated Event" | tee -a $log
+
+chown -R www-data:www-data /var/www
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/ruby/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/ruby/manifests/init.pp b/tools/puppet3/modules/ruby/manifests/init.pp
index 9b67106..8d54995 100644
--- a/tools/puppet3/modules/ruby/manifests/init.pp
+++ b/tools/puppet3/modules/ruby/manifests/init.pp
@@ -17,6 +17,14 @@
class ruby( $target = '/mnt' ) {
+ require java
+
+ $custom_agent_templates = ['extensions/instance-started.sh']
+ class {'agent':
+ custom_templates => $custom_agent_templates,
+ module=>'ruby'
+ }
+
if $stratos_app_path {
$ruby_home = $stratos_app_path
}
@@ -57,4 +65,7 @@ class ruby( $target = '/mnt' ) {
command => "/bin/bash /mnt/ruby-start.sh",
require => File['/mnt/ruby-start.sh'];
}
+
+ # install stratos_base before java before ruby before agent
+ Class['stratos_base'] -> Class['java'] -> Class['agent'] -> Class['ruby']
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/ruby/templates/agent/extensions/instance-started.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/ruby/templates/agent/extensions/instance-started.sh.erb b/tools/puppet3/modules/ruby/templates/agent/extensions/instance-started.sh.erb
new file mode 100755
index 0000000..7902835
--- /dev/null
+++ b/tools/puppet3/modules/ruby/templates/agent/extensions/instance-started.sh.erb
@@ -0,0 +1,46 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed once the instance is started.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo `date`": Instance Started Event: " | tee -a $log
+
+export PATH="/usr/local/rvm/gems/ruby-2.1.0/bin:/usr/local/rvm/gems/ruby-2.1.0@global/bin:/usr/local/rvm/rubies/ruby-2.1.0/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/rvm/bin:/root/bin"
+
+export HOME="/root/"
+source ~/.bashrc
+source /etc/profile.d/rvm.sh
+rvm use 2.1.0
+
+RUBY_HOME=<%= @stratos_app_path %>
+GIT_REPO=<%= @stratos_git_repo %>
+
+mkdir -p $RUBY_HOME
+
+git clone $GIT_REPO $RUBY_HOME
+cd $RUBY_HOME
+bundle install
+#rails server > /dev/null 2>&1 &
+rails server > /tmp/ruby.log 2>&1 &
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/tomcat/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/tomcat/manifests/init.pp b/tools/puppet3/modules/tomcat/manifests/init.pp
index 45f92b3..7ef64dd 100644
--- a/tools/puppet3/modules/tomcat/manifests/init.pp
+++ b/tools/puppet3/modules/tomcat/manifests/init.pp
@@ -21,6 +21,9 @@ class tomcat(
$target = '/mnt',
){
+ require java
+ class {'agent':}
+
$package_name = "apache-tomcat-${tomcat_version}"
$service_code = 'apache-tomcat'
$tomcat_home = "${target}/${package_name}"
@@ -76,5 +79,8 @@ class tomcat(
logoutput => 'on_failure',
require => Exec['Set tomcat home permission'];
}
+
+ # install stratos_base before java before tomcat before agent
+ Class['stratos_base'] -> Class['java'] -> Class['agent'] -> Class['tomcat']
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/wordpress/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/wordpress/manifests/init.pp b/tools/puppet3/modules/wordpress/manifests/init.pp
index 78328f6..20fae4e 100644
--- a/tools/puppet3/modules/wordpress/manifests/init.pp
+++ b/tools/puppet3/modules/wordpress/manifests/init.pp
@@ -22,6 +22,9 @@ class wordpress (
$wp_password = 'wordpress'
) {
+ require java
+ class {'agent':}
+
$packages = [
'httpd',
'openssl.x86_64',
@@ -84,4 +87,6 @@ class wordpress (
require => Exec['Create wordpress database'];
}
+ # install stratos_base before java before mysql before wordpress before agent
+ Class['stratos_base'] -> Class['java'] -> Class['agent'] -> Class['mysql'] -> Class['wordpress']
}
[06/12] git commit: Fixing STRATOS-762: Retrieve clusterId from
Cartridge subscription
Posted by ra...@apache.org.
Fixing STRATOS-762: Retrieve clusterId from Cartridge subscription
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/24c84ada
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/24c84ada
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/24c84ada
Branch: refs/heads/docker-integration
Commit: 24c84adacb237a13090d15c5ac1e7123c49efc2e
Parents: 4999fa8 79e5912
Author: root <ro...@puppet.dev.stratos.apache.org>
Authored: Wed Sep 10 06:33:47 2014 +0000
Committer: root <ro...@puppet.dev.stratos.apache.org>
Committed: Wed Sep 10 06:33:47 2014 +0000
----------------------------------------------------------------------
.../java/org/apache/stratos/manager/dto/Cartridge.java | 11 +++++++++++
.../stratos/rest/endpoint/services/ServiceUtils.java | 1 +
2 files changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/24c84ada/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
----------------------------------------------------------------------
[12/12] git commit: Add java2wsdl plugin for AS
Posted by ra...@apache.org.
Add java2wsdl plugin for AS
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/4979f64a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/4979f64a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/4979f64a
Branch: refs/heads/docker-integration
Commit: 4979f64ab87deff332cf2f29a61b2ff97b694187
Parents: 0e2a6c1
Author: Akila Perera <ra...@gmail.com>
Authored: Thu Sep 11 04:39:05 2014 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Thu Sep 11 04:39:05 2014 +0530
----------------------------------------------------------------------
.../org.apache.stratos.autoscaler/pom.xml | 16 +
.../KubernetesGroupAlreadyExistException.java | 66 ++-
.../rest/endpoint/services/ServiceUtils.java | 31 +
.../src/main/resources/AutoScalerService.wsdl | 573 +++++++++++++++++--
.../main/resources/CloudControllerService.wsdl | 371 ++++++------
5 files changed, 815 insertions(+), 242 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/4979f64a/components/org.apache.stratos.autoscaler/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/pom.xml b/components/org.apache.stratos.autoscaler/pom.xml
index 9234fc0..0376648 100644
--- a/components/org.apache.stratos.autoscaler/pom.xml
+++ b/components/org.apache.stratos.autoscaler/pom.xml
@@ -207,6 +207,22 @@
</instructions>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-java2wsdl-maven-plugin</artifactId>
+ <configuration>
+ <className>org.apache.stratos.autoscaler.api.AutoScalerServiceImpl</className>
+ <outputFileName>target/generated-resources/wsdl/AutoScalerService.wsdl</outputFileName>
+ <serviceName>AutoScalerService</serviceName>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>java2wsdl</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
<resources>
<resource>
http://git-wip-us.apache.org/repos/asf/stratos/blob/4979f64a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesGroupAlreadyExistException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesGroupAlreadyExistException.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesGroupAlreadyExistException.java
index 1d83ff8..2747e49 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesGroupAlreadyExistException.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesGroupAlreadyExistException.java
@@ -1,7 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.apache.stratos.rest.endpoint.exception;
-/**
- * Created by akila on 9/11/14.
- */
-public class KubernetesGroupAlreadyExistException {
+import javax.ws.rs.core.Response;
+
+public class KubernetesGroupAlreadyExistException extends RestAPIException {
+ private String message;
+ private Response.Status httpStatusCode;
+
+ public KubernetesGroupAlreadyExistException() {
+ super();
+ }
+
+ public KubernetesGroupAlreadyExistException(String message, Throwable cause) {
+ super(message, cause);
+ this.message = message;
+ }
+
+ public KubernetesGroupAlreadyExistException(Response.Status httpStatusCode, String message, Throwable cause) {
+ super(message, cause);
+ this.message = message;
+ this.httpStatusCode = httpStatusCode;
+ }
+
+ public KubernetesGroupAlreadyExistException(String message) {
+ super(message);
+ this.message = message;
+ }
+
+ public KubernetesGroupAlreadyExistException(Response.Status httpStatusCode, String message) {
+ super(message);
+ this.message = message;
+ this.httpStatusCode = httpStatusCode;
+ }
+
+ public KubernetesGroupAlreadyExistException(Throwable cause) {
+ super(cause);
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public Response.Status getHTTPStatusCode() {
+ return httpStatusCode;
+ }
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4979f64a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
index 2a8ecca..6d3bd46 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
@@ -30,6 +30,9 @@ import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidCar
import org.apache.stratos.cloud.controller.stub.pojo.CartridgeConfig;
import org.apache.stratos.cloud.controller.stub.pojo.CartridgeInfo;
import org.apache.stratos.cloud.controller.stub.pojo.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.manager.client.AutoscalerServiceClient;
import org.apache.stratos.manager.client.CloudControllerServiceClient;
import org.apache.stratos.manager.deploy.cartridge.CartridgeDeploymentManager;
@@ -65,6 +68,9 @@ import org.apache.stratos.rest.endpoint.bean.cartridge.definition.ServiceDefinit
import org.apache.stratos.rest.endpoint.bean.repositoryNotificationInfoBean.Payload;
import org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean;
import org.apache.stratos.rest.endpoint.bean.util.converter.PojoConverter;
+import org.apache.stratos.rest.endpoint.exception.KubernetesGroupDoesNotExistException;
+import org.apache.stratos.rest.endpoint.exception.KubernetesHostAlreadyDeployedException;
+import org.apache.stratos.rest.endpoint.exception.KubernetesMasterDoesNotExistException;
import org.apache.stratos.rest.endpoint.exception.RestAPIException;
import javax.ws.rs.core.Response;
@@ -162,6 +168,8 @@ public class ServiceUtils {
}
}
+
+
public static void deployAutoscalingPolicy(AutoscalePolicy autoscalePolicyBean) throws RestAPIException {
//log.info("***** " + cartridgeDefinitionBean.toString() + " *****");
@@ -1254,4 +1262,27 @@ public class ServiceUtils {
}
+ public static boolean deployKubernetesGroup(KubernetesGroup kubernetesGroup) throws KubernetesGroupDoesNotExistException {
+ return false;
+ }
+
+ public static boolean deployKubernetesHost(String kubernetesGroupId, KubernetesHost kubernetesHost) throws KubernetesHostAlreadyDeployedException{
+ return false;
+ }
+
+ public static boolean updateKubernetesMaster(KubernetesMaster kubernetesMaster) throws KubernetesMasterDoesNotExistException {
+ return false;
+ }
+
+ public static KubernetesGroup[] getAvailableKubernetesGroups() {
+ return null;
+ }
+
+ public static KubernetesGroup getKubernetesGroup(String kubernetesGroupId) throws KubernetesGroupDoesNotExistException {
+ return null;
+ }
+
+ public static boolean undeployKubernetesGroup(String kubernetesGroupId) throws KubernetesGroupDoesNotExistException {
+ return false;
+ }
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4979f64a/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 13e26de..d4f63d0 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,7 +1,27 @@
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://api.autoscaler.stratos.apache.org" xmlns:ax28="http://partition.autoscaler.stratos.apache.org/xsd" xmlns:ax25="http://pojo.stub.controller.cloud.stratos.apache.org/xsd" xmlns:ax23="http://policy.deployment.autoscaler.stratos.apache.org/xsd" xmlns:ax24="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd" xmlns:ax216="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ax214="http://model.policy.autoscaler.stratos.apache.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 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>
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax27="http://pojo.stub.controller.cloud.stratos.apache.org/xsd" xmlns:ns="http://api.autoscaler.stratos.apache.org" xmlns:ax25="http://policy.deployment.autoscaler.stratos.apache.org/xsd" xmlns:ax26="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd" xmlns:ax23="http://kubernetes.common.stratos.apache.org/xsd" xmlns:ax21="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax216="http://model.policy.autoscaler.stratos.apache.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax210="http://partition.autoscaler.stratos.apache.org/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 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.a
pache.org">
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://exception.autoscaler.stratos.apache.org/xsd">
+ <xs:complexType name="NonExistingKubernetesMasterException">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="InvalidKubernetesHostException">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="NonExistingKubernetesGroupException">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="NonExistingKubernetesHostException">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
<xs:complexType name="NonExistingLBException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
@@ -12,6 +32,11 @@
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
+ <xs:complexType name="InvalidKubernetesGroupException">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
<xs:complexType name="InvalidPolicyException">
<xs:sequence>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
@@ -21,7 +46,7 @@
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://pojo.stub.controller.cloud.stratos.apache.org/xsd">
<xs:complexType name="Properties">
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax25:Property"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax27:Property"/>
<xs:element minOccurs="0" name="propertiesSpecified" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
@@ -34,12 +59,140 @@
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax217="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax215="http://model.policy.autoscaler.stratos.apache.org/xsd" xmlns:ax212="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd" xmlns:ax213="http://partition.autoscaler.stratos.apache.org/xsd" xmlns:ax211="http://policy.deployment.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://api.autoscaler.stratos.apache.org">
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://kubernetes.common.stratos.apache.org/xsd">
+ <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="ax23:Properties"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Properties">
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="properties" nillable="true" type="ax23:Property"/>
+ </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:sequence>
+ </xs:complexType>
+ <xs:complexType name="KubernetesMaster">
+ <xs:complexContent>
+ <xs:extension base="ax23:KubernetesHost">
+ <xs:sequence/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="KubernetesGroup">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="groupId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="kubernetesHosts" nillable="true" type="xs:anyType"/>
+ <xs:element minOccurs="0" name="kubernetesMasters" nillable="true" type="xs:anyType"/>
+ <xs:element minOccurs="0" name="portRange" nillable="true" type="ax23:PortRange"/>
+ </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:sequence>
+ </xs:complexType>
+ </xs:schema>
+ <xs:schema xmlns:ax24="http://kubernetes.common.stratos.apache.org/xsd" xmlns:ax217="http://model.policy.autoscaler.stratos.apache.org/xsd" xmlns:ax22="http://exception.autoscaler.stratos.apache.org/xsd" xmlns:ax214="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd" xmlns:ax215="http://partition.autoscaler.stratos.apache.org/xsd" xmlns:ax213="http://policy.deployment.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://api.autoscaler.stratos.apache.org">
+ <xs:import namespace="http://exception.autoscaler.stratos.apache.org/xsd"/>
+ <xs:import namespace="http://kubernetes.common.stratos.apache.org/xsd"/>
<xs:import namespace="http://policy.deployment.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd"/>
<xs:import namespace="http://partition.autoscaler.stratos.apache.org/xsd"/>
<xs:import namespace="http://model.policy.autoscaler.stratos.apache.org/xsd"/>
- <xs:import namespace="http://exception.autoscaler.stratos.apache.org/xsd"/>
+ <xs:element name="AutoScalerServiceNonExistingKubernetesMasterException">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="NonExistingKubernetesMasterException" nillable="true" type="ax21:NonExistingKubernetesMasterException"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="updateKubernetesMaster">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="kubernetesMaster" nillable="true" type="ax23:KubernetesMaster"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="updateKubernetesMasterResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </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: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:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="updateKubernetesHost">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="groupId" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="kubernetesHost" nillable="true" type="ax23:KubernetesHost"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="updateKubernetesHostResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </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: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:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="removeKubernetesHostResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </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:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="removeKubernetesGroupResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
<xs:element name="getValidDeploymentPoliciesforCartridge">
<xs:complexType>
<xs:sequence>
@@ -50,7 +203,7 @@
<xs:element name="getValidDeploymentPoliciesforCartridgeResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax23:DeploymentPolicy"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax25:DeploymentPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -80,7 +233,7 @@
<xs:element name="getPartitionsOfGroupResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:Partition"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:Partition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -94,7 +247,7 @@
<xs:element name="getPartitionsOfDeploymentPolicyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:Partition"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:Partition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -108,7 +261,7 @@
<xs:element name="getPartitionGroupsResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax28:PartitionGroup"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax215:PartitionGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -122,7 +275,7 @@
<xs:element name="getPartitionResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax24:Partition"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax26:Partition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -136,7 +289,7 @@
<xs:element name="getDeploymentPolicyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax23:DeploymentPolicy"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax25:DeploymentPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -164,7 +317,7 @@
<xs:element name="getAutoscalingPolicyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="return" nillable="true" type="ax214:AutoscalePolicy"/>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax217:AutoscalePolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -176,7 +329,7 @@
<xs:element name="getAllDeploymentPoliciesResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax23:DeploymentPolicy"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax25:DeploymentPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -188,7 +341,7 @@
<xs:element name="getAllAvailablePartitionsResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax24:Partition"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax26:Partition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -200,7 +353,7 @@
<xs:element name="getAllAutoScalingPolicyResponse">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax214:AutoscalePolicy"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax217:AutoscalePolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -222,7 +375,7 @@
<xs:element name="AutoScalerServiceNonExistingLBException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="NonExistingLBException" nillable="true" type="ax217:NonExistingLBException"/>
+ <xs:element minOccurs="0" name="NonExistingLBException" nillable="true" type="ax21:NonExistingLBException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -266,14 +419,14 @@
<xs:element name="AutoScalerServiceInvalidPartitionException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidPartitionException" nillable="true" type="ax217:InvalidPartitionException"/>
+ <xs:element minOccurs="0" name="InvalidPartitionException" nillable="true" type="ax21:InvalidPartitionException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="addPartition">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="partition" nillable="true" type="ax24:Partition"/>
+ <xs:element minOccurs="0" name="partition" nillable="true" type="ax26:Partition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -284,17 +437,53 @@
</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="ax23:KubernetesHost"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="addKubernetesHostResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </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:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="addKubernetesGroup">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="kubernetesGroup" nillable="true" type="ax23:KubernetesGroup"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="addKubernetesGroupResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
<xs:element name="AutoScalerServiceInvalidPolicyException">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="InvalidPolicyException" nillable="true" type="ax217:InvalidPolicyException"/>
+ <xs:element minOccurs="0" name="InvalidPolicyException" nillable="true" type="ax21:InvalidPolicyException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="addDeploymentPolicy">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="depPolicy" nillable="true" type="ax23:DeploymentPolicy"/>
+ <xs:element minOccurs="0" name="depPolicy" nillable="true" type="ax25:DeploymentPolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -308,7 +497,7 @@
<xs:element name="addAutoScalingPolicy">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" name="aspolicy" nillable="true" type="ax214:AutoscalePolicy"/>
+ <xs:element minOccurs="0" name="aspolicy" nillable="true" type="ax217:AutoscalePolicy"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -320,13 +509,13 @@
</xs:complexType>
</xs:element>
</xs:schema>
- <xs:schema xmlns:ax29="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.autoscaler.stratos.apache.org/xsd">
+ <xs:schema xmlns:ax211="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.autoscaler.stratos.apache.org/xsd">
<xs:import namespace="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd"/>
<xs:complexType name="PartitionGroup">
<xs:sequence>
<xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="partitionAlgo" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="partitions" nillable="true" type="ax29:Partition"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="partitions" nillable="true" type="ax211:Partition"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
@@ -336,14 +525,14 @@
<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="loadThresholds" nillable="true" type="ax214:LoadThresholds"/>
+ <xs:element minOccurs="0" name="loadThresholds" nillable="true" type="ax216:LoadThresholds"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="LoadThresholds">
<xs:sequence>
- <xs:element minOccurs="0" name="loadAverage" nillable="true" type="ax214:LoadAverageThresholds"/>
- <xs:element minOccurs="0" name="memoryConsumption" nillable="true" type="ax214:MemoryConsumptionThresholds"/>
- <xs:element minOccurs="0" name="requestsInFlight" nillable="true" type="ax214:RequestsInFlightThresholds"/>
+ <xs:element minOccurs="0" name="loadAverage" nillable="true" type="ax216:LoadAverageThresholds"/>
+ <xs:element minOccurs="0" name="memoryConsumption" nillable="true" type="ax216:MemoryConsumptionThresholds"/>
+ <xs:element minOccurs="0" name="requestsInFlight" nillable="true" type="ax216:RequestsInFlightThresholds"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="LoadAverageThresholds">
@@ -365,29 +554,31 @@
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax27="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd" xmlns:ax210="http://partition.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://policy.deployment.autoscaler.stratos.apache.org/xsd">
+ <xs:schema xmlns:ax29="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd" xmlns:ax212="http://partition.autoscaler.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://policy.deployment.autoscaler.stratos.apache.org/xsd">
<xs:import namespace="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd"/>
<xs:import namespace="http://partition.autoscaler.stratos.apache.org/xsd"/>
<xs:complexType name="DeploymentPolicy">
<xs:sequence>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="allPartitions" nillable="true" type="ax27:Partition"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="allPartitions" nillable="true" type="ax29:Partition"/>
<xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="partitionGroups" nillable="true" type="ax28:PartitionGroup"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="partitionGroups" nillable="true" type="ax212:PartitionGroup"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ax26="http://pojo.stub.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd">
+ <xs:schema xmlns:ax28="http://pojo.stub.controller.cloud.stratos.apache.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://partition.deployment.stub.controller.cloud.stratos.apache.org/xsd">
<xs:import namespace="http://pojo.stub.controller.cloud.stratos.apache.org/xsd"/>
<xs:complexType name="Partition">
<xs:sequence>
+ <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="descriptionSpecified" type="xs:boolean"/>
<xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="idSpecified" type="xs:boolean"/>
<xs:element minOccurs="0" name="partitionMax" type="xs:int"/>
<xs:element minOccurs="0" name="partitionMaxSpecified" type="xs:boolean"/>
<xs:element minOccurs="0" name="partitionMin" type="xs:int"/>
<xs:element minOccurs="0" name="partitionMinSpecified" type="xs:boolean"/>
- <xs:element minOccurs="0" name="properties" nillable="true" type="ax25:Properties"/>
+ <xs:element minOccurs="0" name="properties" nillable="true" type="ax27:Properties"/>
<xs:element minOccurs="0" name="propertiesSpecified" type="xs:boolean"/>
<xs:element minOccurs="0" name="provider" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="providerSpecified" type="xs:boolean"/>
@@ -395,6 +586,24 @@
</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:message>
+ <wsdl:message name="updateKubernetesMasterResponse">
+ <wsdl:part name="parameters" element="ns:updateKubernetesMasterResponse"/>
+ </wsdl:message>
+ <wsdl:message name="AutoScalerServiceNonExistingKubernetesMasterException">
+ <wsdl:part name="parameters" element="ns:AutoScalerServiceNonExistingKubernetesMasterException"/>
+ </wsdl:message>
<wsdl:message name="getPartitionsOfDeploymentPolicyRequest">
<wsdl:part name="parameters" element="ns:getPartitionsOfDeploymentPolicy"/>
</wsdl:message>
@@ -440,12 +649,30 @@
<wsdl:message name="getAllDeploymentPoliciesResponse">
<wsdl:part name="parameters" element="ns:getAllDeploymentPoliciesResponse"/>
</wsdl:message>
+ <wsdl:message name="removeKubernetesGroupRequest">
+ <wsdl:part name="parameters" element="ns:removeKubernetesGroup"/>
+ </wsdl:message>
+ <wsdl:message name="removeKubernetesGroupResponse">
+ <wsdl:part name="parameters" element="ns:removeKubernetesGroupResponse"/>
+ </wsdl:message>
+ <wsdl:message name="AutoScalerServiceNonExistingKubernetesGroupException">
+ <wsdl:part name="parameters" element="ns:AutoScalerServiceNonExistingKubernetesGroupException"/>
+ </wsdl:message>
<wsdl:message name="getValidDeploymentPoliciesforCartridgeRequest">
<wsdl:part name="parameters" element="ns:getValidDeploymentPoliciesforCartridge"/>
</wsdl:message>
<wsdl:message name="getValidDeploymentPoliciesforCartridgeResponse">
<wsdl:part name="parameters" element="ns:getValidDeploymentPoliciesforCartridgeResponse"/>
</wsdl:message>
+ <wsdl:message name="addKubernetesHostRequest">
+ <wsdl:part name="parameters" element="ns:addKubernetesHost"/>
+ </wsdl:message>
+ <wsdl:message name="addKubernetesHostResponse">
+ <wsdl:part name="parameters" element="ns:addKubernetesHostResponse"/>
+ </wsdl:message>
+ <wsdl:message name="AutoScalerServiceInvalidKubernetesHostException">
+ <wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidKubernetesHostException"/>
+ </wsdl:message>
<wsdl:message name="getAllAvailablePartitionsRequest">
<wsdl:part name="parameters" element="ns:getAllAvailablePartitions"/>
</wsdl:message>
@@ -476,20 +703,21 @@
<wsdl:message name="getPartitionResponse">
<wsdl:part name="parameters" element="ns:getPartitionResponse"/>
</wsdl:message>
+ <wsdl:message name="removeKubernetesHostRequest">
+ <wsdl:part name="parameters" element="ns:removeKubernetesHost"/>
+ </wsdl:message>
+ <wsdl:message name="removeKubernetesHostResponse">
+ <wsdl:part name="parameters" element="ns:removeKubernetesHostResponse"/>
+ </wsdl:message>
+ <wsdl:message name="AutoScalerServiceNonExistingKubernetesHostException">
+ <wsdl:part name="parameters" element="ns:AutoScalerServiceNonExistingKubernetesHostException"/>
+ </wsdl:message>
<wsdl:message name="addPartitionRequest">
<wsdl:part name="parameters" element="ns:addPartition"/>
</wsdl:message>
<wsdl:message name="addPartitionResponse">
<wsdl:part name="parameters" element="ns:addPartitionResponse"/>
</wsdl:message>
-
- <wsdl:message name="addKubernetesRequest">
- <wsdl:part name="parameters" element="ns:addPartition"></wsdl:part>
- </wsdl:message>
- <wsdl:message name="addPartitionResponse">
- <wsdl:part name="parameters" element="ns:addPartitionResponse"></wsdl:part>
- </wsdl:message>
-
<wsdl:message name="AutoScalerServiceInvalidPartitionException">
<wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidPartitionException"/>
</wsdl:message>
@@ -511,6 +739,12 @@
<wsdl:message name="getServiceLBClusterIdResponse">
<wsdl:part name="parameters" element="ns:getServiceLBClusterIdResponse"/>
</wsdl:message>
+ <wsdl:message name="updateKubernetesHostRequest">
+ <wsdl:part name="parameters" element="ns:updateKubernetesHost"/>
+ </wsdl:message>
+ <wsdl:message name="updateKubernetesHostResponse">
+ <wsdl:part name="parameters" element="ns:updateKubernetesHostResponse"/>
+ </wsdl:message>
<wsdl:message name="getPartitionGroupsRequest">
<wsdl:part name="parameters" element="ns:getPartitionGroups"/>
</wsdl:message>
@@ -524,6 +758,16 @@
<wsdl:part name="parameters" element="ns:AutoScalerServiceNonExistingLBException"/>
</wsdl:message>
<wsdl:portType name="AutoScalerServicePortType">
+ <wsdl:operation name="addKubernetesGroup">
+ <wsdl:input message="ns:addKubernetesGroupRequest" wsaw:Action="urn:addKubernetesGroup"/>
+ <wsdl:output message="ns:addKubernetesGroupResponse" wsaw:Action="urn:addKubernetesGroupResponse"/>
+ <wsdl:fault message="ns:AutoScalerServiceInvalidKubernetesGroupException" name="AutoScalerServiceInvalidKubernetesGroupException" wsaw:Action="urn:addKubernetesGroupAutoScalerServiceInvalidKubernetesGroupException"/>
+ </wsdl:operation>
+ <wsdl:operation name="updateKubernetesMaster">
+ <wsdl:input message="ns:updateKubernetesMasterRequest" wsaw:Action="urn:updateKubernetesMaster"/>
+ <wsdl:output message="ns:updateKubernetesMasterResponse" wsaw:Action="urn:updateKubernetesMasterResponse"/>
+ <wsdl:fault message="ns:AutoScalerServiceNonExistingKubernetesMasterException" name="AutoScalerServiceNonExistingKubernetesMasterException" wsaw:Action="urn:updateKubernetesMasterAutoScalerServiceNonExistingKubernetesMasterException"/>
+ </wsdl:operation>
<wsdl:operation name="getPartitionsOfDeploymentPolicy">
<wsdl:input message="ns:getPartitionsOfDeploymentPolicyRequest" wsaw:Action="urn:getPartitionsOfDeploymentPolicy"/>
<wsdl:output message="ns:getPartitionsOfDeploymentPolicyResponse" wsaw:Action="urn:getPartitionsOfDeploymentPolicyResponse"/>
@@ -553,10 +797,21 @@
<wsdl:input message="ns:getAllDeploymentPoliciesRequest" wsaw:Action="urn:getAllDeploymentPolicies"/>
<wsdl:output message="ns:getAllDeploymentPoliciesResponse" wsaw:Action="urn:getAllDeploymentPoliciesResponse"/>
</wsdl:operation>
+ <wsdl:operation name="removeKubernetesGroup">
+ <wsdl:input message="ns:removeKubernetesGroupRequest" wsaw:Action="urn:removeKubernetesGroup"/>
+ <wsdl:output message="ns:removeKubernetesGroupResponse" wsaw:Action="urn:removeKubernetesGroupResponse"/>
+ <wsdl:fault message="ns:AutoScalerServiceNonExistingKubernetesGroupException" name="AutoScalerServiceNonExistingKubernetesGroupException" wsaw:Action="urn:removeKubernetesGroupAutoScalerServiceNonExistingKubernetesGroupException"/>
+ </wsdl:operation>
<wsdl:operation name="getValidDeploymentPoliciesforCartridge">
<wsdl:input message="ns:getValidDeploymentPoliciesforCartridgeRequest" wsaw:Action="urn:getValidDeploymentPoliciesforCartridge"/>
<wsdl:output message="ns:getValidDeploymentPoliciesforCartridgeResponse" wsaw:Action="urn:getValidDeploymentPoliciesforCartridgeResponse"/>
</wsdl:operation>
+ <wsdl:operation name="addKubernetesHost">
+ <wsdl:input message="ns:addKubernetesHostRequest" wsaw:Action="urn:addKubernetesHost"/>
+ <wsdl:output message="ns:addKubernetesHostResponse" wsaw:Action="urn:addKubernetesHostResponse"/>
+ <wsdl:fault message="ns:AutoScalerServiceInvalidKubernetesHostException" name="AutoScalerServiceInvalidKubernetesHostException" wsaw:Action="urn:addKubernetesHostAutoScalerServiceInvalidKubernetesHostException"/>
+ <wsdl:fault message="ns:AutoScalerServiceNonExistingKubernetesGroupException" name="AutoScalerServiceNonExistingKubernetesGroupException" wsaw:Action="urn:addKubernetesHostAutoScalerServiceNonExistingKubernetesGroupException"/>
+ </wsdl:operation>
<wsdl:operation name="getAllAvailablePartitions">
<wsdl:input message="ns:getAllAvailablePartitionsRequest" wsaw:Action="urn:getAllAvailablePartitions"/>
<wsdl:output message="ns:getAllAvailablePartitionsResponse" wsaw:Action="urn:getAllAvailablePartitionsResponse"/>
@@ -577,6 +832,11 @@
<wsdl:input message="ns:getPartitionRequest" wsaw:Action="urn:getPartition"/>
<wsdl:output message="ns:getPartitionResponse" wsaw:Action="urn:getPartitionResponse"/>
</wsdl:operation>
+ <wsdl:operation name="removeKubernetesHost">
+ <wsdl:input message="ns:removeKubernetesHostRequest" wsaw:Action="urn:removeKubernetesHost"/>
+ <wsdl:output message="ns:removeKubernetesHostResponse" wsaw:Action="urn:removeKubernetesHostResponse"/>
+ <wsdl:fault message="ns:AutoScalerServiceNonExistingKubernetesHostException" name="AutoScalerServiceNonExistingKubernetesHostException" wsaw:Action="urn:removeKubernetesHostAutoScalerServiceNonExistingKubernetesHostException"/>
+ </wsdl:operation>
<wsdl:operation name="addPartition">
<wsdl:input message="ns:addPartitionRequest" wsaw:Action="urn:addPartition"/>
<wsdl:output message="ns:addPartitionResponse" wsaw:Action="urn:addPartitionResponse"/>
@@ -595,6 +855,12 @@
<wsdl:input message="ns:getServiceLBClusterIdRequest" wsaw:Action="urn:getServiceLBClusterId"/>
<wsdl:output message="ns:getServiceLBClusterIdResponse" wsaw:Action="urn:getServiceLBClusterIdResponse"/>
</wsdl:operation>
+ <wsdl:operation name="updateKubernetesHost">
+ <wsdl:input message="ns:updateKubernetesHostRequest" wsaw:Action="urn:updateKubernetesHost"/>
+ <wsdl:output message="ns:updateKubernetesHostResponse" wsaw:Action="urn:updateKubernetesHostResponse"/>
+ <wsdl:fault message="ns:AutoScalerServiceInvalidKubernetesHostException" name="AutoScalerServiceInvalidKubernetesHostException" wsaw:Action="urn:updateKubernetesHostAutoScalerServiceInvalidKubernetesHostException"/>
+ <wsdl:fault message="ns:AutoScalerServiceNonExistingKubernetesGroupException" name="AutoScalerServiceNonExistingKubernetesGroupException" wsaw:Action="urn:updateKubernetesHostAutoScalerServiceNonExistingKubernetesGroupException"/>
+ </wsdl:operation>
<wsdl:operation name="getPartitionGroups">
<wsdl:input message="ns:getPartitionGroupsRequest" wsaw:Action="urn:getPartitionGroups"/>
<wsdl:output message="ns:getPartitionGroupsResponse" wsaw:Action="urn:getPartitionGroupsResponse"/>
@@ -606,6 +872,30 @@
</wsdl:portType>
<wsdl:binding name="AutoScalerServiceSoap11Binding" type="ns:AutoScalerServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="updateKubernetesMaster">
+ <soap:operation soapAction="urn:updateKubernetesMaster" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AutoScalerServiceNonExistingKubernetesMasterException">
+ <soap:fault use="literal" name="AutoScalerServiceNonExistingKubernetesMasterException"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="addKubernetesGroup">
+ <soap:operation soapAction="urn:addKubernetesGroup" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AutoScalerServiceInvalidKubernetesGroupException">
+ <soap:fault use="literal" name="AutoScalerServiceInvalidKubernetesGroupException"/>
+ </wsdl:fault>
+ </wsdl:operation>
<wsdl:operation name="getPartitionsOfDeploymentPolicy">
<soap:operation soapAction="urn:getPartitionsOfDeploymentPolicy" style="document"/>
<wsdl:input>
@@ -663,6 +953,18 @@
<soap:fault use="literal" name="AutoScalerServiceInvalidPolicyException"/>
</wsdl:fault>
</wsdl:operation>
+ <wsdl:operation name="removeKubernetesGroup">
+ <soap:operation soapAction="urn:removeKubernetesGroup" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AutoScalerServiceNonExistingKubernetesGroupException">
+ <soap:fault use="literal" name="AutoScalerServiceNonExistingKubernetesGroupException"/>
+ </wsdl:fault>
+ </wsdl:operation>
<wsdl:operation name="getAllDeploymentPolicies">
<soap:operation soapAction="urn:getAllDeploymentPolicies" style="document"/>
<wsdl:input>
@@ -681,6 +983,21 @@
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="addKubernetesHost">
+ <soap:operation soapAction="urn:addKubernetesHost" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AutoScalerServiceInvalidKubernetesHostException">
+ <soap:fault use="literal" name="AutoScalerServiceInvalidKubernetesHostException"/>
+ </wsdl:fault>
+ <wsdl:fault name="AutoScalerServiceNonExistingKubernetesGroupException">
+ <soap:fault use="literal" name="AutoScalerServiceNonExistingKubernetesGroupException"/>
+ </wsdl:fault>
+ </wsdl:operation>
<wsdl:operation name="getAllAvailablePartitions">
<soap:operation soapAction="urn:getAllAvailablePartitions" style="document"/>
<wsdl:input>
@@ -726,6 +1043,18 @@
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="removeKubernetesHost">
+ <soap:operation soapAction="urn:removeKubernetesHost" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AutoScalerServiceNonExistingKubernetesHostException">
+ <soap:fault use="literal" name="AutoScalerServiceNonExistingKubernetesHostException"/>
+ </wsdl:fault>
+ </wsdl:operation>
<wsdl:operation name="addPartition">
<soap:operation soapAction="urn:addPartition" style="document"/>
<wsdl:input>
@@ -777,6 +1106,21 @@
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="updateKubernetesHost">
+ <soap:operation soapAction="urn:updateKubernetesHost" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AutoScalerServiceInvalidKubernetesHostException">
+ <soap:fault use="literal" name="AutoScalerServiceInvalidKubernetesHostException"/>
+ </wsdl:fault>
+ <wsdl:fault name="AutoScalerServiceNonExistingKubernetesGroupException">
+ <soap:fault use="literal" name="AutoScalerServiceNonExistingKubernetesGroupException"/>
+ </wsdl:fault>
+ </wsdl:operation>
<wsdl:operation name="checkLBExistenceAgainstPolicy">
<soap:operation soapAction="urn:checkLBExistenceAgainstPolicy" style="document"/>
<wsdl:input>
@@ -789,6 +1133,30 @@
</wsdl:binding>
<wsdl:binding name="AutoScalerServiceSoap12Binding" type="ns:AutoScalerServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="updateKubernetesMaster">
+ <soap12:operation soapAction="urn:updateKubernetesMaster" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AutoScalerServiceNonExistingKubernetesMasterException">
+ <soap12:fault use="literal" name="AutoScalerServiceNonExistingKubernetesMasterException"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="addKubernetesGroup">
+ <soap12:operation soapAction="urn:addKubernetesGroup" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AutoScalerServiceInvalidKubernetesGroupException">
+ <soap12:fault use="literal" name="AutoScalerServiceInvalidKubernetesGroupException"/>
+ </wsdl:fault>
+ </wsdl:operation>
<wsdl:operation name="getPartitionsOfDeploymentPolicy">
<soap12:operation soapAction="urn:getPartitionsOfDeploymentPolicy" style="document"/>
<wsdl:input>
@@ -846,6 +1214,18 @@
<soap12:fault use="literal" name="AutoScalerServiceInvalidPolicyException"/>
</wsdl:fault>
</wsdl:operation>
+ <wsdl:operation name="removeKubernetesGroup">
+ <soap12:operation soapAction="urn:removeKubernetesGroup" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AutoScalerServiceNonExistingKubernetesGroupException">
+ <soap12:fault use="literal" name="AutoScalerServiceNonExistingKubernetesGroupException"/>
+ </wsdl:fault>
+ </wsdl:operation>
<wsdl:operation name="getAllDeploymentPolicies">
<soap12:operation soapAction="urn:getAllDeploymentPolicies" style="document"/>
<wsdl:input>
@@ -864,6 +1244,21 @@
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="addKubernetesHost">
+ <soap12:operation soapAction="urn:addKubernetesHost" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AutoScalerServiceInvalidKubernetesHostException">
+ <soap12:fault use="literal" name="AutoScalerServiceInvalidKubernetesHostException"/>
+ </wsdl:fault>
+ <wsdl:fault name="AutoScalerServiceNonExistingKubernetesGroupException">
+ <soap12:fault use="literal" name="AutoScalerServiceNonExistingKubernetesGroupException"/>
+ </wsdl:fault>
+ </wsdl:operation>
<wsdl:operation name="getAllAvailablePartitions">
<soap12:operation soapAction="urn:getAllAvailablePartitions" style="document"/>
<wsdl:input>
@@ -909,6 +1304,18 @@
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="removeKubernetesHost">
+ <soap12:operation soapAction="urn:removeKubernetesHost" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AutoScalerServiceNonExistingKubernetesHostException">
+ <soap12:fault use="literal" name="AutoScalerServiceNonExistingKubernetesHostException"/>
+ </wsdl:fault>
+ </wsdl:operation>
<wsdl:operation name="addPartition">
<soap12:operation soapAction="urn:addPartition" style="document"/>
<wsdl:input>
@@ -960,6 +1367,21 @@
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="updateKubernetesHost">
+ <soap12:operation soapAction="urn:updateKubernetesHost" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AutoScalerServiceInvalidKubernetesHostException">
+ <soap12:fault use="literal" name="AutoScalerServiceInvalidKubernetesHostException"/>
+ </wsdl:fault>
+ <wsdl:fault name="AutoScalerServiceNonExistingKubernetesGroupException">
+ <soap12:fault use="literal" name="AutoScalerServiceNonExistingKubernetesGroupException"/>
+ </wsdl:fault>
+ </wsdl:operation>
<wsdl:operation name="checkLBExistenceAgainstPolicy">
<soap12:operation soapAction="urn:checkLBExistenceAgainstPolicy" style="document"/>
<wsdl:input>
@@ -972,6 +1394,24 @@
</wsdl:binding>
<wsdl:binding name="AutoScalerServiceHttpBinding" type="ns:AutoScalerServicePortType">
<http:binding verb="POST"/>
+ <wsdl:operation name="updateKubernetesMaster">
+ <http:operation location="updateKubernetesMaster"/>
+ <wsdl:input>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="addKubernetesGroup">
+ <http:operation location="addKubernetesGroup"/>
+ <wsdl:input>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="getPartitionsOfDeploymentPolicy">
<http:operation location="getPartitionsOfDeploymentPolicy"/>
<wsdl:input>
@@ -1026,6 +1466,15 @@
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="removeKubernetesGroup">
+ <http:operation location="removeKubernetesGroup"/>
+ <wsdl:input>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="getAllDeploymentPolicies">
<http:operation location="getAllDeploymentPolicies"/>
<wsdl:input>
@@ -1044,6 +1493,15 @@
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="addKubernetesHost">
+ <http:operation location="addKubernetesHost"/>
+ <wsdl:input>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="getAllAvailablePartitions">
<http:operation location="getAllAvailablePartitions"/>
<wsdl:input>
@@ -1089,6 +1547,15 @@
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="removeKubernetesHost">
+ <http:operation location="removeKubernetesHost"/>
+ <wsdl:input>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="addPartition">
<http:operation location="addPartition"/>
<wsdl:input>
@@ -1134,6 +1601,15 @@
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="updateKubernetesHost">
+ <http:operation location="updateKubernetesHost"/>
+ <wsdl:input>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content type="text/xml" part="parameters"/>
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="checkLBExistenceAgainstPolicy">
<http:operation location="checkLBExistenceAgainstPolicy"/>
<wsdl:input>
@@ -1143,22 +1619,13 @@
</wsdl:binding>
<wsdl:service name="AutoScalerService">
<wsdl:port name="AutoScalerServiceHttpSoap11Endpoint" binding="ns:AutoScalerServiceSoap11Binding">
- <soap:address location="http://192.168.122.1:9763/services/AutoScalerService.AutoScalerServiceHttpSoap11Endpoint/"/>
- </wsdl:port>
- <wsdl:port name="AutoScalerServiceHttpsSoap11Endpoint" binding="ns:AutoScalerServiceSoap11Binding">
- <soap:address location="https://192.168.122.1:9443/services/AutoScalerService.AutoScalerServiceHttpsSoap11Endpoint/"/>
- </wsdl:port>
- <wsdl:port name="AutoScalerServiceHttpsSoap12Endpoint" binding="ns:AutoScalerServiceSoap12Binding">
- <soap12:address location="https://192.168.122.1:9443/services/AutoScalerService.AutoScalerServiceHttpsSoap12Endpoint/"/>
+ <soap:address location="http://localhost:8080/axis2/services/AutoScalerService"/>
</wsdl:port>
<wsdl:port name="AutoScalerServiceHttpSoap12Endpoint" binding="ns:AutoScalerServiceSoap12Binding">
- <soap12:address location="http://192.168.122.1:9763/services/AutoScalerService.AutoScalerServiceHttpSoap12Endpoint/"/>
+ <soap12:address location="http://localhost:8080/axis2/services/AutoScalerService"/>
</wsdl:port>
<wsdl:port name="AutoScalerServiceHttpEndpoint" binding="ns:AutoScalerServiceHttpBinding">
- <http:address location="http://192.168.122.1:9763/services/AutoScalerService.AutoScalerServiceHttpEndpoint/"/>
- </wsdl:port>
- <wsdl:port name="AutoScalerServiceHttpsEndpoint" binding="ns:AutoScalerServiceHttpBinding">
- <http:address location="https://192.168.122.1:9443/services/AutoScalerService.AutoScalerServiceHttpsEndpoint/"/>
+ <http:address location="http://localhost:8080/axis2/services/AutoScalerService"/>
</wsdl:port>
</wsdl:service>
-</wsdl:definitions>
\ No newline at end of file
+</wsdl:definitions>
[10/12] git commit: merge and cleanup with CC and AS API
Posted by ra...@apache.org.
merge and cleanup with CC and AS API
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/0e2a6c14
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/0e2a6c14
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/0e2a6c14
Branch: refs/heads/docker-integration
Commit: 0e2a6c14f13c69a551789cc16f20fa1cf0cb6388
Parents: 2ea9d03 2787399
Author: Akila Perera <ra...@gmail.com>
Authored: Thu Sep 11 04:38:35 2014 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Thu Sep 11 04:38:35 2014 +0530
----------------------------------------------------------------------
.../org.apache.stratos.cloud.controller/pom.xml | 16 +
.../cloud/controller/pojo/Cartridge.java | 10 +
.../cloud/controller/pojo/CartridgeConfig.java | 11 +
.../cloud/controller/pojo/Container.java | 59 +++
.../deploy/cartridge/CartridgeDeployer.java | 37 ++
.../cartridge/CartridgeDeploymentManager.java | 31 ++
.../cartridge/DefaultCartridgeDeployer.java | 30 ++
.../cartridge/DockerCartridgeDeployer.java | 19 +
.../messaging/domain/topology/Cluster.java | 15 +-
.../definition/CartridgeDefinitionBean.java | 4 +
.../cartridge/definition/ContainerBean.java | 14 +
.../KubernetesGroupAlreadyExistException.java | 7 +
.../rest/endpoint/services/ServiceUtils.java | 76 +---
.../main/resources/CloudControllerService.wsdl | 394 +++++++++----------
14 files changed, 456 insertions(+), 267 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/0e2a6c14/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesGroupAlreadyExistException.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesGroupAlreadyExistException.java
index 0000000,0000000..1d83ff8
new file mode 100644
--- /dev/null
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/KubernetesGroupAlreadyExistException.java
@@@ -1,0 -1,0 +1,7 @@@
++package org.apache.stratos.rest.endpoint.exception;
++
++/**
++ * Created by akila on 9/11/14.
++ */
++public class KubernetesGroupAlreadyExistException {
++}
http://git-wip-us.apache.org/repos/asf/stratos/blob/0e2a6c14/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
index b14a63b,39493a6..2a8ecca
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
@@@ -69,16 -76,8 +65,14 @@@ import org.apache.stratos.rest.endpoint
import org.apache.stratos.rest.endpoint.bean.repositoryNotificationInfoBean.Payload;
import org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean;
import org.apache.stratos.rest.endpoint.bean.util.converter.PojoConverter;
- import org.apache.stratos.rest.endpoint.exception.KubernetesGroupDoesNotExistException;
- import org.apache.stratos.rest.endpoint.exception.KubernetesMasterDoesNotExistException;
import org.apache.stratos.rest.endpoint.exception.RestAPIException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import java.rmi.RemoteException;
+import java.util.*;
+import java.util.regex.Pattern;
+
public class ServiceUtils {
public static final String IS_VOLUME_REQUIRED = "volume.required";
public static final String SHOULD_DELETE_VOLUME = "volume.delete.on.unsubscription";
@@@ -87,45 -86,23 +81,23 @@@
public static final String VOLUME_ID = "volume.id";
private static Log log = LogFactory.getLog(ServiceUtils.class);
- private static ServiceDeploymentManager serviceDeploymentManager = new ServiceDeploymentManager();
+ private static ServiceDeploymentManager serviceDeploymentManager = new ServiceDeploymentManager();
- static void deployCartridge(CartridgeDefinitionBean cartridgeDefinitionBean, ConfigurationContext ctxt,
- String userName, String tenantDomain) throws RestAPIException {
- static void deployCartridge(CartridgeDefinitionBean cartridgeDefinitionBean, ConfigurationContext ctxt, String userName, String tenantDomain)
- throws RestAPIException {
++ static void deployCartridge(CartridgeDefinitionBean cartridgeDefinitionBean, ConfigurationContext ctxt, String userName, String tenantDomain)
++ throws RestAPIException {
- log.info("Starting to deploy a Cartridge [type] " + cartridgeDefinitionBean.type);
+ log.info("Starting to deploy a Cartridge [type] " + cartridgeDefinitionBean.type);
- CloudControllerServiceClient cloudControllerServiceClient = getCloudControllerServiceClient();
-
- if (cloudControllerServiceClient != null) {
-
- CartridgeConfig cartridgeConfig = PojoConverter.populateCartridgeConfigPojo(cartridgeDefinitionBean);
-
- if (cartridgeConfig == null) {
- throw new RestAPIException("Populated CartridgeConfig instance is null, cartridge deployment aborted");
- }
-
-
- // call CC
- try {
- cloudControllerServiceClient
- .deployCartridgeDefinition(cartridgeConfig);
- } catch (RemoteException e) {
- log.error(e.getMessage(), e);
- throw new RestAPIException(e.getMessage(), e);
- } catch (CloudControllerServiceInvalidCartridgeDefinitionExceptionException e) {
- String message = e.getFaultMessage().getInvalidCartridgeDefinitionException().getMessage();
- log.error(message, e);
- throw new RestAPIException(message, e);
- } catch (CloudControllerServiceInvalidIaasProviderExceptionException e) {
- String message = e.getFaultMessage().getInvalidIaasProviderException().getMessage();
- log.error(message, e);
- throw new RestAPIException(message, e);
- }
- CartridgeConfig cartridgeConfig = PojoConverter.populateCartridgeConfigPojo(cartridgeDefinitionBean);
- if (cartridgeConfig == null) {
- throw new RestAPIException(
- "Populated CartridgeConfig instance is null, cartridge deployment aborted");
- }
- CartridgeDeploymentManager.getDeploymentManager(cartridgeDefinitionBean.deployerType).deploy(cartridgeConfig);
++ CartridgeConfig cartridgeConfig = PojoConverter.populateCartridgeConfigPojo(cartridgeDefinitionBean);
++ if (cartridgeConfig == null) {
++ throw new RestAPIException(
++ "Populated CartridgeConfig instance is null, cartridge deployment aborted");
++ }
++ CartridgeDeploymentManager.getDeploymentManager(cartridgeDefinitionBean.deployerType).deploy(cartridgeConfig);
- log.info("Successfully deployed Cartridge [type] " + cartridgeDefinitionBean.type);
- log.info("Successfully deployed Cartridge [type] "+ cartridgeDefinitionBean.type);
++ log.info("Successfully deployed Cartridge [type] " + cartridgeDefinitionBean.type);
- }
- }
+ }
@SuppressWarnings("unused")
private static DeploymentPolicy[] intersection(
[05/12] git commit: re-organizing puppet modules
Posted by ra...@apache.org.
re-organizing puppet modules
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/4999fa8d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/4999fa8d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/4999fa8d
Branch: refs/heads/docker-integration
Commit: 4999fa8d98931e927456af3dbc6d10ce259eef85
Parents: c6ff95f
Author: R-Rajkumar <rr...@gmail.com>
Authored: Tue Sep 9 21:59:01 2014 +0530
Committer: R-Rajkumar <rr...@gmail.com>
Committed: Tue Sep 9 21:59:01 2014 +0530
----------------------------------------------------------------------
tools/puppet3/manifests/nodes/default.pp | 1 +
tools/puppet3/manifests/nodes/haproxy.pp | 5 +-
tools/puppet3/manifests/nodes/jboss.pp | 35 +
tools/puppet3/manifests/nodes/lb.pp | 5 +-
tools/puppet3/manifests/nodes/mysql.pp | 7 +-
tools/puppet3/manifests/nodes/nodejs.pp | 7 +-
tools/puppet3/manifests/nodes/php.pp | 8 +-
tools/puppet3/manifests/nodes/ruby.pp | 6 +-
tools/puppet3/manifests/nodes/tomcat.pp | 5 +-
tools/puppet3/manifests/nodes/wordpress.pp | 5 +-
.../lib/puppet/parser/functions/difference.rb | 21 +
tools/puppet3/modules/agent/manifests/init.pp | 50 +-
.../modules/agent/manifests/push_templates.pp | 5 +-
.../modules/agent/manifests/remove_templates.pp | 24 +
.../templates/extensions/addons/_jboss-as.erb | 18 -
.../templates/extensions/addons/_mysql.erb | 32 -
.../templates/extensions/addons/_nodejs.erb | 21 -
.../agent/templates/extensions/addons/_php.erb | 18 -
.../agent/templates/extensions/addons/_ruby.erb | 34 -
.../templates/extensions/artifacts-copy.sh.erb | 3 +-
.../extensions/artifacts-updated.sh.erb | 6 -
.../templates/extensions/complete-tenant.sh.erb | 2 -
.../extensions/complete-topology.sh.erb | 6 -
.../extensions/member-activated.sh.erb | 279 +-------
.../templates/extensions/member-started.sh.erb | 17 +-
.../extensions/member-suspended.sh.erb | 17 +-
.../extensions/member-terminated.sh.erb | 15 -
.../templates/extensions/start-servers.sh.erb | 285 +-------
.../extensions/subscription-domain-added.sh.erb | 6 -
.../subscription-domain-removed.sh.erb | 5 -
tools/puppet3/modules/appserver/LICENSE | 13 +
tools/puppet3/modules/appserver/Modulefile | 11 +
tools/puppet3/modules/appserver/README | 11 +
.../modules/appserver/files/configs/README.txt | 5 +
.../repository/components/lib/README.txt | 1 +
.../modules/appserver/files/patches/README.txt | 3 +
.../repository/components/patches/README.txt | 1 +
.../modules/appserver/lib/facter/java_home.rb | 5 +
.../modules/appserver/manifests/clean.pp | 45 ++
.../modules/appserver/manifests/deploy.pp | 43 ++
.../puppet3/modules/appserver/manifests/init.pp | 137 ++++
.../modules/appserver/manifests/initialize.pp | 59 ++
.../modules/appserver/manifests/params.pp | 74 ++
.../appserver/manifests/push_templates.pp | 26 +
.../modules/appserver/manifests/start.pp | 28 +
.../agent/extensions/artifacts-copy.sh.erb | 29 +
.../agent/extensions/artifacts-updated.sh.erb | 28 +
.../templates/agent/extensions/clean.sh.erb | 28 +
.../agent/extensions/complete-tenant.sh.erb | 30 +
.../agent/extensions/complete-topology.sh.erb | 34 +
.../agent/extensions/instance-activated.sh.erb | 28 +
.../agent/extensions/instance-started.sh.erb | 27 +
.../agent/extensions/member-activated.sh.erb | 303 ++++++++
.../agent/extensions/member-started.sh.erb | 43 ++
.../agent/extensions/member-suspended.sh.erb | 43 ++
.../agent/extensions/member-terminated.sh.erb | 43 ++
.../agent/extensions/mount-volumes.sh.erb | 87 +++
.../agent/extensions/start-servers.sh.erb | 308 ++++++++
.../extensions/subscription-domain-added.sh.erb | 35 +
.../subscription-domain-removed.sh.erb | 34 +
.../templates/conf/axis2/axis2.xml.erb | 713 +++++++++++++++++++
.../appserver/templates/conf/carbon.xml.erb | 626 ++++++++++++++++
.../conf/datasources/master-datasources.xml.erb | 72 ++
.../datasources/master-datasources/_remote.erb | 68 ++
.../templates/conf/log4j.properties.erb | 175 +++++
.../appserver/templates/conf/registry.xml.erb | 105 +++
.../templates/conf/registry/_remote.erb | 35 +
.../conf/security/authenticators.xml.erb | 52 ++
.../conf/tomcat/catalina-server.xml.erb | 98 +++
.../appserver/templates/conf/user-mgt.xml.erb | 356 +++++++++
.../templates/conf/user-mgt/_roldap.erb | 32 +
.../templates/conf/user-mgt/_rwldap.erb | 41 ++
tools/puppet3/modules/haproxy/manifests/init.pp | 6 +
tools/puppet3/modules/jboss/manifests/init.pp | 10 +
.../agent/extensions/artifacts-updated.sh.erb | 30 +
tools/puppet3/modules/lb/manifests/init.pp | 7 +-
.../puppet3/modules/lb/manifests/initialize.pp | 10 +-
tools/puppet3/modules/mysql/manifests/init.pp | 10 +
.../agent/extensions/instance-started.sh.erb | 43 ++
tools/puppet3/modules/nodejs/manifests/init.pp | 11 +
.../agent/extensions/start-servers.sh.erb | 32 +
tools/puppet3/modules/php/manifests/init.pp | 11 +
.../agent/extensions/artifacts-updated.sh.erb | 30 +
tools/puppet3/modules/ruby/manifests/init.pp | 11 +
.../agent/extensions/instance-started.sh.erb | 46 ++
tools/puppet3/modules/tomcat/manifests/init.pp | 6 +
.../puppet3/modules/wordpress/manifests/init.pp | 5 +
87 files changed, 4340 insertions(+), 811 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/manifests/nodes/default.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/manifests/nodes/default.pp b/tools/puppet3/manifests/nodes/default.pp
index 1708013..4f420b2 100755
--- a/tools/puppet3/manifests/nodes/default.pp
+++ b/tools/puppet3/manifests/nodes/default.pp
@@ -17,6 +17,7 @@
# default (base) cartridge node
node /default/ inherits base {
+
require java
class {'agent':}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/manifests/nodes/haproxy.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/manifests/nodes/haproxy.pp b/tools/puppet3/manifests/nodes/haproxy.pp
index abce18b..7229b52 100755
--- a/tools/puppet3/manifests/nodes/haproxy.pp
+++ b/tools/puppet3/manifests/nodes/haproxy.pp
@@ -17,9 +17,6 @@
# haproxy extension loadbalancer cartridge node
node /haproxy/ inherits base {
- require java
- class {'haproxy':}
- class {'agent':}
- Class['stratos_base'] -> Class['java'] -> Class['haproxy'] ~> Class['agent']
+ class {'haproxy':}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/manifests/nodes/jboss.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/manifests/nodes/jboss.pp b/tools/puppet3/manifests/nodes/jboss.pp
new file mode 100644
index 0000000..485d26a
--- /dev/null
+++ b/tools/puppet3/manifests/nodes/jboss.pp
@@ -0,0 +1,35 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Jboss cartridge node
+node /jboss/ inherits base {
+
+ $product = 'jboss-as'
+ $version = '7.1.1.Final'
+ $docroot = "/mnt/${product}-${version}/standalone/deployments/"
+ $jboss_user = 'jbossas1'
+ $jboss_group = 'jboss'
+
+ class {'jboss':
+ user => $jboss_user,
+ group => $jboss_group,
+ java_home => $java_home,
+ version => $version,
+ java_opts => "-Xms512m -Xmx3000m",
+ extra_jars => ['mysql-connector-java-5.1.29-bin.jar']
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/manifests/nodes/lb.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/manifests/nodes/lb.pp b/tools/puppet3/manifests/nodes/lb.pp
index 3faa7d9..d690eff 100755
--- a/tools/puppet3/manifests/nodes/lb.pp
+++ b/tools/puppet3/manifests/nodes/lb.pp
@@ -17,9 +17,6 @@
# loadbalancer cartridge node
node /lb/ inherits base {
- require java
- class {'agent':}
- class {'lb': maintenance_mode => 'norestart'}
- Class['stratos_base'] -> Class['java'] -> Class['lb'] ~> Class['agent']
+ class {'lb': maintenance_mode => 'norestart'}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/manifests/nodes/mysql.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/manifests/nodes/mysql.pp b/tools/puppet3/manifests/nodes/mysql.pp
index 9b62f7e..9c91727 100755
--- a/tools/puppet3/manifests/nodes/mysql.pp
+++ b/tools/puppet3/manifests/nodes/mysql.pp
@@ -17,11 +17,6 @@
# mysql cartridge node
node /mysql/ inherits base {
- require java
- class {'agent':
- type => 'mysql',
- }
- class {'mysql':}
- Class['stratos_base'] -> Class['java'] -> Class['mysql'] ~> Class['agent']
+ class {'mysql':}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/manifests/nodes/nodejs.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/manifests/nodes/nodejs.pp b/tools/puppet3/manifests/nodes/nodejs.pp
index e99cbc8..50c8161 100755
--- a/tools/puppet3/manifests/nodes/nodejs.pp
+++ b/tools/puppet3/manifests/nodes/nodejs.pp
@@ -17,11 +17,6 @@
# nodejs cartridge node
node /nodejs/ inherits base {
- require java
- class {'agent':
- type => 'nodejs',
- }
- class {'nodejs':}
- Class['stratos_base'] -> Class['java'] -> Class['nodejs'] ~> Class['agent']
+ class {'nodejs':}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/manifests/nodes/php.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/manifests/nodes/php.pp b/tools/puppet3/manifests/nodes/php.pp
index f16b9fd..0d239e2 100755
--- a/tools/puppet3/manifests/nodes/php.pp
+++ b/tools/puppet3/manifests/nodes/php.pp
@@ -17,16 +17,10 @@
# php cartridge node
node /php/ inherits base {
+
$docroot = "/var/www/www"
$syslog="/var/log/apache2/error.log"
$samlalias="/var/www/"
- require java
- class {'agent':
- type => 'php',
- }
class {'php':}
-
- #install stratos_base before java before php before agent
- Class['stratos_base'] -> Class['java'] -> Class['php'] ~> Class['agent']
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/manifests/nodes/ruby.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/manifests/nodes/ruby.pp b/tools/puppet3/manifests/nodes/ruby.pp
index b4ade98..67dc7bd 100755
--- a/tools/puppet3/manifests/nodes/ruby.pp
+++ b/tools/puppet3/manifests/nodes/ruby.pp
@@ -17,10 +17,6 @@
# ruby cartridge node
node /ruby/ inherits base {
- require java
- class {'agent':
- }
- class {'ruby':}
- Class['stratos_base'] -> Class['java'] -> Class['ruby'] ~> Class['agent']
+ class {'ruby':}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/manifests/nodes/tomcat.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/manifests/nodes/tomcat.pp b/tools/puppet3/manifests/nodes/tomcat.pp
index 8826d27..7e39204 100755
--- a/tools/puppet3/manifests/nodes/tomcat.pp
+++ b/tools/puppet3/manifests/nodes/tomcat.pp
@@ -17,12 +17,9 @@
# tomcat cartridge node
node /tomcat/ inherits base {
+
$docroot = "/mnt/apache-tomcat-${tomcat_version}/webapps/"
$samlalias="/mnt/apache-tomcat-${tomcat_version}/webapps/"
- require java
- class {'agent':}
class {'tomcat':}
-
- Class['stratos_base'] -> Class['java'] -> Class['tomcat'] ~> Class['agent']
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/manifests/nodes/wordpress.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/manifests/nodes/wordpress.pp b/tools/puppet3/manifests/nodes/wordpress.pp
index 7233842..6f28886 100755
--- a/tools/puppet3/manifests/nodes/wordpress.pp
+++ b/tools/puppet3/manifests/nodes/wordpress.pp
@@ -17,10 +17,7 @@
#wordpress cartridge node
node /wordpress/ inherits base {
- require java
- class {'agent':}
+
class {'wordpress':}
class {'mysql':}
-
- Class['stratos_base'] -> Class['java'] -> Class['mysql'] -> Class['wordpress'] ~> Class['agent']
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/lib/puppet/parser/functions/difference.rb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/lib/puppet/parser/functions/difference.rb b/tools/puppet3/modules/agent/lib/puppet/parser/functions/difference.rb
new file mode 100755
index 0000000..9be6e08
--- /dev/null
+++ b/tools/puppet3/modules/agent/lib/puppet/parser/functions/difference.rb
@@ -0,0 +1,21 @@
+# difference.rb
+module Puppet::Parser::Functions
+ newfunction(:difference, :type => :rvalue
+) do |arguments|
+
+ # Two arguments are required
+ raise(Puppet::ParseError, "difference(): Wrong number of arguments " +
+ "given (#{arguments.size} for 2)") if arguments.size != 2
+
+ first = arguments[0]
+ second = arguments[1]
+
+ unless first.is_a?(Array) && second.is_a?(Array)
+ raise(Puppet::ParseError, 'difference(): Requires 2 arrays')
+ end
+
+ result = first - second
+
+ return result
+ end
+end
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/manifests/init.pp b/tools/puppet3/modules/agent/manifests/init.pp
index 2ab599c..05d2b4c 100644
--- a/tools/puppet3/modules/agent/manifests/init.pp
+++ b/tools/puppet3/modules/agent/manifests/init.pp
@@ -24,6 +24,9 @@ class agent(
$enable_artifact_update = true,
$auto_commit = false,
$auto_checkout = true,
+ $module = 'undef',
+ $custom_templates = [],
+ $exclude_templates = []
){
$deployment_code = 'cartridge-agent'
@@ -33,9 +36,9 @@ class agent(
tag($service_code)
- $service_templates = [
+ $default_templates = [
'bin/stratos.sh',
- 'conf/templates/jndi.properties.template',
+ 'conf/jndi.properties',
'conf/log4j.properties',
'extensions/clean.sh',
'extensions/instance-activated.sh',
@@ -68,18 +71,53 @@ class agent(
require => Agent::Initialize[$deployment_code];
}
+ # excluding templates which are not needed by a cartridge module from default_templates
+ $default_templates_excluded = difference($default_templates,$exclude_templates)
+
+ # excluding custom_templates, if any,(which will be overrided by a cartridge module) from default_templates
+ $service_templates = $module ? {
+ 'undef' => $default_templates_excluded,
+ default => difference($default_templates_excluded,$custom_templates)
+ }
+
+ # applying default extensions
agent::push_templates {
$service_templates:
target => $carbon_home,
+ template_dir => "agent",
require => Agent::Initialize[$deployment_code];
}
+ # applying custom extensions
+ unless $module == 'undef' {
+ agent::push_templates {
+ $custom_templates:
+ target => $carbon_home,
+ template_dir => "${module}/agent",
+ require => [Agent::Initialize[$deployment_code]]
+ }
+ }
+
+ # removing default extensions which are shipped by agent.zip
+ agent::remove_templates {
+ $exclude_templates:
+ target => $carbon_home,
+ }
+
+ $required_resources = $module ? {
+ 'undef' => [
+ Exec['copy launch-params to carbon_home'],
+ Agent::Push_templates[$default_templates_excluded],
+ ],
+ default =>[
+ Exec['copy launch-params to carbon_home'],
+ Agent::Push_templates[$default_templates_excluded],
+ Agent::Push_templates[$custom_templates] ]
+ }
+
agent::start { $deployment_code:
owner => $owner,
target => $carbon_home,
- require => [
- Exec['copy launch-params to carbon_home'],
- Agent::Push_templates[$service_templates],
- ];
+ require => $required_resources
}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/manifests/push_templates.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/manifests/push_templates.pp b/tools/puppet3/modules/agent/manifests/push_templates.pp
index e6d7a53..035eb21 100755
--- a/tools/puppet3/modules/agent/manifests/push_templates.pp
+++ b/tools/puppet3/modules/agent/manifests/push_templates.pp
@@ -17,12 +17,13 @@
# Apply the templates
-define agent::push_templates ($target) {
+define agent::push_templates ($target,$template_dir) {
file { "${target}/${name}":
ensure => present,
owner => $agent::owner,
group => $agent::group,
mode => '0755',
- content => template("agent/${name}.erb"),
+ content => template("${template_dir}/${name}.erb"),
}
}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/manifests/remove_templates.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/manifests/remove_templates.pp b/tools/puppet3/modules/agent/manifests/remove_templates.pp
new file mode 100644
index 0000000..5284e44
--- /dev/null
+++ b/tools/puppet3/modules/agent/manifests/remove_templates.pp
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Removing default extensions shipped with agent
+
+define agent::remove_templates ($target) {
+ file { "${target}/${name}":
+ ensure => absent
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/addons/_jboss-as.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/addons/_jboss-as.erb b/tools/puppet3/modules/agent/templates/extensions/addons/_jboss-as.erb
deleted file mode 100755
index b6e23be..0000000
--- a/tools/puppet3/modules/agent/templates/extensions/addons/_jboss-as.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-chown -R <%= @jboss_user %>:<%= @jboss_group %> <%= @docroot %>
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/addons/_mysql.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/addons/_mysql.erb b/tools/puppet3/modules/agent/templates/extensions/addons/_mysql.erb
deleted file mode 100644
index 88f8891..0000000
--- a/tools/puppet3/modules/agent/templates/extensions/addons/_mysql.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-export PATH='/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'
-
-PASSWD=`facter -p stratos_mysql_password`
-
-/etc/init.d/mysql start
-
-# Set mysql password
-mysqladmin -uroot password "$PASSWD"
-
-# Remove other users
-mysql -uroot -p"$PASSWD" -Bse "DELETE from mysql.user WHERE password=''"
-
-# Set root user with remote access
-mysql -uroot -p"$PASSWD" -Bse "CREATE USER 'root'@'%' IDENTIFIED BY '${PASSWD}'"
-
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/addons/_nodejs.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/addons/_nodejs.erb b/tools/puppet3/modules/agent/templates/extensions/addons/_nodejs.erb
deleted file mode 100755
index 463eb53..0000000
--- a/tools/puppet3/modules/agent/templates/extensions/addons/_nodejs.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
-NODEJS_HOME=<%= @stratos_app_path %>
-npm install express
-node web.js > /dev/null 2&1 &
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/addons/_php.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/addons/_php.erb b/tools/puppet3/modules/agent/templates/extensions/addons/_php.erb
deleted file mode 100755
index adb8059..0000000
--- a/tools/puppet3/modules/agent/templates/extensions/addons/_php.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-chown -R www-data:www-data /var/www
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/addons/_ruby.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/addons/_ruby.erb b/tools/puppet3/modules/agent/templates/extensions/addons/_ruby.erb
deleted file mode 100644
index 9117dde..0000000
--- a/tools/puppet3/modules/agent/templates/extensions/addons/_ruby.erb
+++ /dev/null
@@ -1,34 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-export PATH="/usr/local/rvm/gems/ruby-2.1.0/bin:/usr/local/rvm/gems/ruby-2.1.0@global/bin:/usr/local/rvm/rubies/ruby-2.1.0/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/rvm/bin:/root/bin"
-
-export HOME="/root/"
-source ~/.bashrc
-source /etc/profile.d/rvm.sh
-rvm use 2.1.0
-
-RUBY_HOME=<%= @stratos_app_path %>
-GIT_REPO=<%= @stratos_git_repo %>
-
-mkdir -p $RUBY_HOME
-
-git clone $GIT_REPO $RUBY_HOME
-cd $RUBY_HOME
-bundle install
-#rails server > /dev/null 2>&1 &
-rails server > /tmp/ruby.log 2>&1 &
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/artifacts-copy.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/artifacts-copy.sh.erb b/tools/puppet3/modules/agent/templates/extensions/artifacts-copy.sh.erb
index 5cad830..f25182f 100644
--- a/tools/puppet3/modules/agent/templates/extensions/artifacts-copy.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/artifacts-copy.sh.erb
@@ -25,5 +25,4 @@
#
log=/var/log/apache-stratos/cartridge-agent-extensions.log
-cp -rf $1* $2
-echo "Artifacts Copied" | tee -a $log
+echo `date`": Artifacts Copied: " | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/artifacts-updated.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/artifacts-updated.sh.erb b/tools/puppet3/modules/agent/templates/extensions/artifacts-updated.sh.erb
index 1735603..15d5591 100755
--- a/tools/puppet3/modules/agent/templates/extensions/artifacts-updated.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/artifacts-updated.sh.erb
@@ -26,9 +26,3 @@
log=/var/log/apache-stratos/cartridge-agent-extensions.log
echo `date`": Artifacts Updated Event" | tee -a $log
-
-<%- if @type == 'php' -%>
-<%= scope.function_template(['agent/extensions/addons/_php.erb']) -%>
-<%- elsif @type == 'jboss-as' -%>
-<%= scope.function_template(['agent/extensions/addons/_jboss-as.erb']) -%>
-<%- end -%>
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/complete-tenant.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/complete-tenant.sh.erb b/tools/puppet3/modules/agent/templates/extensions/complete-tenant.sh.erb
index 2586474..50e4506 100644
--- a/tools/puppet3/modules/agent/templates/extensions/complete-tenant.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/complete-tenant.sh.erb
@@ -26,5 +26,3 @@
log=/var/log/apache-stratos/cartridge-agent-extensions.log
echo `date`": Complete Tenant Event: " | tee -a $log
-echo "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
-echo "Tenant List: ${STRATOS_TENANT_LIST_JSON}" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/complete-topology.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/complete-topology.sh.erb b/tools/puppet3/modules/agent/templates/extensions/complete-topology.sh.erb
index ea2e941..a3311ad 100644
--- a/tools/puppet3/modules/agent/templates/extensions/complete-topology.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/complete-topology.sh.erb
@@ -26,9 +26,3 @@
log=/var/log/apache-stratos/cartridge-agent-extensions.log
echo `date`": Complete Topology Event: " | tee -a $log
-echo "LB IP: ${STRATOS_LB_IP}" | tee -a $log
-echo "LB PUBLIC IP: $STRATOS_LB_PUBLIC_IP}" | tee -a $log
-echo "STRATOS_PARAM_FILE_PATH: ${STRATOS_PARAM_FILE_PATH}"
-echo "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
-echo "Complete Topology: ${STRATOS_TOPOLOGY_JSON}" | tee -a $log
-echo "Members in LB: ${STRATOS_MEMBERS_IN_LB_JSON}" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/member-activated.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/member-activated.sh.erb b/tools/puppet3/modules/agent/templates/extensions/member-activated.sh.erb
index f01d028..f6e8201 100644
--- a/tools/puppet3/modules/agent/templates/extensions/member-activated.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/member-activated.sh.erb
@@ -24,280 +24,5 @@
# --------------------------------------------------------------
#
-# Execute error_handler function on script error
-trap 'error_handler ${LINENO} $?' ERR
-
-log=/var/log/apache-stratos/cartridge-agent-extensions-member.activated.log
-VERBOSE=1
-DATE=`which date` || print_error "date command not found"
-ECHO=`which echo` || print_error "echo command not found"
-GREP=`which grep` || print_error "grep command not found"
-PS=`which ps` || print_error "ps command not found"
-SED=`which sed` || print_error "sed command not found"
-
-function printParameters(){
- ${ECHO} -e "LB IP: ${STRATOS_LB_IP}" | tee -a $log
- ${ECHO} -e "LB PUBLIC IP: ${STRATOS_LB_PUBLIC_IP}" | tee -a $log
- ${ECHO} -e "STRATOS_PARAM_FILE_PATH: ${STRATOS_PARAM_FILE_PATH}"
- ${ECHO} -e "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
- ${ECHO} -e "Complete Topology: ${STRATOS_TOPOLOGY_JSON}" | tee -a $log
- ${ECHO} -e "Members in LB: ${STRATOS_MEMBERS_IN_LB_JSON}" | tee -a $log
- ${ECHO} -e "APP_PATH: ${STRATOS_APP_PATH}" | tee -a $log
-}
-
-function error_handler(){
- MYSELF="$0" # equals to script name
- LASTLINE="$1" # argument 1: last line of error occurence
- LASTERR="$2" # argument 2: error code of last command
- echo "ERROR in ${MYSELF}: line ${LASTLINE}: exit status of last command: ${LASTERR}"
- exit 1
-}
-
-function print_message(){
- if [ ${VERBOSE} -eq 1 ]; then
- ${ECHO} -e "[INFO] " $1 | tee -a $log
- fi
-}
-
-function print_error(){
- ${ECHO} -e "[Error] " $1 | tee -a $log
- exit 1
-}
-
-function verify_file_exists(){
- if [[ ! -f $1 ]] ; then
- print_error "File not found: $1"
- fi
-}
-
-function update_hosts_file(){
- instance_hostname="<%= @stratos_instance_data_host_name %>"
- (${GREP} -q "${instance_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${instance_hostname} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${instance_hostname}")) \
- || print_error "Failed to update '/etc/hosts' file. "
-
- map_to_lb="<%= @stratos_instance_data_map_to_lb %>"
- arr=$(${ECHO} ${map_to_lb} | tr "," "\n")
-
- for map_hostname in $arr
- do
- (${GREP} -q "${map_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${map_hostname} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${map_hostname}")) \
- || print_error "Failed to update '/etc/hosts' file. "
- done
-
- <%- if @stratos_instance_data_worker_host_name -%>
- worker_hostname="<%= @stratos_instance_data_worker_host_name %>"
- (${GREP} -q " ${worker_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${worker_hostname} # Stratos LB worker private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${worker_hostname}")) \
- || print_error "Failed to update '/etc/hosts' file. "
- <%- end -%>
-
- if [[ "${STRATOS_SERVICE_NAME}" = "apistore" || "${STRATOS_SERVICE_NAME}" = "publisher" ]] ; then
- gateway_host_name="<%= @stratos_instance_data_gateway_host_name %>"
- gateway_mgt_host_name="<%= @stratos_instance_data_gateway_mgt_host_name %>"
- keymanager_host_name="<%= @stratos_instance_data_keymanager_host_name %>"
-
- (${GREP} -q "${gateway_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${gateway_host_name} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${gateway_host_name}")) \
- || print_error "Failed to update '/etc/hosts' file. "
-
- (${GREP} -q "${gateway_mgt_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${gateway_mgt_host_name} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${gateway_mgt_host_name}")) \
- || print_error "Failed to update '/etc/hosts' file. "
-
-
- (${GREP} -q "${keymanager_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${keymanager_host_name} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${keymanager_host_name}")) \
- || print_error "Failed to update '/etc/hosts' file. "
-
- elif [[ "${STRATOS_SERVICE_NAME}" = "gateway" || "${STRATOS_SERVICE_NAME}" = "gatewaymgt" ]] ; then
- keymanager_hostname="<%= @stratos_instance_data_keymanager_host_name %>"
-
- (${GREP} -q "${keymanager_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${keymanager_hostname} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${keymanager_hostname}")) \
- || print_error "Failed to update '/etc/hosts' file. "
-
- fi
-}
-
-function backup_file(){
- if [[ -f "$1.orig" ]];
- then
- print_message "Restoring from the Original template file $1"
- cp -f "$1.orig" "$1"
- else
- print_message "Creating a backup of the file $1"
- cp -f "$1" "$1.orig"
- fi
-}
-
-function configure_manager_worker_wka_members(){
-
- print_message "function configure_manager_worker_wka_members ..... "
-
- # generic worker manager seperation :D
- if [[ -z ${STRATOS_WK_MANAGER_MEMBER_COUNT} || ${STRATOS_WK_MANAGER_MEMBER_COUNT} -eq 0 ]] ; then
- print_message "manager WKA member count is zero or unavailable"
- else
- print_message "Configuring manager..."
- print_message "configure_manager_worker_wka_members STRATOS_WK_MANAGER_MEMBER_COUNT ${STRATOS_WK_MANAGER_MEMBER_COUNT} ..... "
- for i in `seq 0 $(( ${STRATOS_WK_MANAGER_MEMBER_COUNT} - 1 ))`
- do
- member_ip_name="STRATOS_WK_MANAGER_MEMBER_${i}_IP"
- member_ip=${member_ip_name}
- if [[ -z ${member_ip} ]] ; then
- print_error "WKA is null for STRATOS_WK_MANAGER_MEMBER_${i}_IP"
- fi
- print_message "$i => ${member_ip}"
- WKA_XML=$"${WKA_XML}<member><hostName>${!member_ip}</hostName><port>4000</port></member>\n"
- done
- fi
-
- if [[ -z ${STRATOS_WK_WORKER_MEMBER_COUNT} || ${STRATOS_WK_WORKER_MEMBER_COUNT} -eq 0 ]] ; then
- print_message "worker WKA member count is zero or unavailable"
- else
- print_message "Configuring worker..."
- print_message "STRATOS_WK_WORKER_MEMBER_COUNT ${STRATOS_WK_WORKER_MEMBER_COUNT} ..... "
- for i in `seq 0 $(( ${STRATOS_WK_WORKER_MEMBER_COUNT} - 1 ))`
- do
- member_ip_name="STRATOS_WK_WORKER_MEMBER_${i}_IP"
- member_ip=${member_ip_name}
- if [[ -z ${member_ip} ]] ; then
- print_error "WKA is null for STRATOS_WK_WORKER_MEMBER_${i}_IP"
- fi
- print_message "$i => ${member_ip}"
- WKA_XML=$"${WKA_XML}<member><hostName>${!member_ip}</hostName><port>4000</port></member>\n"
- done
- fi
-
- print_message "${STRATOS_SERVICE_NAME} WKA_XML => ${WKA_XML}"
- verify_file_exists ${AXIS2_XML_FILE}
- ${SED} -i "s%${WKA_LINE}%${WKA_XML}%g" ${AXIS2_XML_FILE} && print_message "gateway WKA configuration successful" || print_error "Failed to configure well known members"
-
-}
-
-
-function configure_wk_members(){
-
- print_message "Performing clustering configuration for ${STRATOS_SERVICE_NAME}..."
-
- WKA_XML=""
- KEYMGR_XML=""
- WKA_LINE="@WELL_KNOWN_MEMBERS"
- KEYMGR_LINE="@KEYMANAGER_SERVER_URL"
-
- AXIS2_XML_FILE=${STRATOS_APP_PATH}/repository/conf/axis2/axis2.xml
- backup_file ${AXIS2_XML_FILE}
-
-
- if [[ (! -z $STRATOS_SERVICE_GROUP) && "${STRATOS_SERVICE_GROUP}" = "apim" ]] ; then
- print_message " STRATOS_SERVICE_GROUP_APIM ${STRATOS_SERVICE_GROUP} ..... "
- API_MANAGER_XML_FILE=${STRATOS_APP_PATH}/repository/conf/api-manager.xml
- backup_file ${API_MANAGER_XML_FILE}
-
- if [[ "${STRATOS_SERVICE_NAME}" = "apistore" || "${STRATOS_SERVICE_NAME}" = "publisher" ]] ; then
-
- print_message "Configuring axis2.xml for ${STRATOS_SERVICE_NAME}..."
- WKA_XML=$"${WKA_XML}<member><hostName>${STRATOS_WK_APISTORE_MEMBER_IP}</hostName><port>4000</port></member>\n"
- WKA_XML=$"${WKA_XML}<member><hostName>${STRATOS_WK_PUBLISHER_MEMBER_IP}</hostName><port>4000</port></member>\n"
- print_message "${STRATOS_SERVICE_NAME} WKA_XML => ${WKA_XML}"
- verify_file_exists ${AXIS2_XML_FILE}
- ${SED} -i "s%${WKA_LINE}%${WKA_XML}%g" ${AXIS2_XML_FILE} && print_message "${STRATOS_SERVICE_NAME} WKA configuration successful" || print_error "Failed to configure well known members"
-
- elif [[ "${STRATOS_SERVICE_NAME}" = "keymanager" ]] ; then
-
- print_message "In keymanager...nothing to do"
-
- elif [[ "${STRATOS_SERVICE_NAME}" = "gateway" || "${STRATOS_SERVICE_NAME}" = "gatewaymgt" ]] ; then
-
- if [[ "${DEPLOYMENT}" = "manager" || "${DEPLOYMENT}" = "worker" ]] ; then
-
- configure_manager_worker_wka_members
- fi
-
- fi
- elif [[ "${DEPLOYMENT}" = "manager" || "${DEPLOYMENT}" = "worker" ]] ; then
- print_message " Worker / Manager ..... ${DEPLOYMENT} "
- configure_manager_worker_wka_members
- else
- print_message "Configuring ${STRATOS_SERVICE_NAME}..."
- print_message "STRATOS_WK_MEMBER_COUNT ....... ${STRATOS_WK_MEMBER_COUNT} "
- for i in `seq 0 $(( ${STRATOS_WK_MEMBER_COUNT} - 1 ))`
- do
- member_ip="STRATOS_WK_MEMBER_${i}_IP"
- print_message " memberip ${member_ip} ....... "
- if [[ -z ${!member_ip} ]] ; then
- print_error "WKA is null for STRATOS_WK_MEMBER_${i}_IP"
- fi
- print_message "$i => ${!member_ip}"
- WKA_XML=$"${WKA_XML}<member><hostName>${!member_ip}</hostName><port>4000</port></member>\n"
- done
-
- print_message "${STRATOS_SERVICE_NAME} WKA_XML => ${WKA_XML}"
- verify_file_exists ${AXIS2_XML_FILE}
- ${SED} -i "s%${WKA_LINE}%${WKA_XML}%g" ${AXIS2_XML_FILE} && print_message "${STRATOS_SERVICE_NAME} WKA configuration successful" || print_error "Failed to configure well known members"
- fi
-}
-
-function updateWKMembers() {
- print_message "Update WKA Members...... "
- # Check if APP_PATH exists
- print_message "Stratos App path $STRATOS_APP_PATH ...... "
- if [[ ! -d $STRATOS_APP_PATH ]] ; then
- print_error "APP_PATH is not found at: ${STRATOS_APP_PATH}"
- fi
-
- # Set JAVA_HOME if it is not already set
- if [[ -z $JAVA_HOME ]] ; then
- print_message "Setting JAVA_HOME to /opt/java"
- export JAVA_HOME=/opt/java
- fi
-
- print_message "Stopping wso2server.sh ...... "
- # Kill Product server
- $STRATOS_APP_PATH/bin/wso2server.sh stop > /dev/null 2>&1 &
- sleep 10
-
- # Check if clustering is enabled for this product
- if [[ -z $STRATOS_CLUSTERING ]] ; then
- ${ECHO} -e `date`": starting servers in stand-alone mode..." | tee -a $log
- if [[ ${VERBOSE} -eq 1 ]]; then
- printParameters
- fi
-
- else
- ${ECHO} -e `date`": starting servers in clustering mode..." | tee -a $log
- if [[ ${VERBOSE} -eq 1 ]] ; then
- printParameters
- fi
- # Do the WKA configuration to support clustering
- configure_wk_members
- fi
-
- #Backup hosts file
- backup_file /etc/hosts
- # Update the /etc/hosts file with LB instance IP
- update_hosts_file
-
- # Run start server command
- verify_file_exists $STRATOS_APP_PATH/bin/wso2server.sh
- $STRATOS_APP_PATH/bin/wso2server.sh $* > /dev/null 2>&1 &
- print_message "Executed run command: $STRATOS_APP_PATH/bin/wso2server.sh $*"
- print_message "WK Members successfully updated."
-}
-
-# -----------------------
-# Execution starts here
-# -----------------------
-
- print_message " Executing member activated extension "
- print_message " Stratos UpdateWK_IP [$STRATOS_UPDATE_WK_IP] "
-# Check if WK Update flag is set
-if [[ $STRATOS_UPDATE_WK_IP = "true" ]]; then
- print_message " Conditions successful for [$STRATOS_UPDATE_WK_IP] . Executing updateWKMembers "
- updateWKMembers
-fi
-
-${ECHO} -e `date`": member activated extension successfully completed."
-# END
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+OUTPUT=`date`": Member Activated Event: "
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/member-started.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/member-started.sh.erb b/tools/puppet3/modules/agent/templates/extensions/member-started.sh.erb
index 29f45c3..0b558b6 100644
--- a/tools/puppet3/modules/agent/templates/extensions/member-started.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/member-started.sh.erb
@@ -25,19 +25,4 @@
#
log=/var/log/apache-stratos/cartridge-agent-extensions.log
-OUTPUT=`date`": Member Started Event: "
-OUTPUT="$OUTPUT MEMBER_ID: ${STRATOS_MEMBER_ID}, "
-OUTPUT="$OUTPUT MEMBER_IP: ${STRATOS_MEMBER_IP}, "
-OUTPUT="$OUTPUT CLUSTER_ID: ${STRATOS_CLUSTER_ID}, "
-OUTPUT="$OUTPUT LB_CLUSTER_ID: ${STRATOS_LB_CLUSTER_ID}, "
-OUTPUT="$OUTPUT NETWORK_PARTITION_ID: ${STRATOS_NETWORK_PARTITION_ID}, "
-OUTPUT="$OUTPUT SERVICE_NAME: ${STRATOS_SERVICE_NAME}, "
-OUTPUT="$OUTPUT PORTS: ${STRATOS_PORTS},"
-OUTPUT="$OUTPUT STRATOS_LB_IP: ${STRATOS_LB_IP},"
-OUTPUT="$OUTPUT STRATOS_LB_PUBLIC_IP: ${STRATOS_LB_PUBLIC_IP},"
-OUTPUT="$OUTPUT APP_PATH: ${APP_PATH},"
-OUTPUT="$OUTPUT STRATOS_PARAM_FILE_PATH: ${STRATOS_PARAM_FILE_PATH}"
-echo $OUTPUT | tee -a $log
-echo "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
-echo "Topology: ${STRATOS_TOPOLOGY_JSON}" | tee -a $log
-echo "---------------" | tee -a $log
+echo `date`": Member Started Event: " | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/member-suspended.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/member-suspended.sh.erb b/tools/puppet3/modules/agent/templates/extensions/member-suspended.sh.erb
index 866aa0d..acf44b9 100644
--- a/tools/puppet3/modules/agent/templates/extensions/member-suspended.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/member-suspended.sh.erb
@@ -25,19 +25,4 @@
#
log=/var/log/apache-stratos/cartridge-agent-extensions.log
-OUTPUT=`date`": Member Suspended Event: "
-OUTPUT="$OUTPUT MEMBER_ID: ${STRATOS_MEMBER_ID}, "
-OUTPUT="$OUTPUT MEMBER_IP: ${STRATOS_MEMBER_IP}, "
-OUTPUT="$OUTPUT CLUSTER_ID: ${STRATOS_CLUSTER_ID}, "
-OUTPUT="$OUTPUT LB_CLUSTER_ID: ${STRATOS_LB_CLUSTER_ID}, "
-OUTPUT="$OUTPUT NETWORK_PARTITION_ID: ${STRATOS_NETWORK_PARTITION_ID}, "
-OUTPUT="$OUTPUT SERVICE_NAME: ${STRATOS_SERVICE_NAME}, "
-OUTPUT="$OUTPUT PORTS: ${STRATOS_PORTS},"
-OUTPUT="$OUTPUT STRATOS_LB_IP: ${STRATOS_LB_IP},"
-OUTPUT="$OUTPUT STRATOS_LB_PUBLIC_IP: ${STRATOS_LB_PUBLIC_IP},"
-OUTPUT="$OUTPUT APP_PATH: ${APP_PATH},"
-OUTPUT="$OUTPUT STRATOS_PARAM_FILE_PATH: ${STRATOS_PARAM_FILE_PATH}"
-echo $OUTPUT | tee -a $log
-echo "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
-echo "Topology: ${STRATOS_TOPOLOGY_JSON}" | tee -a $log
-echo "---------------" | tee -a $log
+echo `date`": Member Suspended Event:" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/member-terminated.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/member-terminated.sh.erb b/tools/puppet3/modules/agent/templates/extensions/member-terminated.sh.erb
index 89cedf6..0e69629 100644
--- a/tools/puppet3/modules/agent/templates/extensions/member-terminated.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/member-terminated.sh.erb
@@ -26,18 +26,3 @@
log=/var/log/apache-stratos/cartridge-agent-extensions.log
OUTPUT=`date`": Member Terminated Event: "
-OUTPUT="$OUTPUT MEMBER_ID: ${STRATOS_MEMBER_ID}, "
-OUTPUT="$OUTPUT MEMBER_IP: ${STRATOS_MEMBER_IP}, "
-OUTPUT="$OUTPUT CLUSTER_ID: ${STRATOS_CLUSTER_ID}, "
-OUTPUT="$OUTPUT LB_CLUSTER_ID: ${STRATOS_LB_CLUSTER_ID}, "
-OUTPUT="$OUTPUT NETWORK_PARTITION_ID: ${STRATOS_NETWORK_PARTITION_ID}, "
-OUTPUT="$OUTPUT SERVICE_NAME: ${STRATOS_SERVICE_NAME}, "
-OUTPUT="$OUTPUT PORTS: ${STRATOS_PORTS},"
-OUTPUT="$OUTPUT STRATOS_LB_IP: ${STRATOS_LB_IP},"
-OUTPUT="$OUTPUT STRATOS_LB_PUBLIC_IP: ${STRATOS_LB_PUBLIC_IP},"
-OUTPUT="$OUTPUT APP_PATH: ${APP_PATH},"
-OUTPUT="$OUTPUT STRATOS_PARAM_FILE_PATH: ${STRATOS_PARAM_FILE_PATH}"
-echo $OUTPUT | tee -a $log
-echo "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
-echo "Topology: ${STRATOS_TOPOLOGY_JSON}" | tee -a $log
-echo "---------------" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/start-servers.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/start-servers.sh.erb b/tools/puppet3/modules/agent/templates/extensions/start-servers.sh.erb
index 6e34902..bac3a57 100755
--- a/tools/puppet3/modules/agent/templates/extensions/start-servers.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/start-servers.sh.erb
@@ -23,286 +23,5 @@
# --------------------------------------------------------------
#
-# Execute error_handler function on script error
-trap 'error_handler ${LINENO} $?' ERR
-
-log=/var/log/apache-stratos/cartridge-agent-extensions-start.servers.log
-VERBOSE=1
-DATE=`which date` || print_error "date command not found"
-ECHO=`which echo` || print_error "echo command not found"
-GREP=`which grep` || print_error "grep command not found"
-PS=`which ps` || print_error "ps command not found"
-SED=`which sed` || print_error "sed command not found"
-
-function printParameters(){
- ${ECHO} -e "LB IP: ${STRATOS_LB_IP}" | tee -a $log
- ${ECHO} -e "LB PUBLIC IP: ${STRATOS_LB_PUBLIC_IP}" | tee -a $log
- ${ECHO} -e "STRATOS_PARAM_FILE_PATH: ${STRATOS_PARAM_FILE_PATH}"
- ${ECHO} -e "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
- ${ECHO} -e "Complete Topology: ${STRATOS_TOPOLOGY_JSON}" | tee -a $log
- ${ECHO} -e "Members in LB: ${STRATOS_MEMBERS_IN_LB_JSON}" | tee -a $log
- ${ECHO} -e "APP_PATH: ${STRATOS_APP_PATH}" | tee -a $log
-}
-
-function error_handler(){
- MYSELF="$0" # equals to script name
- LASTLINE="$1" # argument 1: last line of error occurence
- LASTERR="$2" # argument 2: error code of last command
- echo "ERROR in ${MYSELF}: line ${LASTLINE}: exit status of last command: ${LASTERR}"
- exit 1
-}
-
-function print_message(){
- if [ ${VERBOSE} -eq 1 ]; then
- ${ECHO} -e "[INFO] " $1 | tee -a $log
- fi
-}
-
-function print_error(){
- ${ECHO} -e "[Error] " $1 | tee -a $log
- exit 1
-}
-
-function verify_file_exists(){
- if [[ ! -f $1 ]] ; then
- print_error "File not found: $1"
- fi
-}
-
-function update_hosts_file(){
- instance_hostname="<%= @stratos_instance_data_host_name %>"
- (${GREP} -q "${instance_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${instance_hostname} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${instance_hostname}")) \
- || print_error "Failed to update '/etc/hosts' file. "
-
- map_to_lb="<%= @stratos_instance_data_map_to_lb %>"
- arr=$(${ECHO} ${map_to_lb} | tr "," "\n")
-
- for map_hostname in $arr
- do
- (${GREP} -q "${map_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${map_hostname} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${map_hostname}")) \
- || print_error "Failed to update '/etc/hosts' file. "
- done
-
- map_to_ip="<%= @stratos_instance_data_map_to_ip %>"
- arr=$(${ECHO} ${map_to_ip} | tr "," "\n")
-
- for mapping in $arr
- do
-
- arrr=$(${ECHO} ${mapping} | tr "#" "\n")
- map_hostname=${arrr[1]}
- ip_to_map=${arrr[0]}
-
- (${GREP} -q "${map_hostname}" /etc/hosts || (${ECHO} "${ip_to_map} ${map_hostname} # Additional Mappings" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${ip_to_map} ${map_hostname}")) \
- || print_error "Failed to update '/etc/hosts' file. "
- done
-
-
- <%- if @stratos_instance_data_worker_host_name -%>
- worker_hostname="<%= @stratos_instance_data_worker_host_name %>"
- (${GREP} -q " ${worker_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${worker_hostname} # Stratos LB worker private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${worker_hostname}")) \
- || print_error "Failed to update '/etc/hosts' file. "
- <%- end -%>
-
- if [[ "${STRATOS_SERVICE_NAME}" = "apistore" || "${STRATOS_SERVICE_NAME}" = "publisher" ]] ; then
- gateway_host_name="<%= @stratos_instance_data_gateway_host_name %>"
- gateway_mgt_host_name="<%= @stratos_instance_data_gateway_mgt_host_name %>"
- keymanager_host_name="<%= @stratos_instance_data_keymanager_host_name %>"
-
- (${GREP} -q "${gateway_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${gateway_host_name} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${gateway_host_name}")) \
- || print_error "Failed to update '/etc/hosts' file. "
-
- (${GREP} -q "${gateway_mgt_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${gateway_mgt_host_name} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${gateway_mgt_host_name}")) \
- || print_error "Failed to update '/etc/hosts' file. "
-
-
- (${GREP} -q "${keymanager_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${keymanager_host_name} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${keymanager_host_name}")) \
- || print_error "Failed to update '/etc/hosts' file. "
-
- elif [[ "${STRATOS_SERVICE_NAME}" = "gateway" || "${STRATOS_SERVICE_NAME}" = "gatewaymgt" ]] ; then
- keymanager_hostname="<%= @stratos_instance_data_keymanager_host_name %>"
-
- (${GREP} -q "${keymanager_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${keymanager_hostname} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${keymanager_hostname}")) \
- || print_error "Failed to update '/etc/hosts' file. "
-
- elif [[ "${STRATOS_SERVICE_NAME}" = "keymanager" ]] ; then
- gateway_host_name="<%= @stratos_instance_data_gateway_host_name %>"
-
- (${GREP} -q "${gateway_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${gateway_host_name} # Stratos LB instance private IP" >> /etc/hosts \
- && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${gateway_host_name}")) \
- || print_error "Failed to update '/etc/hosts' file. "
-
-
- fi
-}
-
-function backup_file(){
- if [[ -f "$1.orig" ]];
- then
- print_message "Restoring from the Original template file $1"
- cp -f "$1.orig" "$1"
- else
- print_message "Creating a backup of the file $1"
- cp -f "$1" "$1.orig"
- fi
-}
-
-function configure_manager_worker_wka_members(){
-
- # generic worker manager seperation :D
- if [[ -z ${STRATOS_WK_MANAGER_MEMBER_COUNT} || ${STRATOS_WK_MANAGER_MEMBER_COUNT} -eq 0 ]] ; then
- print_message "manager WKA member count is zero or unavailable"
- else
- print_message "Configuring manager..."
- for i in `seq 0 $(( ${STRATOS_WK_MANAGER_MEMBER_COUNT} - 1 ))`
- do
- member_ip_name="STRATOS_WK_MANAGER_MEMBER_${i}_IP"
- member_ip=${member_ip_name}
- if [[ -z ${member_ip} ]] ; then
- print_error "WKA is null for STRATOS_WK_MANAGER_MEMBER_${i}_IP"
- fi
- print_message "$i => ${member_ip}"
- WKA_XML=$"${WKA_XML}<member><hostName>${!member_ip}</hostName><port>4000</port></member>\n"
- done
- fi
-
- if [[ -z ${STRATOS_WK_WORKER_MEMBER_COUNT} || ${STRATOS_WK_WORKER_MEMBER_COUNT} -eq 0 ]] ; then
- print_message "worker WKA member count is zero or unavailable"
- else
- print_message "Configuring worker..."
- for i in `seq 0 $(( ${STRATOS_WK_WORKER_MEMBER_COUNT} - 1 ))`
- do
- member_ip_name="STRATOS_WK_WORKER_MEMBER_${i}_IP"
- member_ip=${member_ip_name}
- if [[ -z ${member_ip} ]] ; then
- print_error "WKA is null for STRATOS_WK_WORKER_MEMBER_${i}_IP"
- fi
- print_message "$i => ${member_ip}"
- WKA_XML=$"${WKA_XML}<member><hostName>${!member_ip}</hostName><port>4000</port></member>\n"
- done
- fi
-
- print_message "${STRATOS_SERVICE_NAME} WKA_XML => ${WKA_XML}"
- verify_file_exists ${AXIS2_XML_FILE}
- ${SED} -i "s%${WKA_LINE}%${WKA_XML}%g" ${AXIS2_XML_FILE} && print_message "gateway WKA configuration successful" || print_error "Failed to configure well known members"
-
-}
-
-
-function configure_wk_members(){
-
- print_message "Performing clustering configuration for ${STRATOS_SERVICE_NAME}..."
-
- WKA_XML=""
- KEYMGR_XML=""
- WKA_LINE="@WELL_KNOWN_MEMBERS"
- KEYMGR_LINE="@KEYMANAGER_SERVER_URL"
-
- AXIS2_XML_FILE=${STRATOS_APP_PATH}/repository/conf/axis2/axis2.xml
- backup_file ${AXIS2_XML_FILE}
-
-
- if [[ (! -z $STRATOS_SERVICE_GROUP) && "${STRATOS_SERVICE_GROUP}" = "apim" ]] ; then
- API_MANAGER_XML_FILE=${STRATOS_APP_PATH}/repository/conf/api-manager.xml
- backup_file ${API_MANAGER_XML_FILE}
-
- if [[ "${STRATOS_SERVICE_NAME}" = "apistore" || "${STRATOS_SERVICE_NAME}" = "publisher" ]] ; then
-
- print_message "Configuring axis2.xml for ${STRATOS_SERVICE_NAME}..."
- WKA_XML=$"${WKA_XML}<member><hostName>${STRATOS_WK_APISTORE_MEMBER_IP}</hostName><port>4000</port></member>\n"
- WKA_XML=$"${WKA_XML}<member><hostName>${STRATOS_WK_PUBLISHER_MEMBER_IP}</hostName><port>4000</port></member>\n"
- print_message "${STRATOS_SERVICE_NAME} WKA_XML => ${WKA_XML}"
- verify_file_exists ${AXIS2_XML_FILE}
- ${SED} -i "s%${WKA_LINE}%${WKA_XML}%g" ${AXIS2_XML_FILE} && print_message "${STRATOS_SERVICE_NAME} WKA configuration successful" || print_error "Failed to configure well known members"
-
- elif [[ "${STRATOS_SERVICE_NAME}" = "keymanager" ]] ; then
-
- print_message "In keymanager...nothing to do"
-
- elif [[ "${STRATOS_SERVICE_NAME}" = "gateway" || "${STRATOS_SERVICE_NAME}" = "gatewaymgt" ]] ; then
-
- if [[ "${DEPLOYMENT}" = "manager" || "${DEPLOYMENT}" = "worker" ]] ; then
-
- configure_manager_worker_wka_members
- fi
-
- fi
- elif [[ "${DEPLOYMENT}" = "manager" || "${DEPLOYMENT}" = "worker" ]] ; then
-
- configure_manager_worker_wka_members
- else
- print_message "Configuring ${STRATOS_SERVICE_NAME}..."
- for i in `seq 0 $(( ${STRATOS_WK_MEMBER_COUNT} - 1 ))`
- do
- member_ip="STRATOS_WK_MEMBER_${i}_IP"
- if [[ -z ${!member_ip} ]] ; then
- print_error "WKA is null for STRATOS_WK_MEMBER_${i}_IP"
- fi
- print_message "$i => ${!member_ip}"
- WKA_XML=$"${WKA_XML}<member><hostName>${!member_ip}</hostName><port>4000</port></member>\n"
- done
-
- print_message "${STRATOS_SERVICE_NAME} WKA_XML => ${WKA_XML}"
- verify_file_exists ${AXIS2_XML_FILE}
- ${SED} -i "s%${WKA_LINE}%${WKA_XML}%g" ${AXIS2_XML_FILE} && print_message "${STRATOS_SERVICE_NAME} WKA configuration successful" || print_error "Failed to configure well known members"
- fi
-}
-
-# Check if APP_PATH exists
-if [[ ! -d $STRATOS_APP_PATH ]] ; then
- print_error "APP_PATH is not found at: ${STRATOS_APP_PATH}"
-fi
-
-# Check if product server is already running
-if [[ -f $STRATOS_APP_PATH/wso2carbon.pid ]] ; then
- PID=`cat $STRATOS_APP_PATH/wso2carbon.pid`
- if ${PS} -p $PID > /dev/null ; then
- ${ECHO} -e `date`": process is already running...skipping start servers"
- exit 0
- fi
-fi
-
-# Set JAVA_HOME if it is not already set
-if [[ -z $JAVA_HOME ]] ; then
- print_message "Setting JAVA_HOME to /opt/java"
- export JAVA_HOME=/opt/java
-fi
-
-# Check if clustering is enabled for this product
-if [[ -z $STRATOS_CLUSTERING ]] ; then
- ${ECHO} -e `date`": starting servers in stand-alone mode..." | tee -a $log
- if [[ ${VERBOSE} -eq 1 ]]; then
- printParameters
- fi
-
-else
- ${ECHO} -e `date`": starting servers in clustering mode..." | tee -a $log
- if [[ ${VERBOSE} -eq 1 ]] ; then
- printParameters
- fi
- # Do the WKA configuration to support clustering
- configure_wk_members
-fi
-
-<%- if @using_dns == true -%>
- #Update the DNS mapping
-<%- else -%>
- # Update the /etc/hosts file with LB instance IP
- update_hosts_file
-<%- end -%>
-
-
-# Run start server command
-verify_file_exists $STRATOS_APP_PATH/bin/wso2server.sh
-$STRATOS_APP_PATH/bin/wso2server.sh $* > /dev/null 2>&1 &
-print_message "Executed run command: $STRATOS_APP_PATH/bin/wso2server.sh $*"
-${ECHO} -e `date`": start servers extension successfully completed."
-
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo `date`": Starting servers" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/subscription-domain-added.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/subscription-domain-added.sh.erb b/tools/puppet3/modules/agent/templates/extensions/subscription-domain-added.sh.erb
index 9ef88a2..a8b7459 100644
--- a/tools/puppet3/modules/agent/templates/extensions/subscription-domain-added.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/subscription-domain-added.sh.erb
@@ -26,10 +26,4 @@
log=/var/log/apache-stratos/cartridge-agent-extensions.log
OUTPUT=`date`": Subscription Domain Added Event"
-OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_SERVICE_NAME: ${STRATOS_SUBSCRIPTION_SERVICE_NAME},"
-OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_DOMAIN_NAME: ${STRATOS_SUBSCRIPTION_DOMAIN_NAME},"
-OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_TENANT_ID: ${STRATOS_SUBSCRIPTION_TENANT_ID},"
-OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_TENANT_DOMAIN: $STRATOS_SUBSCRIPTION_TENANT_DOMAIN},"
-OUTPUT="$OUTPUT APP_PATH: ${APP_PATH},"
-OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_APPLICATION_CONTEXT: ${STRATOS_SUBSCRIPTION_APPLICATION_CONTEXT}"
echo $OUTPUT | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/agent/templates/extensions/subscription-domain-removed.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/subscription-domain-removed.sh.erb b/tools/puppet3/modules/agent/templates/extensions/subscription-domain-removed.sh.erb
index ff7b56b..3612bb6 100644
--- a/tools/puppet3/modules/agent/templates/extensions/subscription-domain-removed.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/subscription-domain-removed.sh.erb
@@ -26,9 +26,4 @@
log=/var/log/apache-stratos/cartridge-agent-extensions.log
OUTPUT=`date`": Subscription Domain Removed Event"
-OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_SERVICE_NAME: ${STRATOS_SUBSCRIPTION_SERVICE_NAME},"
-OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_DOMAIN_NAME: ${STRATOS_SUBSCRIPTION_DOMAIN_NAME},"
-OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_TENANT_ID: ${STRATOS_SUBSCRIPTION_TENANT_ID},"
-OUTPUT="$OUTPUT APP_PATH: ${APP_PATH},"
-OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_TENANT_DOMAIN: $STRATOS_SUBSCRIPTION_TENANT_DOMAIN}"
echo $OUTPUT | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/LICENSE
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/LICENSE b/tools/puppet3/modules/appserver/LICENSE
new file mode 100644
index 0000000..1efdbc6
--- /dev/null
+++ b/tools/puppet3/modules/appserver/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2005-2013 WSO2, Inc. http://www.wso2.org
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/Modulefile
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/Modulefile b/tools/puppet3/modules/appserver/Modulefile
new file mode 100644
index 0000000..bd72838
--- /dev/null
+++ b/tools/puppet3/modules/appserver/Modulefile
@@ -0,0 +1,11 @@
+name 'wso2-appserver'
+version '0.1.0'
+source ''
+author 'WSO2 Inc'
+license 'Apache License Version 2.0'
+summary 'WSO2 AS puppet module'
+description 'WSO2 AS 5.2.1 version puppet module'
+project_page ''
+
+## Add dependencies, if any:
+# dependency 'username/name', '>= 1.2.0'
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/README
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/README b/tools/puppet3/modules/appserver/README
new file mode 100644
index 0000000..dba02ba
--- /dev/null
+++ b/tools/puppet3/modules/appserver/README
@@ -0,0 +1,11 @@
+Requirements:
+ Java, unzip, wget, mysql-connector jar (If connecting to a mysql database)
+
+How to use:
+1. Import wso2.pp to sites.pp file in Puppet master.
+2. Change the variables in params.pp accordingly.
+3. Create a directory inside files/configs/repository/components/lib and copy
+ the mysql connector jar file.
+4. Download the WSO2 Appserver pack to a file server and add the URL to
+ $package_repo in wso2.pp
+5. Add/Remove (comment/uncomment) service_templates from init.pp as required
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/files/configs/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/files/configs/README.txt b/tools/puppet3/modules/appserver/files/configs/README.txt
new file mode 100644
index 0000000..d5ed7a9
--- /dev/null
+++ b/tools/puppet3/modules/appserver/files/configs/README.txt
@@ -0,0 +1,5 @@
+Copy configuration files here.
+
+The contents in this directory will be copied to CARBON_HOME. If you need to copy
+your configuration files to CARBON_HOME/repository/conf you need to have the
+same directory structure under this directory.
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/files/configs/repository/components/lib/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/files/configs/repository/components/lib/README.txt b/tools/puppet3/modules/appserver/files/configs/repository/components/lib/README.txt
new file mode 100644
index 0000000..c83339a
--- /dev/null
+++ b/tools/puppet3/modules/appserver/files/configs/repository/components/lib/README.txt
@@ -0,0 +1 @@
+Copy mysql connect jar here
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/files/patches/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/files/patches/README.txt b/tools/puppet3/modules/appserver/files/patches/README.txt
new file mode 100644
index 0000000..a6a2241
--- /dev/null
+++ b/tools/puppet3/modules/appserver/files/patches/README.txt
@@ -0,0 +1,3 @@
+The contents in this directory will be copied to CARBON_HOME. If you need to copy
+your patches to CARBON_HOME/repository/components/patches you need to have the
+same directory structure under this directory.
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/files/patches/repository/components/patches/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/files/patches/repository/components/patches/README.txt b/tools/puppet3/modules/appserver/files/patches/repository/components/patches/README.txt
new file mode 100644
index 0000000..c2fadc5
--- /dev/null
+++ b/tools/puppet3/modules/appserver/files/patches/repository/components/patches/README.txt
@@ -0,0 +1 @@
+Copy patches here
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/lib/facter/java_home.rb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/lib/facter/java_home.rb b/tools/puppet3/modules/appserver/lib/facter/java_home.rb
new file mode 100644
index 0000000..9aa9d56
--- /dev/null
+++ b/tools/puppet3/modules/appserver/lib/facter/java_home.rb
@@ -0,0 +1,5 @@
+Facter.add(:java_home) do
+ setcode do
+ java_home = ENV['JAVA_HOME']
+ end
+end
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/manifests/clean.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/manifests/clean.pp b/tools/puppet3/modules/appserver/manifests/clean.pp
new file mode 100644
index 0000000..7c219b6
--- /dev/null
+++ b/tools/puppet3/modules/appserver/manifests/clean.pp
@@ -0,0 +1,45 @@
+# ----------------------------------------------------------------------------
+# Copyright 2005-2013 WSO2, Inc. http://www.wso2.org
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------
+#
+# Cleans the previous deployment. If the maintenance mode is set to true, this will only kill the running service.
+
+define appserver::clean ($mode, $target) {
+ if $mode == 'refresh' {
+ exec{
+ "Remove_lock_file_${name}":
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+ onlyif => "test -f ${target}/wso2carbon.lck",
+ command => "rm ${target}/wso2carbon.lck";
+
+ "Stop_process_${name}":
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+ command => "kill -9 `cat ${target}/wso2carbon.pid` ; /bin/echo Killed",
+ require => Exec["Remove_lock_file_${name}"];
+ }
+ }
+ elsif $mode == 'new' {
+ exec { "Stop_process_and_remove_CARBON_HOME_${name}":
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+ command => "kill -9 `cat ${target}/wso2carbon.pid` ; rm -rf ${target}";
+ }
+ }
+ elsif $mode == 'zero' {
+ exec { "Stop_process_remove_CARBON_HOME_and_pack_${name}":
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+ command => "kill -9 `cat ${target}/wso2carbon.pid` ; rm -rf ${target} ; rm -f ${::local_package_dir}/wso2${appserver::service_code}-${appserver::version}.zip";
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/manifests/deploy.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/manifests/deploy.pp b/tools/puppet3/modules/appserver/manifests/deploy.pp
new file mode 100644
index 0000000..78889db
--- /dev/null
+++ b/tools/puppet3/modules/appserver/manifests/deploy.pp
@@ -0,0 +1,43 @@
+# ----------------------------------------------------------------------------
+# Copyright 2005-2013 WSO2, Inc. http://www.wso2.org
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------
+#
+# Executes the deployment by pushing all necessary configurations and patches
+
+define appserver::deploy ($security, $target, $owner, $group) {
+ file { "/tmp/${appserver::deployment_code}":
+ ensure => present,
+ owner => $owner,
+ group => $group,
+ sourceselect => all,
+ ignore => '.svn',
+ recurse => true,
+ source => [
+ 'puppet:///modules/appserver/configs/',
+ 'puppet:///modules/appserver/patches/']
+ }
+
+ exec {
+ "Copy_${name}_modules_to_carbon_home":
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+ command => "cp -r /tmp/${appserver::deployment_code}/* ${target}/; chown -R ${owner}:${owner} ${target}/; chmod -R 755 ${target}/",
+ require => File["/tmp/${appserver::deployment_code}"];
+
+ "Remove_${name}_temporory_modules_directory":
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+ command => "rm -rf /tmp/${appserver::deployment_code}",
+ require => Exec["Copy_${name}_modules_to_carbon_home"];
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/manifests/init.pp b/tools/puppet3/modules/appserver/manifests/init.pp
new file mode 100644
index 0000000..fe0ec4d
--- /dev/null
+++ b/tools/puppet3/modules/appserver/manifests/init.pp
@@ -0,0 +1,137 @@
+# ----------------------------------------------------------------------------
+# Copyright 2005-2013 WSO2, Inc. http://www.wso2.org
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------
+#
+# Class: appserver
+#
+# This class installs WSO2 Appserver
+#
+# Parameters:
+# version => '5.2.1'
+# offset => 1,
+# hazelcast_port => 4100,
+# config_db => 'as_config',
+# maintenance_mode => 'zero',
+# depsync => false,
+# sub_cluster_domain => 'mgt',
+# clustering => true,
+# owner => 'root',
+# group => 'root',
+# target => '/mnt/${server_ip}/',
+# members => {'elb2.wso2.com' => 4010, 'elb.wso2.com' => 4010 }
+#
+# Actions:
+# - Install WSO2 Appserver
+#
+# Requires:
+#
+# Sample Usage:
+#
+
+class appserver (
+ $version = undef,
+ $sub_cluster_domain = undef,
+ $members = undef,
+ $offset = 0,
+ $hazelcast_port = 4000,
+ $config_db = 'governance',
+ $config_target_path = 'config/as',
+ $maintenance_mode = true,
+ $depsync = false,
+ $clustering = false,
+ $cloud = true,
+ $owner = 'root',
+ $group = 'root',
+ $target = "/mnt/${server_ip}",
+) inherits params {
+
+ $deployment_code = 'appserver'
+ $carbon_version = $version
+ $service_code = 'as'
+ $carbon_home = "${target}/wso2${service_code}-${carbon_version}"
+
+ $service_templates = $sub_cluster_domain ? {
+ 'mgt' => [
+ 'conf/axis2/axis2.xml',
+ 'conf/carbon.xml',
+# 'conf/datasources/master-datasources.xml',
+# 'conf/registry.xml',
+# 'conf/tomcat/catalina-server.xml',
+# 'conf/user-mgt.xml',
+ ],
+ 'worker' => [
+ 'conf/axis2/axis2.xml',
+ 'conf/carbon.xml',
+# 'conf/datasources/master-datasources.xml',
+# 'conf/registry.xml',
+# 'conf/tomcat/catalina-server.xml',
+# 'conf/user-mgt.xml',
+ ],
+ default => [
+ 'conf/axis2/axis2.xml',
+ 'conf/carbon.xml',
+ 'conf/datasources/master-datasources.xml',
+ 'conf/registry.xml',
+ 'conf/tomcat/catalina-server.xml',
+ 'conf/user-mgt.xml',
+ 'conf/log4j.properties',
+ 'conf/security/authenticators.xml',
+ ],
+ }
+
+ tag($service_code)
+
+ appserver::clean { $deployment_code:
+ mode => $maintenance_mode,
+ target => $carbon_home,
+ }
+
+ appserver::initialize { $deployment_code:
+ repo => $package_repo,
+ version => $carbon_version,
+ service => $service_code,
+ local_dir => $local_package_dir,
+ target => $target,
+ mode => $maintenance_mode,
+ owner => $owner,
+ require => Appserver::Clean[$deployment_code],
+ }
+
+ appserver::deploy { $deployment_code:
+ security => true,
+ owner => $owner,
+ group => $group,
+ target => $carbon_home,
+ require => Appserver::Initialize[$deployment_code],
+ }
+
+ appserver::push_templates {
+ $service_templates:
+ target => $carbon_home,
+ directory => $deployment_code,
+ require => Appserver::Deploy[$deployment_code];
+ }
+
+# appserver::start { $deployment_code:
+# owner => $owner,
+# target => $carbon_home,
+# require => [
+# Appserver::Initialize[$deployment_code],
+# Appserver::Deploy[$deployment_code],
+# Push_templates[$service_templates],
+# ],
+# }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/manifests/initialize.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/manifests/initialize.pp b/tools/puppet3/modules/appserver/manifests/initialize.pp
new file mode 100644
index 0000000..939bfb6
--- /dev/null
+++ b/tools/puppet3/modules/appserver/manifests/initialize.pp
@@ -0,0 +1,59 @@
+# ----------------------------------------------------------------------------
+# Copyright 2005-2013 WSO2, Inc. http://www.wso2.org
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------
+#
+# Initializing the deployment
+
+define appserver::initialize ($repo, $version, $service, $local_dir, $target, $mode, $owner,) {
+
+ exec {
+ "creating_target_for_${name}":
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+ command => "mkdir -p ${target}";
+
+ "creating_local_package_repo_for_${name}":
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+ unless => "test -d ${local_dir}",
+ command => "mkdir -p ${local_dir}";
+ }
+
+ file {
+ "/${local_dir}/wso2${service}-${version}.zip":
+ ensure => present,
+ source => ["puppet:///modules/appserver/wso2${service}-${version}.zip", "puppet:///packs/wso2${service}-${version}.zip"],
+ require => Exec["creating_local_package_repo_for_${name}", "creating_target_for_${name}"];
+ }
+
+ exec {
+ "extracting_wso2${service}-${version}.zip_for_${name}":
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+ cwd => $target,
+ unless => "test -d ${target}/wso2${service}-${version}/repository",
+ command => "unzip ${local_dir}/wso2${service}-${version}.zip",
+ logoutput => 'on_failure',
+ creates => "${target}/wso2${service}-${version}/repository",
+ timeout => 0,
+ require => File["/${local_dir}/wso2${service}-${version}.zip"];
+
+ "setting_permission_for_${name}":
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+ cwd => $target,
+ command => "chown -R ${owner}:${owner} ${target}/wso2${service}-${version} ;
+ chmod -R 755 ${target}/wso2${service}-${version}",
+ logoutput => 'on_failure',
+ timeout => 0,
+ require => Exec["extracting_wso2${service}-${version}.zip_for_${name}"];
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/manifests/params.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/manifests/params.pp b/tools/puppet3/modules/appserver/manifests/params.pp
new file mode 100644
index 0000000..e9b2fd2
--- /dev/null
+++ b/tools/puppet3/modules/appserver/manifests/params.pp
@@ -0,0 +1,74 @@
+# ----------------------------------------------------------------------------
+# Copyright 2005-2013 WSO2, Inc. http://www.wso2.org
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------
+#
+# Class appserver::params
+#
+# This class manages appserver parameters
+#
+# Parameters:
+#
+# Usage: Uncomment the variable and assign a value to override the wso2.pp value
+#
+#
+
+class appserver::params {
+ #$package_repo = 'http://ec2-54-251-18-7.ap-southeast-1.compute.amazonaws.com'
+ $depsync_svn_repo = 'https://svn.appfactory.domain.com/wso2/repo/'
+ $local_package_dir = '/mnt/packs'
+
+ # Service subdomains
+ $domain = 'wso2.com'
+ $as_subdomain = 'appserver'
+ $management_subdomain = 'management'
+
+ $admin_username = 'ADMIN_USER'
+ $admin_password = 'ADMIN_PASSWORD'
+
+ # MySQL server configuration details
+ #$mysql_server = 'ec2-54-254-43-232.ap-southeast-1.compute.amazonaws.com'
+ #$mysql_port = '3306'
+ #$max_connections = '100000'
+ #$max_active = '150'
+ #$max_wait = '360000'
+
+ # Database details
+ $registry_user = 'DB_USER'
+ $registry_password = 'DB_PASSWORD'
+ $registry_database = 'REGISTRY_DB'
+
+ $userstore_user = 'DB_USER'
+ $userstore_password = 'DB_PASSWORD'
+ $userstore_database = 'USERSTORE_DB'
+
+ # Depsync settings
+ $svn_user = 'wso2'
+ $svn_password = 'wso2123'
+
+ # Auto-scaler
+ $auto_scaler_epr = 'http://xxx:9863/services/AutoscalerService/'
+
+ #LDAP settings
+ $ldap_connection_uri = 'ldap://localhost:10389'
+ $bind_dn = 'uid=admin,ou=system'
+ $bind_dn_password = 'adminpassword'
+ $user_search_base = 'ou=system'
+ $group_search_base = 'ou=system'
+ $sharedgroup_search_base = 'ou=SharedGroups,dc=wso2,dc=org'
+
+ #Proxy ports
+ $http_proxy_port = '80'
+ $https_proxy_port = '443'
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/manifests/push_templates.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/manifests/push_templates.pp b/tools/puppet3/modules/appserver/manifests/push_templates.pp
new file mode 100644
index 0000000..4351ce2
--- /dev/null
+++ b/tools/puppet3/modules/appserver/manifests/push_templates.pp
@@ -0,0 +1,26 @@
+# ----------------------------------------------------------------------------
+# Copyright 2005-2013 WSO2, Inc. http://www.wso2.org
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------
+#
+# Apply the templates
+define appserver::push_templates ($directory, $target) {
+ file { "${target}/repository/${name}":
+ ensure => present,
+ owner => $appserver::owner,
+ group => $appserver::group,
+ mode => '0755',
+ content => template("${directory}/${name}.erb"),
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/manifests/start.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/manifests/start.pp b/tools/puppet3/modules/appserver/manifests/start.pp
new file mode 100644
index 0000000..033a052
--- /dev/null
+++ b/tools/puppet3/modules/appserver/manifests/start.pp
@@ -0,0 +1,28 @@
+# ----------------------------------------------------------------------------
+# Copyright 2005-2013 WSO2, Inc. http://www.wso2.org
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------------
+#
+# Starts the service once the deployment is successful.
+
+define appserver::start ($target, $owner) {
+ exec { "strating_${name}":
+ user => $owner,
+ environment => "JAVA_HOME=$java_home",
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+ unless => "test -f ${target}/wso2carbon.lck",
+ command => "touch ${target}/wso2carbon.lck; ${target}/bin/wso2server.sh > /dev/null 2>&1 &",
+ creates => "${target}/repository/wso2carbon.log",
+ }
+}
[03/12] re-organizing puppet modules
Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/conf/axis2/axis2.xml.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/conf/axis2/axis2.xml.erb b/tools/puppet3/modules/appserver/templates/conf/axis2/axis2.xml.erb
new file mode 100644
index 0000000..15c9f68
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/conf/axis2/axis2.xml.erb
@@ -0,0 +1,713 @@
+<!--
+ ~ Copyright 2005-2011 WSO2, Inc. (http://wso2.com)
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<axisconfig name="AxisJava2.0">
+
+ <!-- ================================================= -->
+ <!-- Globally engaged modules -->
+ <!-- ================================================= -->
+ <module ref="addressing"/>
+
+ <!-- ================================================= -->
+ <!-- Parameters -->
+ <!-- ================================================= -->
+ <parameter name="hotdeployment">true</parameter>
+ <parameter name="hotupdate">true</parameter>
+ <parameter name="enableMTOM" locked="false">optional</parameter>
+ <parameter name="cacheAttachments">true</parameter>
+ <parameter name="attachmentDIR">work/mtom</parameter>
+ <parameter name="sizeThreshold">4000</parameter>
+
+ <parameter name="EnableChildFirstClassLoading">true</parameter>
+
+ <!--
+ The exposeServiceMetadata parameter decides whether the metadata (WSDL, schema, policy) of
+ the services deployed on Axis2 should be visible when ?wsdl, ?wsdl2, ?xsd, ?policy requests
+ are received.
+ This parameter can be defined in the axi2.xml file, in which case this will be applicable
+ globally, or in the services.xml files, in which case, it will be applicable to the
+ Service groups and/or services, depending on the level at which the parameter is declared.
+ This value of this parameter defaults to true.
+ -->
+ <parameter name="exposeServiceMetadata">true</parameter>
+
+ <!--
+ Defines how the persistence of WS-ReliableMessaging is handled
+
+ Possible value are: inmemory & persistent
+ -->
+ <!-- Following parameter will completely disable REST handling in both the servlets-->
+ <parameter name="disableREST" locked="false">false</parameter>
+
+ <parameter name="Sandesha2StorageManager">inmemory</parameter>
+
+ <!-- This deployment interceptor will be called whenever before a module is initialized or
+ service is deployed -->
+ <listener class="org.wso2.carbon.core.deployment.DeploymentInterceptor"/>
+
+ <!-- setting servicePath. contextRoot is defined in the carbon.xml file -->
+ <!-- modification of this variable should be accompanied by the change in 'ServerURL' in carbon.xml file -->
+ <parameter name="servicePath">services</parameter>
+
+ <!--the directory in which .aar services are deployed inside axis2 repository-->
+ <parameter name="ServicesDirectory">axis2services</parameter>
+
+ <!--the directory in which modules are deployed inside axis2 repository-->
+ <parameter name="ModulesDirectory">axis2modules</parameter>
+
+ <parameter name="userAgent" locked="true">
+ Application Server-5.2.1
+ </parameter>
+ <parameter name="server" locked="true">
+ Application Server-5.2.1
+ </parameter>
+
+ <!-- ========================================================================-->
+
+ <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+ <!--that behaviour.-->
+ <parameter name="sendStacktraceDetailsWithFaults">false</parameter>
+
+ <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
+ <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
+ <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
+ <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
+ <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
+
+ <!--Set the flag to true if you want to enable transport level session mangment-->
+ <parameter name="manageTransportSession">true</parameter>
+
+ <!-- Synapse Configuration file -->
+ <parameter name="SynapseConfig.ConfigurationFile" locked="false">
+ ./repository/deployment/server/synapse-configs
+ </parameter>
+
+ <!-- Synapse Home parameter -->
+ <parameter name="SynapseConfig.HomeDirectory" locked="false">.</parameter>
+
+ <!-- Resolve root used to resolve synapse references like schemas inside a WSDL -->
+ <parameter name="SynapseConfig.ResolveRoot" locked="false">.</parameter>
+
+ <!-- Synapse Server name parameter -->
+ <parameter name="SynapseConfig.ServerName" locked="false">WSO2 Carbon Server</parameter>
+
+ <!--By default, JAXWS services are created by reading annotations. WSDL and schema are generated-->
+ <!--using a separate WSDL generator only when ?wsdl is called. Therefore, even if you engage-->
+ <!--policies etc.. to AxisService, it doesn't appear in the WSDL. By setting the following property-->
+ <!--to true, you can create the AxisService using the generated WSDL and remove the need for a-->
+ <!--WSDL generator. When ?wsdl is called, WSDL is generated in the normal way.-->
+ <parameter name="useGeneratedWSDLinJAXWS">true</parameter>
+
+ <!-- Deployer for the dataservice. -->
+ <!--<deployer extension="dbs" directory="dataservices" class="org.wso2.dataservices.DBDeployer"/>-->
+
+ <!-- Axis1 deployer for Axis2-->
+ <!--<deployer extension="wsdd" class="org.wso2.carbon.axis1services.Axis1Deployer" directory="axis1services"/>-->
+
+ <!-- POJO service deployer for Jar -->
+ <!--<deployer extension="jar" class="org.apache.axis2.deployment.POJODeployer" directory="pojoservices"/>-->
+
+ <!-- POJO service deployer for Class -->
+ <!--<deployer extension="class" class="org.apache.axis2.deployment.POJODeployer" directory="pojoservices"/>-->
+
+ <!-- JAXWS service deployer -->
+ <!--<deployer extension=".jar" class="org.apache.axis2.jaxws.framework.JAXWSDeployer" directory="servicejars"/>-->
+ <!-- ================================================= -->
+ <!-- Message Receivers -->
+ <!-- ================================================= -->
+ <!--This is the Default Message Receiver for the system , if you want to have MessageReceivers for -->
+ <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
+ <!--any operation -->
+ <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
+
+ <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/robust-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"/>
+ </messageReceivers>
+
+ <messageFormatters>
+ <messageFormatter contentType="application/x-www-form-urlencoded"
+ class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
+ <messageFormatter contentType="multipart/form-data"
+ class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
+ <messageFormatter contentType="application/xml"
+ class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
+ <messageFormatter contentType="text/xml"
+ class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
+ <messageFormatter contentType="application/soap+xml"
+ class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
+
+ <!--JSON Message Formatters-->
+ <messageFormatter contentType="application/json"
+ class="org.apache.axis2.json.JSONMessageFormatter"/>
+ <messageFormatter contentType="application/json/badgerfish"
+ class="org.apache.axis2.json.JSONBadgerfishMessageFormatter"/>
+ <messageFormatter contentType="text/javascript"
+ class="org.apache.axis2.json.JSONMessageFormatter"/>
+
+ <!--messageFormatter contentType="application/x-www-form-urlencoded"
+ class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
+ <!--messageFormatter contentType="multipart/form-data"
+ class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
+ <!--messageFormatter contentType="application/xml"
+ class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
+ <!--messageFormatter contentType="text/html"
+ class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
+ <!--messageFormatter contentType="application/soap+xml"
+ class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
+ <!--messageFormatter contentType="x-application/hessian"
+ class="org.apache.synapse.format.hessian.HessianMessageFormatter"/-->
+ <!--<messageFormatter contentType="">
+ class="org.apache.synapse.format.hessian.HessianMessageFormatter"/-->
+ </messageFormatters>
+
+ <messageBuilders>
+ <messageBuilder contentType="application/xml"
+ class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
+ <messageBuilder contentType="application/x-www-form-urlencoded"
+ class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
+ <messageBuilder contentType="multipart/form-data"
+ class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
+
+ <!--JSON Message Builders-->
+ <messageBuilder contentType="application/json"
+ class="org.apache.axis2.json.JSONOMBuilder"/>
+ <messageBuilder contentType="application/json/badgerfish"
+ class="org.apache.axis2.json.JSONBadgerfishOMBuilder"/>
+ <messageBuilder contentType="text/javascript"
+ class="org.apache.axis2.json.JSONOMBuilder"/>
+
+ <!--messageBuilder contentType="application/xml"
+ class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+ <!--messageBuilder contentType="application/x-www-form-urlencoded"
+ class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+ <!--messageBuilder contentType="multipart/form-data"
+ class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+ <!--messageBuilder contentType="multipart/related"
+ class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+ <!--messageBuilder contentType="application/soap+xml"
+ class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+ <!--messageBuilder contentType="text/plain"
+ class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+ <!--messageBuilder contentType="text/xml"
+ class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+ <!--messageFormatter contentType="text/plain"
+ class="org.apache.axis2.format.PlainTextBuilder"/-->
+ <!--messageBuilder contentType="x-application/hessian"
+ class="org.apache.synapse.format.hessian.HessianMessageBuilder"/-->
+ </messageBuilders>
+
+
+ <!-- ================================================= -->
+ <!-- In Transports -->
+ <!-- ================================================= -->
+ <transportReceiver name="http"
+ class="org.wso2.carbon.core.transports.http.HttpTransportListener">
+ <!--
+ Uncomment the following if you are deploying this within an application server. You
+ need to specify the HTTP port of the application server
+ -->
+ <parameter name="port">9763</parameter>
+
+ <!--
+ Uncomment the following to enable any proxy like Apache2 mod_proxy or any load balancer. The port on the proxy server like Apache is 80
+ in this case.
+ -->
+ <!--<parameter name="proxyPort">80</parameter>-->
+ </transportReceiver>
+
+ <!--Please uncomment this in Multiple Instance Scenario if you want to use NIO Transport Recievers and
+ Remove the current transport REceivers in axis2.xml -->
+ <!--transportReceiver name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOListener">
+ <parameter name="port" locked="false">8280</parameter>
+ <parameter name="non-blocking" locked="false">true</parameter>
+ </transportReceiver>
+
+ <transportReceiver name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLListener">
+ <parameter name="port" locked="false">8243</parameter>
+ <parameter name="non-blocking" locked="false">true</parameter>
+ <parameter name="keystore" locked="false">
+ <KeyStore>
+ <Location>repository/resources/security/wso2carbon.jks</Location>
+ <Type>JKS</Type>
+ <Password>wso2carbon</Password>
+ <KeyPassword>wso2carbon</KeyPassword>
+ </KeyStore>
+ </parameter>
+ <parameter name="truststore" locked="false">
+ <TrustStore>
+ <Location>repository/resources/security/client-truststore.jks</Location>
+ <Type>JKS</Type>
+ <Password>wso2carbon</Password>
+ </TrustStore>
+ </parameter>
+ </transportReceiver-->
+
+
+ <transportReceiver name="https"
+ class="org.wso2.carbon.core.transports.http.HttpsTransportListener">
+ <!--
+ Uncomment the following if you are deploying this within an application server. You
+ need to specify the HTTPS port of the application server
+ -->
+ <parameter name="port">9443</parameter>
+
+ <!--
+ Uncomment the following to enable any proxy like Apache2 mod_proxy or any load balancer. The port on a proxy server like Apache is 443
+ in this case.
+ -->
+ <!--<parameter name="proxyPort">443</parameter>-->
+ </transportReceiver>
+
+ <!--
+ Uncomment the following segment to enable TCP transport.
+ Note : Addressing module should be engaged for TCP transport to work
+ -->
+ <!--<transportReceiver name="tcp"
+ class="org.apache.axis2.transport.tcp.TCPServer">
+ <parameter name="port">6667</parameter>
+ </transportReceiver>-->
+
+ <!--
+ To Enable Mail Transport Listener, please uncomment the following.
+ -->
+ <!--<transportReceiver name="mailto" class="org.apache.axis2.transport.mail.MailTransportListener">
+
+ </transportReceiver>-->
+
+
+ <!--
+ Uncomment this and configure as appropriate for JMS transport support,
+ after setting up your JMS environment (e.g. ActiveMQ)
+ -->
+ <!--<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
+ <parameter name="myTopicConnectionFactory">
+ <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
+ </parameter>
+
+ <parameter name="myQueueConnectionFactory">
+ <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
+ </parameter>
+
+ <parameter name="default">
+ <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
+ </parameter>
+ </transportReceiver>-->
+
+ <!--Uncomment this and configure as appropriate for JMS transport support with Apache Qpid -->
+ <!--transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
+ <parameter name="myTopicConnectionFactory" locked="false">
+ <parameter name="java.naming.factory.initial" locked="false">org.apache.qpid.jndi.PropertiesFileInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
+ <parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
+ </parameter>
+
+ <parameter name="myQueueConnectionFactory" locked="false">
+ <parameter name="java.naming.factory.initial" locked="false">org.apache.qpid.jndi.PropertiesFileInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+ <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
+ </parameter>
+
+ <parameter name="default" locked="false">
+ <parameter name="java.naming.factory.initial" locked="false">org.apache.qpid.jndi.PropertiesFileInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+ <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
+ </parameter>
+ </transportReceiver-->
+
+ <!--Uncomment this and configure as appropriate for JMS transport support with WSO2 MB 2.x.x -->
+ <!--transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
+ <parameter name="myTopicConnectionFactory" locked="false">
+ <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
+ <parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
+ </parameter>
+
+ <parameter name="myQueueConnectionFactory" locked="false">
+ <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+ <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
+ </parameter>
+
+ <parameter name="default" locked="false">
+ <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+ <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
+ </parameter>
+ </transportReceiver-->
+
+
+ <!-- ================================================= -->
+ <!-- Out Transports -->
+ <!-- ================================================= -->
+
+ <transportSender name="tcp"
+ class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+ <transportReceiver name="local"
+ class="org.wso2.carbon.core.transports.local.CarbonLocalTransportReceiver"/>
+ <transportSender name="local"
+ class="org.wso2.carbon.core.transports.local.CarbonLocalTransportSender"/>
+ <!--<transportSender name="jms"
+ class="org.apache.axis2.transport.jms.JMSSender"/>-->
+ <transportSender name="http"
+ class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL">HTTP/1.1</parameter>
+ <parameter name="Transfer-Encoding">chunked</parameter>
+ <!-- This parameter has been added to overcome problems encounted in SOAP action parameter -->
+ <parameter name="OmitSOAP12Action">true</parameter>
+ </transportSender>
+ <transportSender name="https"
+ class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL">HTTP/1.1</parameter>
+ <parameter name="Transfer-Encoding">chunked</parameter>
+ <!-- This parameter has been added to overcome problems encounted in SOAP action parameter -->
+ <parameter name="OmitSOAP12Action">true</parameter>
+ </transportSender>
+
+ <!-- To enable mail transport sender, ncomment the following and change the parameters
+ accordingly-->
+ <!--<transportSender name="mailto"
+ class="org.apache.axis2.transport.mail.MailTransportSender">
+ <parameter name="mail.smtp.from">wso2demomail@gmail.com</parameter>
+ <parameter name="mail.smtp.user">wso2demomail</parameter>
+ <parameter name="mail.smtp.password">mailpassword</parameter>
+ <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
+
+ <parameter name="mail.smtp.port">587</parameter>
+ <parameter name="mail.smtp.starttls.enable">true</parameter>
+ <parameter name="mail.smtp.auth">true</parameter>
+ </transportSender>-->
+
+ <!--Please uncomment this in Multiple Instance Scenario if you want to use NIO sender -->
+ <!--
+ <transportSender name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
+ <parameter name="non-blocking" locked="false">true</parameter>
+ </transportSender>
+ <transportSender name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLSender">
+ <parameter name="non-blocking" locked="false">true</parameter>
+ <parameter name="keystore" locked="false">
+ <KeyStore>
+ <Location>repository/resources/security/wso2carbon.jks</Location>
+ <Type>JKS</Type>
+ <Password>wso2carbon</Password>
+ <KeyPassword>wso2carbon</KeyPassword>
+ </KeyStore>
+ </parameter>
+ <parameter name="truststore" locked="false">
+ <TrustStore>
+ <Location>repository/resources/security/client-truststore.jks</Location>
+ <Type>JKS</Type>
+ <Password>wso2carbon</Password>
+ </TrustStore>
+ </parameter>
+ </transportSender>
+ -->
+
+
+ <!-- ================================================= -->
+ <!-- Phases -->
+ <!-- ================================================= -->
+ <phaseOrder type="InFlow">
+ <!-- System pre defined phases -->
+ <!--
+ The MsgInObservation phase is used to observe messages as soon as they are
+ received. In this phase, we could do some things such as SOAP message tracing & keeping
+ track of the time at which a particular message was received
+
+ NOTE: This should be the very first phase in this flow
+ -->
+ <phase name="MsgInObservation"/>
+
+ <phase name="Validation"/>
+ <phase name="Transport">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
+ <order phase="Transport"/>
+ </handler>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
+ <order phase="Transport"/>
+ </handler>
+ </phase>
+ <phase name="Addressing">
+ <handler name="AddressingBasedDispatcher"
+ class="org.wso2.carbon.core.multitenancy.MultitenantAddressingBasedDispatcher">
+ <order phase="Addressing"/>
+ </handler>
+ </phase>
+ <phase name="Ghost">
+ <handler name="GhostDispatcher"
+ class="org.wso2.carbon.core.dispatchers.GhostDispatcher"/>
+ </phase>
+ <phase name="Security"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
+ <handler name="RequestURIOperationDispatcher"
+ class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
+
+ <handler name="HTTPLocationBasedDispatcher"
+ class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
+ </phase>
+ <!-- System pre defined phases -->
+ <phase name="RMPhase"/>
+ <phase name="OpPhase"/>
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="OperationInPhase"/>
+ </phaseOrder>
+ <phaseOrder type="OutFlow">
+ <!-- Handlers related to unified-endpoint component are added to the UEPPhase -->
+ <phase name="UEPPhase"/>
+ <phase name="RMPhase"/>
+ <phase name="OpPhase"/>
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationOutPhase"/>
+ <!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ <phase name="Security"/>
+
+ <!--
+ The MsgOutObservation phase is used to observe messages just before the
+ responses are sent out. In this phase, we could do some things such as SOAP message
+ tracing & keeping track of the time at which a particular response was sent.
+
+ NOTE: This should be the very last phase in this flow
+ -->
+ <phase name="MsgOutObservation"/>
+ <!--Following phase is added to publish stats -->
+ <phase name="StatReporting"/>
+ </phaseOrder>
+ <phaseOrder type="InFaultFlow">
+ <!-- System pre defined phases -->
+ <!--
+ The MsgInObservation phase is used to observe messages as soon as they are
+ received. In this phase, we could do some things such as SOAP message tracing & keeping
+ track of the time at which a particular message was received
+
+ NOTE: This should be the very first phase in this flow
+ -->
+ <phase name="MsgInObservation"/>
+
+ <phase name="Validation"/>
+ <phase name="Transport">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
+ <order phase="Transport"/>
+ </handler>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
+ <order phase="Transport"/>
+ </handler>
+ </phase>
+
+ <phase name="Addressing">
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+ <order phase="Addressing"/>
+ </handler>
+ </phase>
+ <phase name="Ghost">
+ <handler name="GhostDispatcher"
+ class="org.wso2.carbon.core.dispatchers.GhostDispatcher"/>
+ </phase>
+ <phase name="Security"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
+ <handler name="RequestURIOperationDispatcher"
+ class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
+
+ <handler name="HTTPLocationBasedDispatcher"
+ class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
+ </phase>
+ <phase name="RMPhase"/>
+ <phase name="OpPhase"/>
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationInFaultPhase"/>
+ </phaseOrder>
+ <phaseOrder type="OutFaultFlow">
+ <!-- Handlers related to unified-endpoint component are added to the UEPPhase -->
+ <phase name="UEPPhase"/>
+ <phase name="RMPhase"/>
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationOutFaultPhase"/>
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ <phase name="Security"/>
+ <phase name="Transport"/>
+ <!--
+ The MsgOutObservation phase is used to observe messages just before the
+ responses are sent out. In this phase, we could do some things such as SOAP message
+ tracing & keeping track of the time at which a particular response was sent.
+
+ NOTE: This should be the very last phase in this flow
+ -->
+ <phase name="MsgOutObservation"/>
+ <!--Following phase is added to publish stats -->
+ <phase name="StatReporting"/>
+ </phaseOrder>
+
+ <clustering class="org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent"
+ enable="<%= @clustering %>">
+
+ <!--
+ This parameter indicates whether the cluster has to be automatically initalized
+ when the AxisConfiguration is built. If set to "true" the initialization will not be
+ done at that stage, and some other party will have to explictly initialize the cluster.
+ -->
+ <parameter name="AvoidInitiation">true</parameter>
+
+ <!--
+ The membership scheme used in this setup. The only values supported at the moment are
+ "multicast" and "wka"
+
+ 1. multicast - membership is automatically discovered using multicasting
+ 2. wka - Well-Known Address based multicasting. Membership is discovered with the help
+ of one or more nodes running at a Well-Known Address. New members joining a
+ cluster will first connect to a well-known node, register with the well-known node
+ and get the membership list from it. When new members join, one of the well-known
+ nodes will notify the others in the group. When a member leaves the cluster or
+ is deemed to have left the cluster, it will be detected by the Group Membership
+ Service (GMS) using a TCP ping mechanism.
+ -->
+ <parameter name="membershipScheme">wka</parameter>
+ <!--<parameter name="licenseKey">xxx</parameter>-->
+ <!--<parameter name="mgtCenterURL">http://localhost:8081/mancenter/</parameter>-->
+
+ <!--
+ The clustering domain/group. Nodes in the same group will belong to the same multicast
+ domain. There will not be interference between nodes in different groups.
+ -->
+ <parameter name="domain">wso2.<%= @as_subdomain %>.domain</parameter>
+
+ <!-- The multicast address to be used -->
+ <!--<parameter name="mcastAddress">228.0.0.4</parameter>-->
+
+ <!-- The multicast port to be used -->
+ <parameter name="mcastPort">45564</parameter>
+
+ <parameter name="mcastTTL">100</parameter>
+
+ <parameter name="mcastTimeout">60</parameter>
+
+ <!--
+ The IP address of the network interface to which the multicasting has to be bound to.
+ Multicasting would be done using this interface.
+ -->
+ <!--
+ <parameter name="mcastBindAddress">127.0.0.1</parameter>
+ -->
+ <!-- The host name or IP address of this member -->
+
+ <parameter name="localMemberHost"><%= @ipaddress %></parameter>
+
+ <!--
+ The bind adress of this member. The difference between localMemberHost & localMemberBindAddress
+ is that localMemberHost is the one that is advertised by this member, while localMemberBindAddress
+ is the address to which this member is bound to.
+ -->
+ <!--parameter name="localMemberBindAddress">bind.<%= @domain %></parameter-->
+
+ <!--
+ The TCP port used by this member. This is the port through which other nodes will
+ contact this member
+ -->
+ <parameter name="localMemberPort"><%= @hazelcast_port %></parameter>
+
+ <!--
+ The bind port of this member. The difference between localMemberPort & localMemberBindPort
+ is that localMemberPort is the one that is advertised by this member, while localMemberBindPort
+ is the port to which this member is bound to.
+ -->
+ <!--
+ <parameter name="localMemberBindPort"><%= @hazelcast_port %></parameter>
+ -->
+
+ <!--
+ Properties specific to this member
+ -->
+ <parameter name="properties">
+ <property name="backendServerURL" value="https://${hostName}:${httpsPort}/services/"/>
+ <property name="mgtConsoleURL" value="https://${hostName}:${httpsPort}/"/>
+ <%- if @sub_cluster_domain -%>
+ <property name="subDomain" value="<%= @sub_cluster_domain %>"/>
+ <%- end -%>
+ </parameter>
+
+ <!--
+ The list of static or well-known members. These entries will only be valid if the
+ "membershipScheme" above is set to "wka"
+ -->
+
+
+ <members>
+ <%- if @clustering == true -%>
+ <%- if @members -%>
+ <%- @members.each_pair do |hostname,port| -%>
+ <member>
+ <hostName><%= hostname %></hostName>
+ <port><%= port %></port>
+ </member>
+ <%- end -%>
+ <%- else -%>
+@WELL_KNOWN_MEMBERS
+ <%- end -%>
+ <%- end -%>
+ </members>
+
+
+ <!--
+ Enable the groupManagement entry if you need to run this node as a cluster manager.
+ Multiple application domains with different GroupManagementAgent implementations
+ can be defined in this section.
+ -->
+ <groupManagement enable="false">
+ <applicationDomain name="wso2.as.domain"
+ description="AS group"
+ agent="org.wso2.carbon.core.clustering.hazelcast.HazelcastGroupManagementAgent"
+ subDomain="worker"
+ port="2222"/>
+ </groupManagement>
+ </clustering>
+</axisconfig>
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/conf/carbon.xml.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/conf/carbon.xml.erb b/tools/puppet3/modules/appserver/templates/conf/carbon.xml.erb
new file mode 100644
index 0000000..68d8e6f
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/conf/carbon.xml.erb
@@ -0,0 +1,626 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ Copyright 2005-2011 WSO2, Inc. (http://wso2.com)
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<!--
+ This is the main server configuration file
+
+ ${carbon.home} represents the carbon.home system property.
+ Other system properties can be specified in a similar manner.
+-->
+<Server xmlns="http://wso2.org/projects/carbon/carbon.xml">
+
+ <!--
+ Product Name
+ -->
+ <Name>Application Server</Name>
+
+ <!--
+ machine readable unique key to identify each product
+ -->
+ <ServerKey>AS</ServerKey>
+
+ <!--
+ Product Version
+ -->
+ <Version>5.2.1</Version>
+
+ <!--
+ Host name or IP address of the machine hosting this server
+ e.g. www.wso2.org, 192.168.1.10
+ This is will become part of the End Point Reference of the
+ services deployed on this server instance.
+ -->
+
+ <%- if @stratos_instance_data_deployment -%>
+ <%- if @stratos_instance_data_deployment = 'manager' -%>
+ <%- if @stratos_instance_data_worker_host_name -%>
+ <HostName><%= @stratos_instance_data_worker_host_name %></HostName>
+ <%- else -%>
+ <HostName><%= @stratos_instance_data_host_name %></HostName>
+ <%- end -%>
+ <%- else -%>
+ <HostName><%= @stratos_instance_data_host_name %></HostName>
+ <%- end -%>
+ <%- else -%>
+ <HostName><%= @stratos_instance_data_host_name %></HostName>
+ <%- end -%>
+ <!--
+ Host name to be used for the Carbon management console
+ -->
+ <MgtHostName><%= @stratos_instance_data_host_name %></MgtHostName>
+
+ <!--
+ The URL of the back end server. This is where the admin services are hosted and
+ will be used by the clients in the front end server.
+ This is required only for the Front-end server. This is used when seperating BE server from FE server
+ -->
+ <ServerURL>local:/${carbon.context}/services/</ServerURL>
+ <!--
+ <ServerURL>https://${carbon.local.ip}:${carbon.management.port}${carbon.context}/services/</ServerURL>
+ -->
+ <!--
+ The URL of the index page. This is where the user will be redirected after signing in to the
+ carbon server.
+ -->
+ <!-- IndexPageURL>/carbon/admin/index.jsp</IndexPageURL-->
+
+ <!--
+ For cApp deployment, we have to identify the roles that can be acted by the current server.
+ The following property is used for that purpose. Any number of roles can be defined here.
+ Regular expressions can be used in the role.
+ Ex : <Role>.*</Role> means this server can act any role
+ -->
+ <ServerRoles>
+ <Role>ApplicationServer</Role>
+ </ServerRoles>
+
+ <!-- uncommnet this line to subscribe to a bam instance automatically -->
+ <!--<BamServerURL>https://bamhost:bamport/services/</BamServerURL>-->
+
+ <!--
+ The fully qualified name of the server
+ -->
+ <Package>org.wso2.carbon</Package>
+
+ <!--
+ Webapp context root of WSO2 Carbon.
+ -->
+ <WebContextRoot>/</WebContextRoot>
+
+ <!-- In-order to get the registry http Port from the back-end when the default http transport is not the same-->
+ <!--RegistryHttpPort>9763</RegistryHttpPort-->
+
+ <!--
+ Number of items to be displayed on a management console page. This is used at the
+ backend server for pagination of various items.
+ -->
+ <ItemsPerPage>15</ItemsPerPage>
+
+ <!-- The endpoint URL of the cloud instance management Web service -->
+ <!--<InstanceMgtWSEndpoint>https://ec2.amazonaws.com/</InstanceMgtWSEndpoint>-->
+
+ <!--
+ Ports used by this server
+ -->
+ <Ports>
+
+ <!-- Ports offset. This entry will set the value of the ports defined below to
+ the define value + Offset.
+ e.g. Offset=2 and HTTPS port=9443 will set the effective HTTPS port to 9445
+ -->
+ <Offset><%= @offset %></Offset>
+
+ <!-- The JMX Ports -->
+ <JMX>
+ <!--The port RMI registry is exposed-->
+ <RMIRegistryPort>9999</RMIRegistryPort>
+ <!--The port RMI server should be exposed-->
+ <RMIServerPort>11111</RMIServerPort>
+ </JMX>
+
+ <!-- Embedded LDAP server specific ports -->
+ <EmbeddedLDAP>
+ <!-- Port which embedded LDAP server runs -->
+ <LDAPServerPort>10389</LDAPServerPort>
+ <!-- Port which KDC (Kerberos Key Distribution Center) server runs -->
+ <KDCServerPort>8000</KDCServerPort>
+ </EmbeddedLDAP>
+
+ <!-- Embedded Qpid broker ports -->
+ <EmbeddedQpid>
+ <!-- Broker TCP Port -->
+ <BrokerPort>5672</BrokerPort>
+ <!-- SSL Port -->
+ <BrokerSSLPort>8672</BrokerSSLPort>
+ </EmbeddedQpid>
+
+ <!--
+ Override datasources JNDIproviderPort defined in bps.xml and datasources.properties files
+ -->
+ <!--<JNDIProviderPort>2199</JNDIProviderPort>-->
+ <!--Override receive port of thrift based entitlement service.-->
+ <ThriftEntitlementReceivePort>10500</ThriftEntitlementReceivePort>
+
+ </Ports>
+
+ <!--
+ JNDI Configuration
+ -->
+ <JNDI>
+ <!--
+ The fully qualified name of the default initial context factory
+ -->
+ <DefaultInitialContextFactory>org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory</DefaultInitialContextFactory>
+ <!--
+ The restrictions that are done to various JNDI Contexts in a Multi-tenant environment
+ -->
+ <Restrictions>
+ <!--
+ Contexts that will be available only to the super-tenant
+ -->
+ <!-- <SuperTenantOnly>
+ <UrlContexts>
+ <UrlContext>
+ <Scheme>foo</Scheme>
+ </UrlContext>
+ <UrlContext>
+ <Scheme>bar</Scheme>
+ </UrlContext>
+ </UrlContexts>
+ </SuperTenantOnly> -->
+ <!--
+ Contexts that are common to all tenants
+ -->
+ <AllTenants>
+ <UrlContexts>
+ <UrlContext>
+ <Scheme>java</Scheme>
+ </UrlContext>
+ <!-- <UrlContext>
+ <Scheme>foo</Scheme>
+ </UrlContext> -->
+ </UrlContexts>
+ </AllTenants>
+ <!--
+ All other contexts not mentioned above will be available on a per-tenant basis
+ (i.e. will not be shared among tenants)
+ -->
+ </Restrictions>
+ </JNDI>
+
+ <!--
+ Property to determine if the server is running an a cloud deployment environment.
+ This property should only be used to determine deployment specific details that are
+ applicable only in a cloud deployment, i.e when the server deployed *-as-a-service.
+ -->
+ <IsCloudDeployment><%= @cloud %></IsCloudDeployment>
+
+ <!--
+ Property to determine whether usage data should be collected for metering purposes
+ -->
+ <EnableMetering>false</EnableMetering>
+
+ <!-- The Max time a thread should take for execution in seconds -->
+ <MaxThreadExecutionTime>600</MaxThreadExecutionTime>
+
+ <!--
+ A flag to enable or disable Ghost Deployer. By default this is set to false. That is
+ because the Ghost Deployer works only with the HTTP/S transports. If you are using
+ other transports, don't enable Ghost Deployer.
+ -->
+ <GhostDeployment>
+ <Enabled>false</Enabled>
+ <PartialUpdate>false</PartialUpdate>
+ </GhostDeployment>
+
+ <!--
+ Axis2 related configurations
+ -->
+ <Axis2Config>
+ <!--
+ Location of the Axis2 Services & Modules repository
+
+ This can be a directory in the local file system, or a URL.
+
+ e.g.
+ 1. /home/wso2wsas/repository/ - An absolute path
+ 2. repository - In this case, the path is relative to CARBON_HOME
+ 3. file:///home/wso2wsas/repository/
+ 4. http://wso2wsas/repository/
+ -->
+ <RepositoryLocation>${carbon.home}/repository/deployment/server/</RepositoryLocation>
+
+ <!--
+ Deployment update interval in seconds. This is the interval between repository listener
+ executions.
+ -->
+ <DeploymentUpdateInterval>15</DeploymentUpdateInterval>
+
+ <!--
+ Location of the main Axis2 configuration descriptor file, a.k.a. axis2.xml file
+
+ This can be a file on the local file system, or a URL
+
+ e.g.
+ 1. /home/repository/axis2.xml - An absolute path
+ 2. conf/axis2.xml - In this case, the path is relative to CARBON_HOME
+ 3. file:///home/carbon/repository/axis2.xml
+ 4. http://repository/conf/axis2.xml
+ -->
+ <ConfigurationFile>${carbon.home}/repository/conf/axis2/axis2.xml</ConfigurationFile>
+
+ <!--
+ ServiceGroupContextIdleTime, which will be set in ConfigurationContex
+ for multiple clients which are going to access the same ServiceGroupContext
+ Default Value is 30 Sec.
+ -->
+ <ServiceGroupContextIdleTime>30000</ServiceGroupContextIdleTime>
+
+ <!--
+ This repository location is used to crete the client side configuration
+ context used by the server when calling admin services.
+ -->
+ <ClientRepositoryLocation>${carbon.home}/repository/deployment/client/</ClientRepositoryLocation>
+ <!-- This axis2 xml is used in createing the configuration context by the FE server
+ calling to BE server -->
+ <clientAxis2XmlLocation>${carbon.home}/repository/conf/axis2/axis2_client.xml</clientAxis2XmlLocation>
+ <!-- If this parameter is set, the ?wsdl on an admin service will not give the admin service wsdl. -->
+ <HideAdminServiceWSDLs>true</HideAdminServiceWSDLs>
+
+ <!--WARNING-Use With Care! Uncommenting bellow parameter would expose all AdminServices in HTTP transport.
+ With HTTP transport your credentials and data routed in public channels are vulnerable for sniffing attacks.
+ Use bellow parameter ONLY if your communication channels are confirmed to be secured by other means -->
+ <!--HttpAdminServices>*</HttpAdminServices-->
+
+ </Axis2Config>
+
+ <!--
+ The default user roles which will be created when the server
+ is started up for the first time.
+ -->
+ <ServiceUserRoles>
+ <Role>
+ <Name>admin</Name>
+ <Description>Default Administrator Role</Description>
+ </Role>
+ <Role>
+ <Name>user</Name>
+ <Description>Default User Role</Description>
+ </Role>
+ </ServiceUserRoles>
+
+ <!--
+ Enable following config to allow Emails as usernames.
+ -->
+ <!--EnableEmailUserName>true</EnableEmailUserName-->
+
+ <!--
+ Security configurations
+ -->
+ <Security>
+ <!--
+ KeyStore which will be used for encrypting/decrypting passwords
+ and other sensitive information.
+ -->
+ <KeyStore>
+ <!-- Keystore file location-->
+ <Location>${carbon.home}/repository/resources/security/wso2carbon.jks</Location>
+ <!-- Keystore type (JKS/PKCS12 etc.)-->
+ <Type>JKS</Type>
+ <!-- Keystore password-->
+ <Password>wso2carbon</Password>
+ <!-- Private Key alias-->
+ <KeyAlias>wso2carbon</KeyAlias>
+ <!-- Private Key password-->
+ <KeyPassword>wso2carbon</KeyPassword>
+ </KeyStore>
+
+ <!--
+ System wide trust-store which is used to maintain the certificates of all
+ the trusted parties.
+ -->
+ <TrustStore>
+ <!-- trust-store file location -->
+ <Location>${carbon.home}/repository/resources/security/client-truststore.jks</Location>
+ <!-- trust-store type (JKS/PKCS12 etc.) -->
+ <Type>JKS</Type>
+ <!-- trust-store password -->
+ <Password>wso2carbon</Password>
+ </TrustStore>
+
+ <!--
+ The Authenticator configuration to be used at the JVM level. We extend the
+ java.net.Authenticator to make it possible to authenticate to given servers and
+ proxies.
+ -->
+ <NetworkAuthenticatorConfig>
+ <!--
+ Below is a sample configuration for a single authenticator. Please note that
+ all child elements are mandatory. Not having some child elements would lead to
+ exceptions at runtime.
+ -->
+ <!-- <Credential> -->
+ <!--
+ the pattern that would match a subset of URLs for which this authenticator
+ would be used
+ -->
+ <!-- <Pattern>regularExpression</Pattern> -->
+ <!--
+ the type of this authenticator. Allowed values are:
+ 1. server
+ 2. proxy
+ -->
+ <!-- <Type>proxy</Type> -->
+ <!-- the username used to log in to server/proxy -->
+ <!-- <Username>username</Username> -->
+ <!-- the password used to log in to server/proxy -->
+ <!-- <Password>password</Password> -->
+ <!-- </Credential> -->
+ </NetworkAuthenticatorConfig>
+
+ <!--
+ The Tomcat realm to be used for hosted Web applications. Allowed values are;
+ 1. UserManager
+ 2. Memory
+
+ If this is set to 'UserManager', the realm will pick users & roles from the system's
+ WSO2 User Manager. If it is set to 'memory', the realm will pick users & roles from
+ CARBON_HOME/repository/conf/tomcat/tomcat-users.xml
+ -->
+ <TomcatRealm>UserManager</TomcatRealm>
+
+ <!--Option to disable storing of tokens issued by STS-->
+ <DisableTokenStore>false</DisableTokenStore>
+
+ <!--
+ Security token store class name. If this is not set, default class will be
+ org.wso2.carbon.security.util.SecurityTokenStore
+ -->
+ <!--TokenStoreClassName>org.wso2.carbon.identity.sts.store.DBTokenStore</TokenStoreClassName-->
+ </Security>
+
+ <!--
+ The temporary work directory
+ -->
+ <WorkDirectory>${carbon.home}/tmp/work</WorkDirectory>
+
+ <!--
+ House-keeping configuration
+ -->
+ <HouseKeeping>
+
+ <!--
+ true - Start House-keeping thread on server startup
+ false - Do not start House-keeping thread on server startup.
+ The user will run it manually as and when he wishes.
+ -->
+ <AutoStart>true</AutoStart>
+
+ <!--
+ The interval in *minutes*, between house-keeping runs
+ -->
+ <Interval>10</Interval>
+
+ <!--
+ The maximum time in *minutes*, temp files are allowed to live
+ in the system. Files/directories which were modified more than
+ "MaxTempFileLifetime" minutes ago will be removed by the
+ house-keeping task
+ -->
+ <MaxTempFileLifetime>30</MaxTempFileLifetime>
+ </HouseKeeping>
+
+ <!--
+ Configuration for handling different types of file upload & other file uploading related
+ config parameters.
+ To map all actions to a particular FileUploadExecutor, use
+ <Action>*</Action>
+ -->
+ <FileUploadConfig>
+ <!--
+ The total file upload size limit in MB
+ -->
+ <TotalFileSizeLimit>100</TotalFileSizeLimit>
+
+ <Mapping>
+ <Actions>
+ <Action>keystore</Action>
+ <Action>certificate</Action>
+ <Action>*</Action>
+ </Actions>
+ <Class>org.wso2.carbon.ui.transports.fileupload.AnyFileUploadExecutor</Class>
+ </Mapping>
+
+ <Mapping>
+ <Actions>
+ <Action>jarZip</Action>
+ </Actions>
+ <Class>org.wso2.carbon.ui.transports.fileupload.JarZipUploadExecutor</Class>
+ </Mapping>
+ <Mapping>
+ <Actions>
+ <Action>dbs</Action>
+ </Actions>
+ <Class>org.wso2.carbon.ui.transports.fileupload.DBSFileUploadExecutor</Class>
+ </Mapping>
+ <Mapping>
+ <Actions>
+ <Action>tools</Action>
+ </Actions>
+ <Class>org.wso2.carbon.ui.transports.fileupload.ToolsFileUploadExecutor</Class>
+ </Mapping>
+ <Mapping>
+ <Actions>
+ <Action>toolsAny</Action>
+ </Actions>
+ <Class>org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor</Class>
+ </Mapping>
+ </FileUploadConfig>
+
+ <!--
+ Processors which process special HTTP GET requests such as ?wsdl, ?policy etc.
+
+ In order to plug in a processor to handle a special request, simply add an entry to this
+ section.
+
+ The value of the Item element is the first parameter in the query string(e.g. ?wsdl)
+ which needs special processing
+
+ The value of the Class element is a class which implements
+ org.wso2.carbon.transport.HttpGetRequestProcessor
+ -->
+ <HttpGetRequestProcessors>
+ <Processor>
+ <Item>info</Item>
+ <Class>org.wso2.carbon.core.transports.util.InfoProcessor</Class>
+ </Processor>
+ <Processor>
+ <Item>wsdl</Item>
+ <Class>org.wso2.carbon.core.transports.util.Wsdl11Processor</Class>
+ </Processor>
+ <Processor>
+ <Item>wsdl2</Item>
+ <Class>org.wso2.carbon.core.transports.util.Wsdl20Processor</Class>
+ </Processor>
+ <Processor>
+ <Item>xsd</Item>
+ <Class>org.wso2.carbon.core.transports.util.XsdProcessor</Class>
+ </Processor>
+ </HttpGetRequestProcessors>
+
+ <!-- Deployment Synchronizer Configuration. t Enabled value to true when running with "svn based" dep sync.
+ In master nodes you need to set both AutoCommit and AutoCheckout to true
+ and in worker nodes set only AutoCheckout to true.
+ -->
+ <DeploymentSynchronizer>
+ <Enabled><%= @depsync %></Enabled>
+ <%- if @sub_cluster_domain == 'mgt' -%>
+ <AutoCommit>true</AutoCommit>
+ <AutoCheckout>true</AutoCheckout>
+ <%- else -%>
+ <AutoCommit>false</AutoCommit>
+ <AutoCheckout>true</AutoCheckout>
+ <%- end -%>
+ <RepositoryType>svn</RepositoryType>
+ <SvnUrl><%= @depsync_svn_repo %>/appserver</SvnUrl>
+ <SvnUser><%= @svn_user %></SvnUser>
+ <SvnPassword><%= @svn_password %></SvnPassword>
+ <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId>
+ </DeploymentSynchronizer>
+
+ <!-- Deployment Synchronizer Configuration. Uncomment the following section when running with "registry based" dep sync.
+ In master nodes you need to set both AutoCommit and AutoCheckout to true
+ and in worker nodes set only AutoCheckout to true.
+ -->
+ <!--<DeploymentSynchronizer>
+ <Enabled>true</Enabled>
+ <AutoCommit>false</AutoCommit>
+ <AutoCheckout>true</AutoCheckout>
+ </DeploymentSynchronizer>-->
+
+ <!-- Mediation persistence configurations. Only valid if mediation features are available i.e. ESB -->
+ <!--<MediationConfig>
+ <LoadFromRegistry>false</LoadFromRegistry>
+ <SaveToFile>false</SaveToFile>
+ <Persistence>enabled</Persistence>
+ <RegistryPersistence>enabled</RegistryPersistence>
+ </MediationConfig>-->
+
+ <!--
+ Server intializing code, specified as implementation classes of org.wso2.carbon.core.ServerInitializer.
+ This code will be run when the Carbon server is initialized
+ -->
+ <ServerInitializers>
+ <!--<Initializer></Initializer>-->
+ </ServerInitializers>
+
+ <!--
+ Indicates whether the Carbon Servlet is required by the system, and whether it should be
+ registered
+ -->
+ <RequireCarbonServlet>${require.carbon.servlet}</RequireCarbonServlet>
+
+ <!--
+ Carbon H2 OSGI Configuration
+ By default non of the servers start.
+ name="web" - Start the web server with the H2 Console
+ name="webPort" - The port (default: 8082)
+ name="webAllowOthers" - Allow other computers to connect
+ name="webSSL" - Use encrypted (HTTPS) connections
+ name="tcp" - Start the TCP server
+ name="tcpPort" - The port (default: 9092)
+ name="tcpAllowOthers" - Allow other computers to connect
+ name="tcpSSL" - Use encrypted (SSL) connections
+ name="pg" - Start the PG server
+ name="pgPort" - The port (default: 5435)
+ name="pgAllowOthers" - Allow other computers to connect
+ name="trace" - Print additional trace information; for all servers
+ name="baseDir" - The base directory for H2 databases; for all servers
+ -->
+ <!--H2DatabaseConfiguration>
+ <property name="web" />
+ <property name="webPort">8082</property>
+ <property name="webAllowOthers" />
+ <property name="webSSL" />
+ <property name="tcp" />
+ <property name="tcpPort">9092</property>
+ <property name="tcpAllowOthers" />
+ <property name="tcpSSL" />
+ <property name="pg" />
+ <property name="pgPort">5435</property>
+ <property name="pgAllowOthers" />
+ <property name="trace" />
+ <property name="baseDir">${carbon.home}</property>
+ </H2DatabaseConfiguration-->
+ <!--Disabling statistics reporter by default-->
+ <StatisticsReporterDisabled>true</StatisticsReporterDisabled>
+
+ <!-- Enable accessing Admin Console via HTTP -->
+ <!-- EnableHTTPAdminConsole>true</EnableHTTPAdminConsole -->
+
+ <!--
+ Default Feature Repository of WSO2 Carbon.
+ -->
+ <FeatureRepository>
+ <RepositoryName>default repository</RepositoryName>
+ <RepositoryURL>http://dist.wso2.org/p2/carbon/releases/4.2.0</RepositoryURL>
+ </FeatureRepository>
+
+ <!--
+ Configure API Management
+ -->
+ <APIManagement>
+
+ <!--Uses the embedded API Manager by default. If you want to use an external
+ API Manager instance to manage APIs, configure below externalAPIManager-->
+
+ <Enabled>true</Enabled>
+
+ <!--Uncomment and configure API Gateway and
+ Publisher URLs to use external API Manager instance-->
+
+ <!--ExternalAPIManager>
+
+ <APIGatewayURL>http://localhost:8281</APIGatewayURL>
+ <APIPublisherURL>http://localhost:8281/publisher</APIPublisherURL>
+
+ </ExternalAPIManager-->
+
+ <LoadAPIContextsInServerStartup>true</LoadAPIContextsInServerStartup>
+ </APIManagement>
+</Server>
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/conf/datasources/master-datasources.xml.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/conf/datasources/master-datasources.xml.erb b/tools/puppet3/modules/appserver/templates/conf/datasources/master-datasources.xml.erb
new file mode 100644
index 0000000..0fce2f6
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/conf/datasources/master-datasources.xml.erb
@@ -0,0 +1,72 @@
+<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">
+
+ <providers>
+ <provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
+ </providers>
+
+ <datasources>
+
+ <datasource>
+ <name>WSO2_CARBON_DB</name>
+ <description>The datasource used for registry and user manager</description>
+ <jndiConfig>
+ <name>jdbc/WSO2CarbonDB</name>
+ </jndiConfig>
+ <definition type="RDBMS">
+ <configuration>
+ <url>jdbc:h2:<%= @carbon_home %>/repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000</url>
+ <username>wso2carbon</username>
+ <password>wso2carbon</password>
+ <driverClassName>org.h2.Driver</driverClassName>
+ <maxActive>50</maxActive>
+ <maxWait>60000</maxWait>
+ <testOnBorrow>true</testOnBorrow>
+ <validationQuery>SELECT 1</validationQuery>
+ <validationInterval>30000</validationInterval>
+ </configuration>
+ </definition>
+ </datasource>
+
+ <%- if @cloud == true or @clustering == true -%>
+ <%= scope.function_template(['appserver/conf/datasources/master-datasources/_remote.erb']) -%>
+ <%- end -%>
+
+
+ <!-- For an explanation of the properties, see: http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html -->
+ <!--datasource>
+ <name>SAMPLE_DATA_SOURCE</name>
+ <jndiConfig>
+ <name></name>
+ <environment>
+ <property name="java.naming.factory.initial"></property>
+ <property name="java.naming.provider.url"></property>
+ </environment>
+ </jndiConfig>
+ <definition type="RDBMS">
+ <configuration>
+
+ <defaultAutoCommit></defaultAutoCommit>
+ <defaultReadOnly></defaultReadOnly>
+ <defaultTransactionIsolation>NONE|READ_COMMITTED|READ_UNCOMMITTED|REPEATABLE_READ|SERIALIZABLE</defaultTransactionIsolation>
+ <defaultCatalog></defaultCatalog>
+ <username></username>
+ <password svns:secretAlias="WSO2.DB.Password"></password>
+ <maxActive></maxActive>
+ <maxIdle></maxIdle>
+ <initialSize></initialSize>
+ <maxWait></maxWait>
+
+ <dataSourceClassName>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</dataSourceClassName>
+ <dataSourceProps>
+ <property name="url">jdbc:mysql://localhost:3306/Test1</property>
+ <property name="user">root</property>
+ <property name="password">123</property>
+ </dataSourceProps>
+
+ </configuration>
+ </definition>
+ </datasource-->
+
+ </datasources>
+
+</datasources-configuration>
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/conf/datasources/master-datasources/_remote.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/conf/datasources/master-datasources/_remote.erb b/tools/puppet3/modules/appserver/templates/conf/datasources/master-datasources/_remote.erb
new file mode 100644
index 0000000..27fa824
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/conf/datasources/master-datasources/_remote.erb
@@ -0,0 +1,68 @@
+ <datasource>
+ <name>WSO2_GOVERNANCE_DB</name>
+ <description>The datasource used for governance MySQL database</description>
+ <jndiConfig>
+ <name>jdbc/<%= @registry_database %></name>
+ </jndiConfig>
+ <definition type="RDBMS">
+ <configuration>
+ <url>jdbc:mysql://<%= @mysql_server %>:<%= @mysql_port %>/<%= @registry_database %>?autoReconnect=true</url>
+ <username><%= @registry_user %></username>
+ <password><%= @registry_password %></password>
+ <driverClassName>com.mysql.jdbc.Driver</driverClassName>
+ <maxActive><%= @max_active %></maxActive>
+ <maxWait><%= @max_wait %></maxWait>
+ <minIdle>5</minIdle>
+ <testOnBorrow>true</testOnBorrow>
+ <validationQuery>SELECT 1</validationQuery>
+ <validationInterval>30000</validationInterval>
+ </configuration>
+ </definition>
+ </datasource>
+
+ <datasource>
+ <name>WSO2_USERSTORE_DB</name>
+ <description>The datasource used for userstore MySQL database</description>
+ <jndiConfig>
+ <name>jdbc/<%= @userstore_database %></name>
+ </jndiConfig>
+ <definition type="RDBMS">
+ <configuration>
+ <url>jdbc:mysql://<%= @mysql_server %>:<%= @mysql_port %>/<%= @userstore_database %>?autoReconnect=true</url>
+ <username><%= @userstore_user %></username>
+ <password><%= @userstore_password %></password>
+ <driverClassName>com.mysql.jdbc.Driver</driverClassName>
+ <maxActive><%= @max_active %></maxActive>
+ <maxWait><%= @max_wait %></maxWait>
+ <minIdle>5</minIdle>
+ <testOnBorrow>true</testOnBorrow>
+ <validationQuery>SELECT 1</validationQuery>
+ <validationInterval>30000</validationInterval>
+ </configuration>
+ </definition>
+ </datasource>
+
+<!-- CONFIG DBS -->
+
+ <datasource>
+ <name>WSO2_APPSERVER_CONFIG_DB</name>
+ <description>The datasource used for APPSERVER_CONFIG MySQL database</description>
+ <jndiConfig>
+ <name>jdbc/<%= @config_db -%></name>
+ </jndiConfig>
+ <definition type="RDBMS">
+ <configuration>
+ <url>jdbc:mysql://<%= @mysql_server %>:<%= @mysql_port %>/<%= @config_db %>?autoReconnect=true</url>
+ <username><%= @registry_user %></username>
+ <password><%= @registry_password %></password>
+ <driverClassName>com.mysql.jdbc.Driver</driverClassName>
+ <maxActive><%= @max_active %></maxActive>
+ <maxWait><%= @max_wait %></maxWait>
+ <minIdle>5</minIdle>
+ <testOnBorrow>true</testOnBorrow>
+ <validationQuery>SELECT 1</validationQuery>
+ <validationInterval>30000</validationInterval>
+ </configuration>
+ </definition>
+ </datasource>
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/conf/log4j.properties.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/conf/log4j.properties.erb b/tools/puppet3/modules/appserver/templates/conf/log4j.properties.erb
new file mode 100644
index 0000000..a5192d0
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/conf/log4j.properties.erb
@@ -0,0 +1,175 @@
+#
+# Copyright 2009 WSO2, Inc. (http://wso2.com)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#
+# This is the log4j configuration file used by WSO2 Carbon
+#
+# IMPORTANT : Please do not remove or change the names of any
+# of the Appenders defined here. The layout pattern & log file
+# can be changed using the WSO2 Carbon Management Console, and those
+# settings will override the settings in this file.
+#
+
+<%- if @enable_log_publisher == 'true' -%>
+log4j.rootLogger=INFO, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY, LOGEVENT
+<% else %>
+log4j.rootLogger=INFO, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY
+<%- end -%>
+
+log4j.logger.AUDIT_LOG=INFO, AUDIT_LOGFILE
+log4j.logger.org.apache.axis2.wsdl.codegen.writer.PrettyPrinter=ERROR, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.axis2.clustering=INFO, CARBON_CONSOLE, CARBON_LOGFILE
+log4j.logger.org.apache=INFO, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.catalina=WARN
+log4j.logger.org.apache.tomcat=WARN
+log4j.logger.org.wso2.carbon.apacheds=WARN
+log4j.logger.org.apache.directory.server.ldap=WARN
+log4j.logger.org.apache.directory.server.core.event=WARN
+log4j.logger.com.atomikos=INFO,ATOMIKOS
+log4j.logger.org.quartz=WARN
+log4j.logger.org.apache.jackrabbit.webdav=WARN
+log4j.logger.org.apache.juddi=ERROR
+log4j.logger.org.apache.commons.digester.Digester=WARN
+log4j.logger.org.apache.jasper.compiler.TldLocationsCache=WARN
+log4j.logger.org.apache.qpid=WARN
+log4j.logger.org.apache.qpid.server.Main=INFO
+log4j.logger.qpid.message=WARN
+log4j.logger.qpid.message.broker.listening=INFO
+log4j.logger.org.apache.tiles=WARN
+log4j.logger.org.apache.commons.httpclient=ERROR
+log4j.logger.org.apache.coyote=WARN
+log4j.logger.org.apache.solr=ERROR
+log4j.logger.org.infinispan=WARN
+log4j.logger.org.jgroups=ERROR
+log4j.logger.me.prettyprint.cassandra.hector.TimingLogger=ERROR
+log4j.logger.org.wso2=INFO
+log4j.logger.org.apache.axis2.enterprise=FATAL, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.opensaml.xml=WARN, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.directory.shared.ldap=WARN, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.directory.server.ldap.handlers=WARN, CARBON_LOGFILE, CARBON_MEMORY
+#Following are to remove false error messages from startup (IS)
+log4j.logger.org.apache.directory.shared.ldap.entry.DefaultServerAttribute=FATAL, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.directory.server.core.DefaultDirectoryService=ERROR, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.directory.shared.ldap.ldif.LdifReader=ERROR, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.directory.server.ldap.LdapProtocolHandler=ERROR, CARBON_LOGFILE, CARBON_MEMORY
+log4j.logger.org.apache.directory.server.core=ERROR, CARBON_LOGFILE, CARBON_MEMORY
+#Hive Related Log configurations
+log4j.logger.DataNucleus=ERROR
+log4j.logger.Datastore=ERROR
+log4j.logger.Datastore.Schema=ERROR
+log4j.logger.JPOX.Datastore=ERROR
+log4j.logger.JPOX.Plugin=ERROR
+log4j.logger.JPOX.MetaData=ERROR
+log4j.logger.JPOX.Query=ERROR
+log4j.logger.JPOX.General=ERROR
+log4j.logger.JPOX.Enhancer=ERROR
+log4j.logger.org.apache.hadoop.hive=WARN
+log4j.logger.hive=WARN
+log4j.logger.ExecMapper=WARN
+log4j.logger.ExecReducer=WARN
+log4j.logger.net.sf.ehcache.config.ConfigurationFactory=ERROR
+
+log4j.logger.trace.messages=TRACE,CARBON_TRACE_LOGFILE
+
+log4j.additivity.org.apache.axis2.clustering=false
+log4j.additivity.com.atomikos=false
+log4j.additivity.org.apache=false
+
+# CARBON_CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CARBON_CONSOLE=org.wso2.carbon.logging.appenders.CarbonConsoleAppender
+log4j.appender.CARBON_CONSOLE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
+# ConversionPattern will be overridden by the configuration setting in the DB
+log4j.appender.CARBON_CONSOLE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m%n
+log4j.appender.CARBON_CONSOLE.layout.TenantPattern=%U%@%D[%T]
+log4j.appender.CARBON_CONSOLE.threshold=DEBUG
+
+# The memory appender for logging
+log4j.appender.CARBON_MEMORY=org.wso2.carbon.logging.appender.CarbonMemoryAppender
+log4j.appender.CARBON_MEMORY.bufferSize=2000
+log4j.appender.CARBON_MEMORY.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
+# ConversionPattern will be overridden by the configuration setting in the DB
+log4j.appender.CARBON_MEMORY.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n
+log4j.appender.CARBON_MEMORY.layout.TenantPattern=%U%@%D [%T] [%S]
+log4j.appender.CARBON_MEMORY.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace
+log4j.appender.CARBON_MEMORY.threshold=DEBUG
+
+# CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout.
+log4j.appender.CARBON_LOGFILE=org.wso2.carbon.logging.appenders.CarbonDailyRollingFileAppender
+# Log file will be overridden by the configuration setting in the DB
+# This path should be relative to WSO2 Carbon Home
+log4j.appender.CARBON_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon${instance.log}.log
+log4j.appender.CARBON_LOGFILE.Append=true
+log4j.appender.CARBON_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
+# ConversionPattern will be overridden by the configuration setting in the DB
+log4j.appender.CARBON_LOGFILE.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n
+log4j.appender.CARBON_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S]
+log4j.appender.CARBON_LOGFILE.threshold=DEBUG
+
+log4j.appender.CARBON_SYS_LOG = org.apache.log4j.net.SyslogAppender
+log4j.appender.CARBON_SYS_LOG.layout=org.apache.log4j.PatternLayout
+log4j.appender.CARBON_SYS_LOG.layout.ConversionPattern=[%d] %5p {%c} - %x %m {%c}%n
+log4j.appender.CARBON_SYS_LOG.SyslogHost=localhost
+log4j.appender.CARBON_SYS_LOG.Facility=USER
+log4j.appender.CARBON_SYS_LOG.threshold=DEBUG
+
+<%- if @enable_log_publisher == 'true' -%>
+
+# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT
+log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender
+log4j.appender.LOGEVENT.url=tcp://<%= @bam_ip %>:<%= @bam_port %>
+log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
+log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%I,%Stacktrace
+log4j.appender.LOGEVENT.userName=admin
+log4j.appender.LOGEVENT.password=admin
+log4j.appender.LOGEVENT.processingLimit=1000
+log4j.appender.LOGEVENT.maxTolerableConsecutiveFailure=20
+
+<%- end -%>
+
+# Appender config to CARBON_TRACE_LOGFILE
+log4j.appender.CARBON_TRACE_LOGFILE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.CARBON_TRACE_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon-trace-messages${instance.log}.log
+log4j.appender.CARBON_TRACE_LOGFILE.Append=true
+log4j.appender.CARBON_TRACE_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
+log4j.appender.CARBON_TRACE_LOGFILE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m {%c}%n
+log4j.appender.CARBON_TRACE_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S]
+log4j.appender.CARBON_TRACE_LOGFILE.threshold=TRACE
+log4j.additivity.trace.messages=false
+
+# Appender config to AUDIT_LOGFILE
+log4j.appender.AUDIT_LOGFILE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.AUDIT_LOGFILE.File=${carbon.home}/repository/logs/audit.log
+log4j.appender.AUDIT_LOGFILE.Append=true
+log4j.appender.AUDIT_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
+log4j.appender.AUDIT_LOGFILE.layout.ConversionPattern=[%d] %P%5p - %x %m %n
+log4j.appender.AUDIT_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S]
+log4j.appender.AUDIT_LOGFILE.threshold=INFO
+log4j.additivity.AUDIT_LOG=false
+
+# Appender config to send Atomikos transaction logs to new log file tm.out.
+log4j.appender.ATOMIKOS = org.apache.log4j.RollingFileAppender
+log4j.appender.ATOMIKOS.File = repository/logs/tm.out
+log4j.appender.ATOMIKOS.Append = true
+log4j.appender.ATOMIKOS.layout = org.apache.log4j.PatternLayout
+log4j.appender.ATOMIKOS.layout.ConversionPattern=%p %t %c - %m%n
+
+# This file is used to override the default logger settings, and is used to remove unwanted logs from Shindig appearing on the console.
+
+# Specification of Handler used by Console Logger
+handlers=java.util.logging.ConsoleHandler
+
+# Replacing default INFO level with SEVERE
+java.util.logging.ConsoleHandler.level=SEVERE
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/conf/registry.xml.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/conf/registry.xml.erb b/tools/puppet3/modules/appserver/templates/conf/registry.xml.erb
new file mode 100644
index 0000000..395d43a
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/conf/registry.xml.erb
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ Copyright 2005-2011 WSO2, Inc. (http://wso2.com)
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<wso2registry>
+
+ <!--
+ For details on configuring different config & governance registries see;
+ http://wso2.org/library/tutorials/2010/04/sharing-registry-space-across-multiple-product-instances
+ -->
+
+ <currentDBConfig>wso2registry</currentDBConfig>
+ <readOnly>false</readOnly>
+ <enableCache>true</enableCache>
+ <registryRoot>/</registryRoot>
+
+ <dbConfig name="wso2registry">
+ <dataSource>jdbc/WSO2CarbonDB</dataSource>
+ </dbConfig>
+
+ <%- if @cloud == true or @clustering == true -%>
+ <%= scope.function_template(['appserver/conf/registry/_remote.erb']) -%>
+ <%- end -%>
+
+ <!--<handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
+ <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/vnd.apache.synapse</property>
+ </filter>
+ </handler>
+
+ <handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
+ <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/vnd.apache.esb</property>
+ </filter>
+ </handler>
+
+ <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
+ <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/vnd.apache.axis2</property>
+ </filter>
+ </handler>
+
+ <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
+ <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/vnd.apache.wsas</property>
+ </filter>
+ </handler>
+
+ <handler class="org.wso2.carbon.registry.extensions.handlers.WSDLMediaTypeHandler">
+ <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/wsdl+xml</property>
+ </filter>
+ </handler>
+
+ <handler class="org.wso2.carbon.registry.extensions.handlers.XSDMediaTypeHandler">
+ <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/x-xsd+xml</property>
+ </filter>
+ </handler> -->
+
+ <!--remoteInstance url="https://localhost:9443/registry">
+ <id>instanceid</id>
+ <username>username</username>
+ <password>password</password>
+ </remoteInstance-->
+
+ <!--remoteInstance url="https://localhost:9443/registry">
+ <id>instanceid</id>
+ <dbConfig>wso2registry</dbConfig>
+ <readOnly>false</readOnly>
+ <enableCache>true</enableCache>
+ <registryRoot>/</registryRoot>
+ </remoteInstance-->
+
+ <!--mount path="/_system/config" overwrite="true|false|virtual">
+ <instanceId>instanceid</instanceId>
+ <targetPath>/_system/nodes</targetPath>
+ </mount-->
+
+
+ <versionResourcesOnChange>true</versionResourcesOnChange>
+
+ <!-- NOTE: You can edit the options under "StaticConfiguration" only before the
+ startup. -->
+ <staticConfiguration>
+ <versioningProperties>true</versioningProperties>
+ <versioningComments>true</versioningComments>
+ <versioningTags>true</versioningTags>
+ <versioningRatings>true</versioningRatings>
+ </staticConfiguration>
+</wso2registry>
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/conf/registry/_remote.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/conf/registry/_remote.erb b/tools/puppet3/modules/appserver/templates/conf/registry/_remote.erb
new file mode 100644
index 0000000..582b0f9
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/conf/registry/_remote.erb
@@ -0,0 +1,35 @@
+ <dbConfig name="governance">
+ <dataSource>jdbc/<%= @registry_database %></dataSource>
+ </dbConfig>
+
+ <remoteInstance url="<%= @greg_url %>">
+ <id>governance</id>
+ <dbConfig>governance</dbConfig>
+ <readOnly>false</readOnly>
+ <registryRoot>/</registryRoot>
+ <enableCache>true</enableCache>
+ <cacheId><%= @registry_user %>@jdbc:mysql://<%= @mysql_server %>:<%= @mysql_port %>/<%= @registry_database %></cacheId>
+ </remoteInstance>
+
+ <mount path="/_system/governance" overwrite="true">
+ <instanceId>governance</instanceId>
+ <targetPath>/_system/governance</targetPath>
+ </mount>
+
+ <dbConfig name="config">
+ <dataSource>jdbc/<%= @config_db %></dataSource>
+ </dbConfig>
+
+ <remoteInstance url="<%= @greg_url %>">
+ <id>config</id>
+ <dbConfig>config</dbConfig>
+ <readOnly>false</readOnly>
+ <registryRoot>/</registryRoot>
+ <enableCache>true</enableCache>
+ <cacheId><%= @registry_user %>@jdbc:mysql://<%= @mysql_server %>:<%= @mysql_port %>/<%= @config_db %></cacheId>
+ </remoteInstance>
+
+ <mount path="/_system/config" overwrite="true">
+ <instanceId>config</instanceId>
+ <targetPath>/_system/<%= @config_target_path %></targetPath>
+ </mount>
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/conf/security/authenticators.xml.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/conf/security/authenticators.xml.erb b/tools/puppet3/modules/appserver/templates/conf/security/authenticators.xml.erb
new file mode 100644
index 0000000..8e691d0
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/conf/security/authenticators.xml.erb
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ Copyright 2005-2011 WSO2, Inc. (http://wso2.com)
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<!--
+ This is the configuration file for Carbon authenticators. All the authenticator related configurations
+ should go here.
+-->
+<Authenticators xmlns="http://wso2.org/projects/carbon/authenticators.xml">
+
+ <!-- Authenticator Configurations for TokenUIAuthenticator -->
+ <Authenticator name="TokenUIAuthenticator" disabled="true">
+ <Priority>5</Priority>
+ </Authenticator>
+
+ <!-- Authenticator Configurations for SAML2SSOAuthenticator -->
+ <Authenticator name="SAML2SSOAuthenticator" disabled="SSO_DISABLED">
+ <Priority>10</Priority>
+ <Config>
+ <Parameter name="LoginPage">/carbon/admin/login.jsp</Parameter>
+ <Parameter name="ServiceProviderID">ApplicationServer</Parameter>
+ <Parameter name="IdentityProviderSSOServiceURL">https://IDP_URL:9445/samlsso</Parameter>
+ <Parameter name="NameIDPolicyFormat">urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</Parameter>
+ </Config>
+
+ <!-- If this authenticator should skip any URI from authentication, specify it under "SkipAuthentication"
+ <SkipAuthentication>
+ <UrlContains></UrlContains>
+ </SkipAuthentication> -->
+
+ <!-- If this authenticator should skip any URI from session validation, specify it under "SkipAuthentication
+ <SkipSessionValidation>
+ <UrlContains></UrlContains>
+ </SkipSessionValidation> -->
+ </Authenticator>
+
+</Authenticators>
+
[07/12] Add initial Kubernetes model
Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java
index f8c9f2f..fe46d25 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java
@@ -23,6 +23,9 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.stratos.common.beans.TenantInfoBean;
import org.apache.stratos.common.exception.StratosException;
+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.common.util.ClaimsMgtUtil;
import org.apache.stratos.common.util.CommonUtil;
import org.apache.stratos.manager.dto.Cartridge;
@@ -43,10 +46,12 @@ import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.Autosca
import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy;
import org.apache.stratos.rest.endpoint.bean.cartridge.definition.CartridgeDefinitionBean;
import org.apache.stratos.rest.endpoint.bean.cartridge.definition.ServiceDefinitionBean;
+
import org.apache.stratos.rest.endpoint.bean.repositoryNotificationInfoBean.Payload;
import org.apache.stratos.rest.endpoint.bean.repositoryNotificationInfoBean.Repository;
import org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean;
import org.apache.stratos.rest.endpoint.bean.topology.Cluster;
+import org.apache.stratos.rest.endpoint.exception.KubernetesGroupDoesNotExistException;
import org.apache.stratos.rest.endpoint.exception.RestAPIException;
import org.apache.stratos.rest.endpoint.exception.TenantNotFoundException;
import org.apache.stratos.tenant.mgt.core.TenantPersistor;
@@ -162,6 +167,84 @@ public class StratosAdmin extends AbstractAdmin {
}
@POST
+ @Path("/kubernetes/deploy/group")
+ @Produces("application/json")
+ @Consumes("application/json")
+ @AuthorizationAction("/permission/protected/manage/monitor/tenants")
+ @SuperTenantService(true)
+ public Response deployKubernetesGroup (KubernetesGroup kubernetesGroup)
+ throws RestAPIException {
+
+ ServiceUtils.deployKubernetesGroup(kubernetesGroup);
+ URI url = uriInfo.getAbsolutePathBuilder().path(kubernetesGroup.getGroupId()).build();
+ return Response.created(url).build();
+ }
+
+ @POST
+ @Path("/kubernetes/deploy/host/{kubernetesGroupId}")
+ @Produces("application/json")
+ @Consumes("application/json")
+ @AuthorizationAction("/permission/protected/manage/monitor/tenants")
+ @SuperTenantService(true)
+ public Response deployKubernetesHost (@PathParam("kubernetesGroupId") String kubernetesGroupId, KubernetesHost kubernetesHost)
+ throws RestAPIException {
+
+ ServiceUtils.deployKubernetesHost(kubernetesGroupId, kubernetesHost);
+ URI url = uriInfo.getAbsolutePathBuilder().path(kubernetesHost.getHostId()).build();
+ return Response.created(url).build();
+ }
+
+ @PUT
+ @Path("/kubernetes/update/master")
+ @Produces("application/json")
+ @Consumes("application/json")
+ @AuthorizationAction("/permission/protected/manage/monitor/tenants")
+ @SuperTenantService(true)
+ public Response updateKubernetesMaster (KubernetesMaster kubernetesMaster)
+ throws RestAPIException {
+
+ ServiceUtils.updateKubernetesMaster(kubernetesMaster);
+ URI url = uriInfo.getAbsolutePathBuilder().path(kubernetesMaster.getHostId()).build();
+ return Response.created(url).build();
+ }
+
+ @GET
+ @Path("/kubernetes/group")
+ @Produces("application/json")
+ @Consumes("application/json")
+ @AuthorizationAction("/permission/protected/manage/monitor/tenants")
+ public Response getKubernetesGroups () throws RestAPIException {
+ return Response.ok().entity(ServiceUtils.getAvailableKubernetesGroups()).build();
+ }
+
+
+ @GET
+ @Path("/kubernetes/group/{kubernetesGroupId}")
+ @Produces("application/json")
+ @Consumes("application/json")
+ @AuthorizationAction("/permission/protected/manage/monitor/tenants")
+ public Response getKubernetesGroup (@PathParam("kubernetesGroupId") String kubernetesGroupId) throws RestAPIException {
+ return Response.ok().entity(ServiceUtils.getKubernetesGroup(kubernetesGroupId)).build();
+ }
+
+
+ @DELETE
+ @Path("/kubernetes/group/{kubernetesGroupId}")
+ @Produces("application/json")
+ @Consumes("application/json")
+ @AuthorizationAction("/permission/protected/manage/monitor/tenants")
+ @SuperTenantService(true)
+ public Response unDeployKubernetesGroup (@PathParam("kubernetesGroupId") String kubernetesGroupId) throws RestAPIException {
+ try {
+ ServiceUtils.undeployKubernetesGroup(kubernetesGroupId);
+ } catch (KubernetesGroupDoesNotExistException e) {
+ return Response.status(Response.Status.NOT_FOUND).build();
+ }
+ return Response.noContent().build();
+ }
+
+
+ @POST
@Path("/policy/autoscale")
@Produces("application/json")
@Consumes("application/json")
http://git-wip-us.apache.org/repos/asf/stratos/blob/c3cd37e5/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 b3fcb6b..13e26de 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
@@ -482,6 +482,14 @@
<wsdl:message name="addPartitionResponse">
<wsdl:part name="parameters" element="ns:addPartitionResponse"/>
</wsdl:message>
+
+ <wsdl:message name="addKubernetesRequest">
+ <wsdl:part name="parameters" element="ns:addPartition"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="addPartitionResponse">
+ <wsdl:part name="parameters" element="ns:addPartitionResponse"></wsdl:part>
+ </wsdl:message>
+
<wsdl:message name="AutoScalerServiceInvalidPartitionException">
<wsdl:part name="parameters" element="ns:AutoScalerServiceInvalidPartitionException"/>
</wsdl:message>
[04/12] re-organizing puppet modules
Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/artifacts-copy.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/artifacts-copy.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/artifacts-copy.sh.erb
new file mode 100644
index 0000000..5cad830
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/artifacts-copy.sh.erb
@@ -0,0 +1,29 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed once the update artifacts
+# event is received and they are copied to the given path.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+cp -rf $1* $2
+echo "Artifacts Copied" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/artifacts-updated.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/artifacts-updated.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/artifacts-updated.sh.erb
new file mode 100755
index 0000000..15d5591
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/artifacts-updated.sh.erb
@@ -0,0 +1,28 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed once the update artifacts
+# event is received and they are copied to the given path.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo `date`": Artifacts Updated Event" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/clean.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/clean.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/clean.sh.erb
new file mode 100755
index 0000000..c62ad35
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/clean.sh.erb
@@ -0,0 +1,28 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed when stratos manager requests
+# to clean up the instance before terminating it.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo `date`": Cleaning the cartridge" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/complete-tenant.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/complete-tenant.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/complete-tenant.sh.erb
new file mode 100644
index 0000000..2586474
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/complete-tenant.sh.erb
@@ -0,0 +1,30 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed when complete tenant
+# event is received.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo `date`": Complete Tenant Event: " | tee -a $log
+echo "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
+echo "Tenant List: ${STRATOS_TENANT_LIST_JSON}" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/complete-topology.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/complete-topology.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/complete-topology.sh.erb
new file mode 100644
index 0000000..ea2e941
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/complete-topology.sh.erb
@@ -0,0 +1,34 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed when complete topology
+# event is received.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo `date`": Complete Topology Event: " | tee -a $log
+echo "LB IP: ${STRATOS_LB_IP}" | tee -a $log
+echo "LB PUBLIC IP: $STRATOS_LB_PUBLIC_IP}" | tee -a $log
+echo "STRATOS_PARAM_FILE_PATH: ${STRATOS_PARAM_FILE_PATH}"
+echo "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
+echo "Complete Topology: ${STRATOS_TOPOLOGY_JSON}" | tee -a $log
+echo "Members in LB: ${STRATOS_MEMBERS_IN_LB_JSON}" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/instance-activated.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/instance-activated.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/instance-activated.sh.erb
new file mode 100755
index 0000000..f5d60e8
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/instance-activated.sh.erb
@@ -0,0 +1,28 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed once the instance is
+# activated and ready to serve incoming requests.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo `date`": Instance activated" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/instance-started.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/instance-started.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/instance-started.sh.erb
new file mode 100755
index 0000000..7b5aa6a
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/instance-started.sh.erb
@@ -0,0 +1,27 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed once the instance is started.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo `date`": Instance Started Event: " | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/member-activated.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/member-activated.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/member-activated.sh.erb
new file mode 100644
index 0000000..f01d028
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/member-activated.sh.erb
@@ -0,0 +1,303 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed when member activated
+# event is received.
+# --------------------------------------------------------------
+#
+
+# Execute error_handler function on script error
+trap 'error_handler ${LINENO} $?' ERR
+
+log=/var/log/apache-stratos/cartridge-agent-extensions-member.activated.log
+VERBOSE=1
+DATE=`which date` || print_error "date command not found"
+ECHO=`which echo` || print_error "echo command not found"
+GREP=`which grep` || print_error "grep command not found"
+PS=`which ps` || print_error "ps command not found"
+SED=`which sed` || print_error "sed command not found"
+
+function printParameters(){
+ ${ECHO} -e "LB IP: ${STRATOS_LB_IP}" | tee -a $log
+ ${ECHO} -e "LB PUBLIC IP: ${STRATOS_LB_PUBLIC_IP}" | tee -a $log
+ ${ECHO} -e "STRATOS_PARAM_FILE_PATH: ${STRATOS_PARAM_FILE_PATH}"
+ ${ECHO} -e "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
+ ${ECHO} -e "Complete Topology: ${STRATOS_TOPOLOGY_JSON}" | tee -a $log
+ ${ECHO} -e "Members in LB: ${STRATOS_MEMBERS_IN_LB_JSON}" | tee -a $log
+ ${ECHO} -e "APP_PATH: ${STRATOS_APP_PATH}" | tee -a $log
+}
+
+function error_handler(){
+ MYSELF="$0" # equals to script name
+ LASTLINE="$1" # argument 1: last line of error occurence
+ LASTERR="$2" # argument 2: error code of last command
+ echo "ERROR in ${MYSELF}: line ${LASTLINE}: exit status of last command: ${LASTERR}"
+ exit 1
+}
+
+function print_message(){
+ if [ ${VERBOSE} -eq 1 ]; then
+ ${ECHO} -e "[INFO] " $1 | tee -a $log
+ fi
+}
+
+function print_error(){
+ ${ECHO} -e "[Error] " $1 | tee -a $log
+ exit 1
+}
+
+function verify_file_exists(){
+ if [[ ! -f $1 ]] ; then
+ print_error "File not found: $1"
+ fi
+}
+
+function update_hosts_file(){
+ instance_hostname="<%= @stratos_instance_data_host_name %>"
+ (${GREP} -q "${instance_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${instance_hostname} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${instance_hostname}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+
+ map_to_lb="<%= @stratos_instance_data_map_to_lb %>"
+ arr=$(${ECHO} ${map_to_lb} | tr "," "\n")
+
+ for map_hostname in $arr
+ do
+ (${GREP} -q "${map_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${map_hostname} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${map_hostname}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+ done
+
+ <%- if @stratos_instance_data_worker_host_name -%>
+ worker_hostname="<%= @stratos_instance_data_worker_host_name %>"
+ (${GREP} -q " ${worker_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${worker_hostname} # Stratos LB worker private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${worker_hostname}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+ <%- end -%>
+
+ if [[ "${STRATOS_SERVICE_NAME}" = "apistore" || "${STRATOS_SERVICE_NAME}" = "publisher" ]] ; then
+ gateway_host_name="<%= @stratos_instance_data_gateway_host_name %>"
+ gateway_mgt_host_name="<%= @stratos_instance_data_gateway_mgt_host_name %>"
+ keymanager_host_name="<%= @stratos_instance_data_keymanager_host_name %>"
+
+ (${GREP} -q "${gateway_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${gateway_host_name} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${gateway_host_name}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+
+ (${GREP} -q "${gateway_mgt_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${gateway_mgt_host_name} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${gateway_mgt_host_name}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+
+
+ (${GREP} -q "${keymanager_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${keymanager_host_name} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${keymanager_host_name}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+
+ elif [[ "${STRATOS_SERVICE_NAME}" = "gateway" || "${STRATOS_SERVICE_NAME}" = "gatewaymgt" ]] ; then
+ keymanager_hostname="<%= @stratos_instance_data_keymanager_host_name %>"
+
+ (${GREP} -q "${keymanager_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${keymanager_hostname} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${keymanager_hostname}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+
+ fi
+}
+
+function backup_file(){
+ if [[ -f "$1.orig" ]];
+ then
+ print_message "Restoring from the Original template file $1"
+ cp -f "$1.orig" "$1"
+ else
+ print_message "Creating a backup of the file $1"
+ cp -f "$1" "$1.orig"
+ fi
+}
+
+function configure_manager_worker_wka_members(){
+
+ print_message "function configure_manager_worker_wka_members ..... "
+
+ # generic worker manager seperation :D
+ if [[ -z ${STRATOS_WK_MANAGER_MEMBER_COUNT} || ${STRATOS_WK_MANAGER_MEMBER_COUNT} -eq 0 ]] ; then
+ print_message "manager WKA member count is zero or unavailable"
+ else
+ print_message "Configuring manager..."
+ print_message "configure_manager_worker_wka_members STRATOS_WK_MANAGER_MEMBER_COUNT ${STRATOS_WK_MANAGER_MEMBER_COUNT} ..... "
+ for i in `seq 0 $(( ${STRATOS_WK_MANAGER_MEMBER_COUNT} - 1 ))`
+ do
+ member_ip_name="STRATOS_WK_MANAGER_MEMBER_${i}_IP"
+ member_ip=${member_ip_name}
+ if [[ -z ${member_ip} ]] ; then
+ print_error "WKA is null for STRATOS_WK_MANAGER_MEMBER_${i}_IP"
+ fi
+ print_message "$i => ${member_ip}"
+ WKA_XML=$"${WKA_XML}<member><hostName>${!member_ip}</hostName><port>4000</port></member>\n"
+ done
+ fi
+
+ if [[ -z ${STRATOS_WK_WORKER_MEMBER_COUNT} || ${STRATOS_WK_WORKER_MEMBER_COUNT} -eq 0 ]] ; then
+ print_message "worker WKA member count is zero or unavailable"
+ else
+ print_message "Configuring worker..."
+ print_message "STRATOS_WK_WORKER_MEMBER_COUNT ${STRATOS_WK_WORKER_MEMBER_COUNT} ..... "
+ for i in `seq 0 $(( ${STRATOS_WK_WORKER_MEMBER_COUNT} - 1 ))`
+ do
+ member_ip_name="STRATOS_WK_WORKER_MEMBER_${i}_IP"
+ member_ip=${member_ip_name}
+ if [[ -z ${member_ip} ]] ; then
+ print_error "WKA is null for STRATOS_WK_WORKER_MEMBER_${i}_IP"
+ fi
+ print_message "$i => ${member_ip}"
+ WKA_XML=$"${WKA_XML}<member><hostName>${!member_ip}</hostName><port>4000</port></member>\n"
+ done
+ fi
+
+ print_message "${STRATOS_SERVICE_NAME} WKA_XML => ${WKA_XML}"
+ verify_file_exists ${AXIS2_XML_FILE}
+ ${SED} -i "s%${WKA_LINE}%${WKA_XML}%g" ${AXIS2_XML_FILE} && print_message "gateway WKA configuration successful" || print_error "Failed to configure well known members"
+
+}
+
+
+function configure_wk_members(){
+
+ print_message "Performing clustering configuration for ${STRATOS_SERVICE_NAME}..."
+
+ WKA_XML=""
+ KEYMGR_XML=""
+ WKA_LINE="@WELL_KNOWN_MEMBERS"
+ KEYMGR_LINE="@KEYMANAGER_SERVER_URL"
+
+ AXIS2_XML_FILE=${STRATOS_APP_PATH}/repository/conf/axis2/axis2.xml
+ backup_file ${AXIS2_XML_FILE}
+
+
+ if [[ (! -z $STRATOS_SERVICE_GROUP) && "${STRATOS_SERVICE_GROUP}" = "apim" ]] ; then
+ print_message " STRATOS_SERVICE_GROUP_APIM ${STRATOS_SERVICE_GROUP} ..... "
+ API_MANAGER_XML_FILE=${STRATOS_APP_PATH}/repository/conf/api-manager.xml
+ backup_file ${API_MANAGER_XML_FILE}
+
+ if [[ "${STRATOS_SERVICE_NAME}" = "apistore" || "${STRATOS_SERVICE_NAME}" = "publisher" ]] ; then
+
+ print_message "Configuring axis2.xml for ${STRATOS_SERVICE_NAME}..."
+ WKA_XML=$"${WKA_XML}<member><hostName>${STRATOS_WK_APISTORE_MEMBER_IP}</hostName><port>4000</port></member>\n"
+ WKA_XML=$"${WKA_XML}<member><hostName>${STRATOS_WK_PUBLISHER_MEMBER_IP}</hostName><port>4000</port></member>\n"
+ print_message "${STRATOS_SERVICE_NAME} WKA_XML => ${WKA_XML}"
+ verify_file_exists ${AXIS2_XML_FILE}
+ ${SED} -i "s%${WKA_LINE}%${WKA_XML}%g" ${AXIS2_XML_FILE} && print_message "${STRATOS_SERVICE_NAME} WKA configuration successful" || print_error "Failed to configure well known members"
+
+ elif [[ "${STRATOS_SERVICE_NAME}" = "keymanager" ]] ; then
+
+ print_message "In keymanager...nothing to do"
+
+ elif [[ "${STRATOS_SERVICE_NAME}" = "gateway" || "${STRATOS_SERVICE_NAME}" = "gatewaymgt" ]] ; then
+
+ if [[ "${DEPLOYMENT}" = "manager" || "${DEPLOYMENT}" = "worker" ]] ; then
+
+ configure_manager_worker_wka_members
+ fi
+
+ fi
+ elif [[ "${DEPLOYMENT}" = "manager" || "${DEPLOYMENT}" = "worker" ]] ; then
+ print_message " Worker / Manager ..... ${DEPLOYMENT} "
+ configure_manager_worker_wka_members
+ else
+ print_message "Configuring ${STRATOS_SERVICE_NAME}..."
+ print_message "STRATOS_WK_MEMBER_COUNT ....... ${STRATOS_WK_MEMBER_COUNT} "
+ for i in `seq 0 $(( ${STRATOS_WK_MEMBER_COUNT} - 1 ))`
+ do
+ member_ip="STRATOS_WK_MEMBER_${i}_IP"
+ print_message " memberip ${member_ip} ....... "
+ if [[ -z ${!member_ip} ]] ; then
+ print_error "WKA is null for STRATOS_WK_MEMBER_${i}_IP"
+ fi
+ print_message "$i => ${!member_ip}"
+ WKA_XML=$"${WKA_XML}<member><hostName>${!member_ip}</hostName><port>4000</port></member>\n"
+ done
+
+ print_message "${STRATOS_SERVICE_NAME} WKA_XML => ${WKA_XML}"
+ verify_file_exists ${AXIS2_XML_FILE}
+ ${SED} -i "s%${WKA_LINE}%${WKA_XML}%g" ${AXIS2_XML_FILE} && print_message "${STRATOS_SERVICE_NAME} WKA configuration successful" || print_error "Failed to configure well known members"
+ fi
+}
+
+function updateWKMembers() {
+ print_message "Update WKA Members...... "
+ # Check if APP_PATH exists
+ print_message "Stratos App path $STRATOS_APP_PATH ...... "
+ if [[ ! -d $STRATOS_APP_PATH ]] ; then
+ print_error "APP_PATH is not found at: ${STRATOS_APP_PATH}"
+ fi
+
+ # Set JAVA_HOME if it is not already set
+ if [[ -z $JAVA_HOME ]] ; then
+ print_message "Setting JAVA_HOME to /opt/java"
+ export JAVA_HOME=/opt/java
+ fi
+
+ print_message "Stopping wso2server.sh ...... "
+ # Kill Product server
+ $STRATOS_APP_PATH/bin/wso2server.sh stop > /dev/null 2>&1 &
+ sleep 10
+
+ # Check if clustering is enabled for this product
+ if [[ -z $STRATOS_CLUSTERING ]] ; then
+ ${ECHO} -e `date`": starting servers in stand-alone mode..." | tee -a $log
+ if [[ ${VERBOSE} -eq 1 ]]; then
+ printParameters
+ fi
+
+ else
+ ${ECHO} -e `date`": starting servers in clustering mode..." | tee -a $log
+ if [[ ${VERBOSE} -eq 1 ]] ; then
+ printParameters
+ fi
+ # Do the WKA configuration to support clustering
+ configure_wk_members
+ fi
+
+ #Backup hosts file
+ backup_file /etc/hosts
+ # Update the /etc/hosts file with LB instance IP
+ update_hosts_file
+
+ # Run start server command
+ verify_file_exists $STRATOS_APP_PATH/bin/wso2server.sh
+ $STRATOS_APP_PATH/bin/wso2server.sh $* > /dev/null 2>&1 &
+ print_message "Executed run command: $STRATOS_APP_PATH/bin/wso2server.sh $*"
+ print_message "WK Members successfully updated."
+}
+
+# -----------------------
+# Execution starts here
+# -----------------------
+
+ print_message " Executing member activated extension "
+ print_message " Stratos UpdateWK_IP [$STRATOS_UPDATE_WK_IP] "
+# Check if WK Update flag is set
+if [[ $STRATOS_UPDATE_WK_IP = "true" ]]; then
+ print_message " Conditions successful for [$STRATOS_UPDATE_WK_IP] . Executing updateWKMembers "
+ updateWKMembers
+fi
+
+${ECHO} -e `date`": member activated extension successfully completed."
+# END
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/member-started.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/member-started.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/member-started.sh.erb
new file mode 100644
index 0000000..29f45c3
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/member-started.sh.erb
@@ -0,0 +1,43 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed when member suspended
+# event is received.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+OUTPUT=`date`": Member Started Event: "
+OUTPUT="$OUTPUT MEMBER_ID: ${STRATOS_MEMBER_ID}, "
+OUTPUT="$OUTPUT MEMBER_IP: ${STRATOS_MEMBER_IP}, "
+OUTPUT="$OUTPUT CLUSTER_ID: ${STRATOS_CLUSTER_ID}, "
+OUTPUT="$OUTPUT LB_CLUSTER_ID: ${STRATOS_LB_CLUSTER_ID}, "
+OUTPUT="$OUTPUT NETWORK_PARTITION_ID: ${STRATOS_NETWORK_PARTITION_ID}, "
+OUTPUT="$OUTPUT SERVICE_NAME: ${STRATOS_SERVICE_NAME}, "
+OUTPUT="$OUTPUT PORTS: ${STRATOS_PORTS},"
+OUTPUT="$OUTPUT STRATOS_LB_IP: ${STRATOS_LB_IP},"
+OUTPUT="$OUTPUT STRATOS_LB_PUBLIC_IP: ${STRATOS_LB_PUBLIC_IP},"
+OUTPUT="$OUTPUT APP_PATH: ${APP_PATH},"
+OUTPUT="$OUTPUT STRATOS_PARAM_FILE_PATH: ${STRATOS_PARAM_FILE_PATH}"
+echo $OUTPUT | tee -a $log
+echo "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
+echo "Topology: ${STRATOS_TOPOLOGY_JSON}" | tee -a $log
+echo "---------------" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/member-suspended.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/member-suspended.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/member-suspended.sh.erb
new file mode 100644
index 0000000..866aa0d
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/member-suspended.sh.erb
@@ -0,0 +1,43 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed when member suspended
+# event is received.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+OUTPUT=`date`": Member Suspended Event: "
+OUTPUT="$OUTPUT MEMBER_ID: ${STRATOS_MEMBER_ID}, "
+OUTPUT="$OUTPUT MEMBER_IP: ${STRATOS_MEMBER_IP}, "
+OUTPUT="$OUTPUT CLUSTER_ID: ${STRATOS_CLUSTER_ID}, "
+OUTPUT="$OUTPUT LB_CLUSTER_ID: ${STRATOS_LB_CLUSTER_ID}, "
+OUTPUT="$OUTPUT NETWORK_PARTITION_ID: ${STRATOS_NETWORK_PARTITION_ID}, "
+OUTPUT="$OUTPUT SERVICE_NAME: ${STRATOS_SERVICE_NAME}, "
+OUTPUT="$OUTPUT PORTS: ${STRATOS_PORTS},"
+OUTPUT="$OUTPUT STRATOS_LB_IP: ${STRATOS_LB_IP},"
+OUTPUT="$OUTPUT STRATOS_LB_PUBLIC_IP: ${STRATOS_LB_PUBLIC_IP},"
+OUTPUT="$OUTPUT APP_PATH: ${APP_PATH},"
+OUTPUT="$OUTPUT STRATOS_PARAM_FILE_PATH: ${STRATOS_PARAM_FILE_PATH}"
+echo $OUTPUT | tee -a $log
+echo "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
+echo "Topology: ${STRATOS_TOPOLOGY_JSON}" | tee -a $log
+echo "---------------" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/member-terminated.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/member-terminated.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/member-terminated.sh.erb
new file mode 100644
index 0000000..89cedf6
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/member-terminated.sh.erb
@@ -0,0 +1,43 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed when member terminated
+# event is received.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+OUTPUT=`date`": Member Terminated Event: "
+OUTPUT="$OUTPUT MEMBER_ID: ${STRATOS_MEMBER_ID}, "
+OUTPUT="$OUTPUT MEMBER_IP: ${STRATOS_MEMBER_IP}, "
+OUTPUT="$OUTPUT CLUSTER_ID: ${STRATOS_CLUSTER_ID}, "
+OUTPUT="$OUTPUT LB_CLUSTER_ID: ${STRATOS_LB_CLUSTER_ID}, "
+OUTPUT="$OUTPUT NETWORK_PARTITION_ID: ${STRATOS_NETWORK_PARTITION_ID}, "
+OUTPUT="$OUTPUT SERVICE_NAME: ${STRATOS_SERVICE_NAME}, "
+OUTPUT="$OUTPUT PORTS: ${STRATOS_PORTS},"
+OUTPUT="$OUTPUT STRATOS_LB_IP: ${STRATOS_LB_IP},"
+OUTPUT="$OUTPUT STRATOS_LB_PUBLIC_IP: ${STRATOS_LB_PUBLIC_IP},"
+OUTPUT="$OUTPUT APP_PATH: ${APP_PATH},"
+OUTPUT="$OUTPUT STRATOS_PARAM_FILE_PATH: ${STRATOS_PARAM_FILE_PATH}"
+echo $OUTPUT | tee -a $log
+echo "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
+echo "Topology: ${STRATOS_TOPOLOGY_JSON}" | tee -a $log
+echo "---------------" | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/mount-volumes.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/mount-volumes.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/mount-volumes.sh.erb
new file mode 100755
index 0000000..2e649bd
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/mount-volumes.sh.erb
@@ -0,0 +1,87 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed to mount volumes
+# to the instance.
+# --------------------------------------------------------------
+#
+
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+echo -e "Starting mounting volumes" 2>&1 | tee -a $log
+
+# $1 is passed from Cartridge Agent code.
+echo -e "launh param file location $1" | tee -a $log
+#source /opt/apache-stratos-cartridge-agent/launch.params
+PERSISTENCE_MAPPING=$1
+echo -e "Persistance mappings : $PERSISTENCE_MAPPING" 2>&1 | tee -a $log
+
+mount_volume(){
+
+ device=$1;
+ mount_point=$2;
+ echo "device $device"
+ echo "point $mount_point"
+ # check if the volume has a file system
+ output=`sudo file -s $device`;
+ echo $output | tee -a $log
+
+ # this is the pattern of the output of file -s if the volume does not have a file system
+ # refer to http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html
+ pattern="$device: data"
+
+ if [[ $output == $pattern ]]
+ then
+ echo -e "Volume is not formatted. So formating the device $device \n" | tee -a $log
+ sudo mkfs -t ext4 $device
+ fi
+
+ echo "Mounting the device $device to the mount point $mount_point \n" | tee -a $log
+ device_mounted=$(mount | grep "$device")
+
+ if [ ! -d "$mount_point" ]
+ then
+ echo "creating the mount point directory $mount_point since it does not exist." | tee -a $log
+ sudo mkdir $mount_point
+ fi
+
+ #mounting the device if it is not already mounted
+ if [ ! "$device_mounted" = "" ]
+ then
+ echo -e "Device $device is already mounted." | tee -a $log
+ else
+ sudo mount $device $mount_point
+ fi
+
+}
+
+IFS='|' read -ra ADDR <<< "${PERSISTENCE_MAPPING}"
+echo "${ADDR[@]}" | tee -a $log
+
+for i in "${!ADDR[@]}"; do
+ # expected PERSISTANCE_MAPPING format is device1|mountPoint1|device2|mountpoint2...
+ # so that even indexes are devices and odd indexes are mount points..
+ if (( $i % 2 == 0 ))
+ then
+ mount_volume ${ADDR[$i]} ${ADDR[$i + 1]}
+ fi
+done
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/start-servers.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/start-servers.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/start-servers.sh.erb
new file mode 100755
index 0000000..6e34902
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/start-servers.sh.erb
@@ -0,0 +1,308 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed to start the servers.
+# --------------------------------------------------------------
+#
+
+# Execute error_handler function on script error
+trap 'error_handler ${LINENO} $?' ERR
+
+log=/var/log/apache-stratos/cartridge-agent-extensions-start.servers.log
+VERBOSE=1
+DATE=`which date` || print_error "date command not found"
+ECHO=`which echo` || print_error "echo command not found"
+GREP=`which grep` || print_error "grep command not found"
+PS=`which ps` || print_error "ps command not found"
+SED=`which sed` || print_error "sed command not found"
+
+function printParameters(){
+ ${ECHO} -e "LB IP: ${STRATOS_LB_IP}" | tee -a $log
+ ${ECHO} -e "LB PUBLIC IP: ${STRATOS_LB_PUBLIC_IP}" | tee -a $log
+ ${ECHO} -e "STRATOS_PARAM_FILE_PATH: ${STRATOS_PARAM_FILE_PATH}"
+ ${ECHO} -e "Member List: ${STRATOS_MEMBER_LIST_JSON}" | tee -a $log
+ ${ECHO} -e "Complete Topology: ${STRATOS_TOPOLOGY_JSON}" | tee -a $log
+ ${ECHO} -e "Members in LB: ${STRATOS_MEMBERS_IN_LB_JSON}" | tee -a $log
+ ${ECHO} -e "APP_PATH: ${STRATOS_APP_PATH}" | tee -a $log
+}
+
+function error_handler(){
+ MYSELF="$0" # equals to script name
+ LASTLINE="$1" # argument 1: last line of error occurence
+ LASTERR="$2" # argument 2: error code of last command
+ echo "ERROR in ${MYSELF}: line ${LASTLINE}: exit status of last command: ${LASTERR}"
+ exit 1
+}
+
+function print_message(){
+ if [ ${VERBOSE} -eq 1 ]; then
+ ${ECHO} -e "[INFO] " $1 | tee -a $log
+ fi
+}
+
+function print_error(){
+ ${ECHO} -e "[Error] " $1 | tee -a $log
+ exit 1
+}
+
+function verify_file_exists(){
+ if [[ ! -f $1 ]] ; then
+ print_error "File not found: $1"
+ fi
+}
+
+function update_hosts_file(){
+ instance_hostname="<%= @stratos_instance_data_host_name %>"
+ (${GREP} -q "${instance_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${instance_hostname} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${instance_hostname}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+
+ map_to_lb="<%= @stratos_instance_data_map_to_lb %>"
+ arr=$(${ECHO} ${map_to_lb} | tr "," "\n")
+
+ for map_hostname in $arr
+ do
+ (${GREP} -q "${map_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${map_hostname} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${map_hostname}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+ done
+
+ map_to_ip="<%= @stratos_instance_data_map_to_ip %>"
+ arr=$(${ECHO} ${map_to_ip} | tr "," "\n")
+
+ for mapping in $arr
+ do
+
+ arrr=$(${ECHO} ${mapping} | tr "#" "\n")
+ map_hostname=${arrr[1]}
+ ip_to_map=${arrr[0]}
+
+ (${GREP} -q "${map_hostname}" /etc/hosts || (${ECHO} "${ip_to_map} ${map_hostname} # Additional Mappings" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${ip_to_map} ${map_hostname}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+ done
+
+
+ <%- if @stratos_instance_data_worker_host_name -%>
+ worker_hostname="<%= @stratos_instance_data_worker_host_name %>"
+ (${GREP} -q " ${worker_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${worker_hostname} # Stratos LB worker private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${worker_hostname}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+ <%- end -%>
+
+ if [[ "${STRATOS_SERVICE_NAME}" = "apistore" || "${STRATOS_SERVICE_NAME}" = "publisher" ]] ; then
+ gateway_host_name="<%= @stratos_instance_data_gateway_host_name %>"
+ gateway_mgt_host_name="<%= @stratos_instance_data_gateway_mgt_host_name %>"
+ keymanager_host_name="<%= @stratos_instance_data_keymanager_host_name %>"
+
+ (${GREP} -q "${gateway_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${gateway_host_name} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${gateway_host_name}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+
+ (${GREP} -q "${gateway_mgt_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${gateway_mgt_host_name} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${gateway_mgt_host_name}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+
+
+ (${GREP} -q "${keymanager_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${keymanager_host_name} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${keymanager_host_name}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+
+ elif [[ "${STRATOS_SERVICE_NAME}" = "gateway" || "${STRATOS_SERVICE_NAME}" = "gatewaymgt" ]] ; then
+ keymanager_hostname="<%= @stratos_instance_data_keymanager_host_name %>"
+
+ (${GREP} -q "${keymanager_hostname}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${keymanager_hostname} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${keymanager_hostname}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+
+ elif [[ "${STRATOS_SERVICE_NAME}" = "keymanager" ]] ; then
+ gateway_host_name="<%= @stratos_instance_data_gateway_host_name %>"
+
+ (${GREP} -q "${gateway_host_name}" /etc/hosts || (${ECHO} "${STRATOS_LB_IP} ${gateway_host_name} # Stratos LB instance private IP" >> /etc/hosts \
+ && print_message "Updated /etc/hosts file with: ${STRATOS_LB_IP} ${gateway_host_name}")) \
+ || print_error "Failed to update '/etc/hosts' file. "
+
+
+ fi
+}
+
+function backup_file(){
+ if [[ -f "$1.orig" ]];
+ then
+ print_message "Restoring from the Original template file $1"
+ cp -f "$1.orig" "$1"
+ else
+ print_message "Creating a backup of the file $1"
+ cp -f "$1" "$1.orig"
+ fi
+}
+
+function configure_manager_worker_wka_members(){
+
+ # generic worker manager seperation :D
+ if [[ -z ${STRATOS_WK_MANAGER_MEMBER_COUNT} || ${STRATOS_WK_MANAGER_MEMBER_COUNT} -eq 0 ]] ; then
+ print_message "manager WKA member count is zero or unavailable"
+ else
+ print_message "Configuring manager..."
+ for i in `seq 0 $(( ${STRATOS_WK_MANAGER_MEMBER_COUNT} - 1 ))`
+ do
+ member_ip_name="STRATOS_WK_MANAGER_MEMBER_${i}_IP"
+ member_ip=${member_ip_name}
+ if [[ -z ${member_ip} ]] ; then
+ print_error "WKA is null for STRATOS_WK_MANAGER_MEMBER_${i}_IP"
+ fi
+ print_message "$i => ${member_ip}"
+ WKA_XML=$"${WKA_XML}<member><hostName>${!member_ip}</hostName><port>4000</port></member>\n"
+ done
+ fi
+
+ if [[ -z ${STRATOS_WK_WORKER_MEMBER_COUNT} || ${STRATOS_WK_WORKER_MEMBER_COUNT} -eq 0 ]] ; then
+ print_message "worker WKA member count is zero or unavailable"
+ else
+ print_message "Configuring worker..."
+ for i in `seq 0 $(( ${STRATOS_WK_WORKER_MEMBER_COUNT} - 1 ))`
+ do
+ member_ip_name="STRATOS_WK_WORKER_MEMBER_${i}_IP"
+ member_ip=${member_ip_name}
+ if [[ -z ${member_ip} ]] ; then
+ print_error "WKA is null for STRATOS_WK_WORKER_MEMBER_${i}_IP"
+ fi
+ print_message "$i => ${member_ip}"
+ WKA_XML=$"${WKA_XML}<member><hostName>${!member_ip}</hostName><port>4000</port></member>\n"
+ done
+ fi
+
+ print_message "${STRATOS_SERVICE_NAME} WKA_XML => ${WKA_XML}"
+ verify_file_exists ${AXIS2_XML_FILE}
+ ${SED} -i "s%${WKA_LINE}%${WKA_XML}%g" ${AXIS2_XML_FILE} && print_message "gateway WKA configuration successful" || print_error "Failed to configure well known members"
+
+}
+
+
+function configure_wk_members(){
+
+ print_message "Performing clustering configuration for ${STRATOS_SERVICE_NAME}..."
+
+ WKA_XML=""
+ KEYMGR_XML=""
+ WKA_LINE="@WELL_KNOWN_MEMBERS"
+ KEYMGR_LINE="@KEYMANAGER_SERVER_URL"
+
+ AXIS2_XML_FILE=${STRATOS_APP_PATH}/repository/conf/axis2/axis2.xml
+ backup_file ${AXIS2_XML_FILE}
+
+
+ if [[ (! -z $STRATOS_SERVICE_GROUP) && "${STRATOS_SERVICE_GROUP}" = "apim" ]] ; then
+ API_MANAGER_XML_FILE=${STRATOS_APP_PATH}/repository/conf/api-manager.xml
+ backup_file ${API_MANAGER_XML_FILE}
+
+ if [[ "${STRATOS_SERVICE_NAME}" = "apistore" || "${STRATOS_SERVICE_NAME}" = "publisher" ]] ; then
+
+ print_message "Configuring axis2.xml for ${STRATOS_SERVICE_NAME}..."
+ WKA_XML=$"${WKA_XML}<member><hostName>${STRATOS_WK_APISTORE_MEMBER_IP}</hostName><port>4000</port></member>\n"
+ WKA_XML=$"${WKA_XML}<member><hostName>${STRATOS_WK_PUBLISHER_MEMBER_IP}</hostName><port>4000</port></member>\n"
+ print_message "${STRATOS_SERVICE_NAME} WKA_XML => ${WKA_XML}"
+ verify_file_exists ${AXIS2_XML_FILE}
+ ${SED} -i "s%${WKA_LINE}%${WKA_XML}%g" ${AXIS2_XML_FILE} && print_message "${STRATOS_SERVICE_NAME} WKA configuration successful" || print_error "Failed to configure well known members"
+
+ elif [[ "${STRATOS_SERVICE_NAME}" = "keymanager" ]] ; then
+
+ print_message "In keymanager...nothing to do"
+
+ elif [[ "${STRATOS_SERVICE_NAME}" = "gateway" || "${STRATOS_SERVICE_NAME}" = "gatewaymgt" ]] ; then
+
+ if [[ "${DEPLOYMENT}" = "manager" || "${DEPLOYMENT}" = "worker" ]] ; then
+
+ configure_manager_worker_wka_members
+ fi
+
+ fi
+ elif [[ "${DEPLOYMENT}" = "manager" || "${DEPLOYMENT}" = "worker" ]] ; then
+
+ configure_manager_worker_wka_members
+ else
+ print_message "Configuring ${STRATOS_SERVICE_NAME}..."
+ for i in `seq 0 $(( ${STRATOS_WK_MEMBER_COUNT} - 1 ))`
+ do
+ member_ip="STRATOS_WK_MEMBER_${i}_IP"
+ if [[ -z ${!member_ip} ]] ; then
+ print_error "WKA is null for STRATOS_WK_MEMBER_${i}_IP"
+ fi
+ print_message "$i => ${!member_ip}"
+ WKA_XML=$"${WKA_XML}<member><hostName>${!member_ip}</hostName><port>4000</port></member>\n"
+ done
+
+ print_message "${STRATOS_SERVICE_NAME} WKA_XML => ${WKA_XML}"
+ verify_file_exists ${AXIS2_XML_FILE}
+ ${SED} -i "s%${WKA_LINE}%${WKA_XML}%g" ${AXIS2_XML_FILE} && print_message "${STRATOS_SERVICE_NAME} WKA configuration successful" || print_error "Failed to configure well known members"
+ fi
+}
+
+# Check if APP_PATH exists
+if [[ ! -d $STRATOS_APP_PATH ]] ; then
+ print_error "APP_PATH is not found at: ${STRATOS_APP_PATH}"
+fi
+
+# Check if product server is already running
+if [[ -f $STRATOS_APP_PATH/wso2carbon.pid ]] ; then
+ PID=`cat $STRATOS_APP_PATH/wso2carbon.pid`
+ if ${PS} -p $PID > /dev/null ; then
+ ${ECHO} -e `date`": process is already running...skipping start servers"
+ exit 0
+ fi
+fi
+
+# Set JAVA_HOME if it is not already set
+if [[ -z $JAVA_HOME ]] ; then
+ print_message "Setting JAVA_HOME to /opt/java"
+ export JAVA_HOME=/opt/java
+fi
+
+# Check if clustering is enabled for this product
+if [[ -z $STRATOS_CLUSTERING ]] ; then
+ ${ECHO} -e `date`": starting servers in stand-alone mode..." | tee -a $log
+ if [[ ${VERBOSE} -eq 1 ]]; then
+ printParameters
+ fi
+
+else
+ ${ECHO} -e `date`": starting servers in clustering mode..." | tee -a $log
+ if [[ ${VERBOSE} -eq 1 ]] ; then
+ printParameters
+ fi
+ # Do the WKA configuration to support clustering
+ configure_wk_members
+fi
+
+<%- if @using_dns == true -%>
+ #Update the DNS mapping
+<%- else -%>
+ # Update the /etc/hosts file with LB instance IP
+ update_hosts_file
+<%- end -%>
+
+
+# Run start server command
+verify_file_exists $STRATOS_APP_PATH/bin/wso2server.sh
+$STRATOS_APP_PATH/bin/wso2server.sh $* > /dev/null 2>&1 &
+print_message "Executed run command: $STRATOS_APP_PATH/bin/wso2server.sh $*"
+${ECHO} -e `date`": start servers extension successfully completed."
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/subscription-domain-added.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/subscription-domain-added.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/subscription-domain-added.sh.erb
new file mode 100644
index 0000000..9ef88a2
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/subscription-domain-added.sh.erb
@@ -0,0 +1,35 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed when subscription domain
+# added event is received.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+OUTPUT=`date`": Subscription Domain Added Event"
+OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_SERVICE_NAME: ${STRATOS_SUBSCRIPTION_SERVICE_NAME},"
+OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_DOMAIN_NAME: ${STRATOS_SUBSCRIPTION_DOMAIN_NAME},"
+OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_TENANT_ID: ${STRATOS_SUBSCRIPTION_TENANT_ID},"
+OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_TENANT_DOMAIN: $STRATOS_SUBSCRIPTION_TENANT_DOMAIN},"
+OUTPUT="$OUTPUT APP_PATH: ${APP_PATH},"
+OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_APPLICATION_CONTEXT: ${STRATOS_SUBSCRIPTION_APPLICATION_CONTEXT}"
+echo $OUTPUT | tee -a $log
http://git-wip-us.apache.org/repos/asf/stratos/blob/4999fa8d/tools/puppet3/modules/appserver/templates/agent/extensions/subscription-domain-removed.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/appserver/templates/agent/extensions/subscription-domain-removed.sh.erb b/tools/puppet3/modules/appserver/templates/agent/extensions/subscription-domain-removed.sh.erb
new file mode 100644
index 0000000..ff7b56b
--- /dev/null
+++ b/tools/puppet3/modules/appserver/templates/agent/extensions/subscription-domain-removed.sh.erb
@@ -0,0 +1,34 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# This extension script will be executed when subscription domain
+# removed event is received.
+# --------------------------------------------------------------
+#
+
+log=/var/log/apache-stratos/cartridge-agent-extensions.log
+OUTPUT=`date`": Subscription Domain Removed Event"
+OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_SERVICE_NAME: ${STRATOS_SUBSCRIPTION_SERVICE_NAME},"
+OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_DOMAIN_NAME: ${STRATOS_SUBSCRIPTION_DOMAIN_NAME},"
+OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_TENANT_ID: ${STRATOS_SUBSCRIPTION_TENANT_ID},"
+OUTPUT="$OUTPUT APP_PATH: ${APP_PATH},"
+OUTPUT="$OUTPUT STRATOS_SUBSCRIPTION_TENANT_DOMAIN: $STRATOS_SUBSCRIPTION_TENANT_DOMAIN}"
+echo $OUTPUT | tee -a $log