You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by is...@apache.org on 2013/07/10 13:12:29 UTC
[14/14] git commit: committing components with version refactored to
3.0.0-SNAPSHOT
committing components with version refactored to 3.0.0-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/a95bcac0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/a95bcac0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/a95bcac0
Branch: refs/heads/master
Commit: a95bcac00915a5d215c9ae4ecce165409b2fcfa0
Parents: e8c32da
Author: Isuru <is...@wso2.com>
Authored: Wed Jul 10 15:43:05 2013 +0530
Committer: Isuru <is...@wso2.com>
Committed: Wed Jul 10 15:43:05 2013 +0530
----------------------------------------------------------------------
.../4.1.0/pom.xml | 2 +-
.../4.1.3/pom.xml | 2 +-
.../4.1.3/pom.xml | 2 +-
.../org.apache.stratos.activation/2.1.2/pom.xml | 2 +-
.../2.1.3/pom.xml | 2 +-
.../2.1.1/pom.xml | 2 +-
.../org.apache.stratos.adc.mgt/2.1.3/pom.xml | 2 +-
.../2.1.3/pom.xml | 2 +-
.../2.1.3/pom.xml | 9 +-
.../2.1.1/pom.xml | 5 +-
.../org.apache.stratos.cartridge.mgt.ui/pom.xml | 2 +-
.../2.1.3/pom.xml | 331 -----
.../controller/axiom/AxiomXpathParser.java | 1263 ------------------
.../controller/concurrent/ThreadExecutor.java | 53 -
.../controller/consumers/TopologyBuilder.java | 188 ---
.../controller/deployers/CartridgeDeployer.java | 194 ---
.../deployers/CloudControllerDeployer.java | 110 --
.../controller/deployers/ServiceDeployer.java | 152 ---
.../exception/CloudControllerException.java | 32 -
.../exception/DeserializationException.java | 32 -
.../InvalidCartridgeDefinitionException.java | 32 -
.../exception/InvalidXMLException.java | 36 -
.../MalformedConfigurationFileException.java | 32 -
.../exception/NoInstanceFoundException.java | 38 -
.../exception/SerializationException.java | 32 -
.../UnregisteredCartridgeException.java | 32 -
.../exception/UnregisteredServiceException.java | 32 -
.../hector/CassandraDataRetriever.java | 181 ---
.../controller/hive/HiveQueryExecutor.java | 167 ---
.../cloud/controller/iaases/AWSEC2Iaas.java | 275 ----
.../controller/iaases/OpenstackNovaIaas.java | 269 ----
.../cloud/controller/iaases/VCloudIaas.java | 164 ---
.../impl/CloudControllerServiceImpl.java | 1123 ----------------
.../interfaces/CloudControllerService.java | 194 ---
.../cloud/controller/interfaces/Iaas.java | 73 -
.../internal/CloudControllerDSComponent.java | 85 --
.../jcloud/ComputeServiceBuilderUtil.java | 182 ---
.../cloud/controller/persist/Deserializer.java | 91 --
.../cloud/controller/persist/Serializer.java | 85 --
.../CartridgeInstanceDataPublisherTask.java | 476 -------
.../controller/registry/RegistryManager.java | 101 --
.../registry/RegistryManager.java.back | 96 --
.../runtime/FasterLookUpDataHolder.java | 425 ------
.../topic/ConfigurationPublisher.java | 65 -
.../topic/TopologySynchronizerTask.java | 79 --
.../stratos/cloud/controller/util/AppType.java | 44 -
.../cloud/controller/util/Cartridge.java | 254 ----
.../cloud/controller/util/CartridgeInfo.java | 162 ---
.../controller/util/CartridgeInstanceData.java | 129 --
.../util/CloudControllerConstants.java | 216 ---
.../controller/util/CloudControllerUtil.java | 102 --
.../util/DeclarativeServiceReferenceHolder.java | 69 -
.../cloud/controller/util/IaasContext.java | 149 ---
.../cloud/controller/util/IaasProvider.java | 263 ----
.../cloud/controller/util/PortMapping.java | 46 -
.../cloud/controller/util/Properties.java | 36 -
.../stratos/cloud/controller/util/Property.java | 35 -
.../cloud/controller/util/ServiceContext.java | 283 ----
.../src/main/resources/META-INF/component.xml | 36 -
.../src/main/resources/META-INF/services.xml | 9 -
.../2.1.3/src/main/resources/cartridge.xsd | 133 --
.../2.1.3/src/main/resources/cartridges.xsd | 144 --
.../2.1.3/src/main/resources/service.xsd | 46 -
.../2.1.3/src/main/resources/services.xsd | 51 -
.../service/axiom/AxiomValidationTest.java | 125 --
.../service/axiom/AxiomXpathParserTest.java | 51 -
.../service/util/ServiceContextTest.java | 49 -
.../2.1.3/src/test/resources/cartridges-1.xml | 33 -
.../2.1.3/src/test/resources/cartridges-2.xml | 34 -
.../2.1.3/src/test/resources/cartridges-3.xml | 16 -
.../2.1.3/src/test/resources/cartridges-4.xml | 32 -
.../2.1.3/src/test/resources/cartridges-5.xml | 29 -
.../2.1.3/src/test/resources/cartridges-6.xml | 19 -
.../2.1.3/src/test/resources/cartridges-7.xml | 40 -
.../2.1.3/src/test/resources/cartridges-8.xml | 72 -
.../2.1.3/src/test/resources/cartridges-9.xml | 66 -
.../src/test/resources/cloud-controller.xml | 73 -
.../2.1.3/target/classes/META-INF/MANIFEST.MF | 207 ---
.../2.1.3/target/classes/META-INF/component.xml | 36 -
.../2.1.3/target/classes/META-INF/services.xml | 9 -
.../2.1.3/target/classes/cartridge.xsd | 133 --
.../2.1.3/target/classes/cartridges.xsd | 144 --
.../controller/axiom/AxiomXpathParser.class | Bin 27987 -> 0 bytes
.../controller/concurrent/ThreadExecutor.class | Bin 1223 -> 0 bytes
.../controller/consumers/TopologyBuilder.class | Bin 6058 -> 0 bytes
...CartridgeDeployer$JcloudsObjectBuilder.class | Bin 2959 -> 0 bytes
.../deployers/CartridgeDeployer.class | Bin 6547 -> 0 bytes
.../deployers/CloudControllerDeployer.class | Bin 3714 -> 0 bytes
.../controller/deployers/ServiceDeployer.class | Bin 5858 -> 0 bytes
.../exception/CloudControllerException.class | Bin 739 -> 0 bytes
.../exception/DeserializationException.class | Bin 739 -> 0 bytes
.../InvalidCartridgeDefinitionException.class | Bin 765 -> 0 bytes
.../exception/InvalidXMLException.class | Bin 864 -> 0 bytes
.../MalformedConfigurationFileException.class | Bin 772 -> 0 bytes
.../exception/NoInstanceFoundException.class | Bin 732 -> 0 bytes
.../exception/SerializationException.class | Bin 733 -> 0 bytes
.../UnregisteredCartridgeException.class | Bin 750 -> 0 bytes
.../UnregisteredServiceException.class | Bin 744 -> 0 bytes
.../hector/CassandraDataRetriever.class | Bin 8404 -> 0 bytes
.../controller/hive/HiveQueryExecutor.class | Bin 7675 -> 0 bytes
.../cloud/controller/iaases/AWSEC2Iaas$1.class | Bin 1383 -> 0 bytes
.../cloud/controller/iaases/AWSEC2Iaas.class | Bin 9828 -> 0 bytes
.../controller/iaases/OpenstackNovaIaas$1.class | Bin 1438 -> 0 bytes
.../controller/iaases/OpenstackNovaIaas.class | Bin 10440 -> 0 bytes
.../cloud/controller/iaases/VCloudIaas.class | Bin 6275 -> 0 bytes
.../impl/CloudControllerServiceImpl$1.class | Bin 311 -> 0 bytes
...erServiceImpl$IaasProviderComparator$1.class | Bin 1546 -> 0 bytes
...erServiceImpl$IaasProviderComparator$2.class | Bin 1548 -> 0 bytes
...erServiceImpl$IaasProviderComparator$3.class | Bin 1524 -> 0 bytes
...erServiceImpl$IaasProviderComparator$4.class | Bin 2034 -> 0 bytes
...llerServiceImpl$IaasProviderComparator.class | Bin 3442 -> 0 bytes
.../impl/CloudControllerServiceImpl.class | Bin 29017 -> 0 bytes
.../interfaces/CloudControllerService.class | Bin 1229 -> 0 bytes
.../cloud/controller/interfaces/Iaas.class | Bin 863 -> 0 bytes
.../internal/CloudControllerDSComponent.class | Bin 3966 -> 0 bytes
.../jcloud/ComputeServiceBuilderUtil.class | Bin 5658 -> 0 bytes
.../cloud/controller/persist/Deserializer.class | Bin 2297 -> 0 bytes
.../cloud/controller/persist/Serializer.class | Bin 2556 -> 0 bytes
...geInstanceDataPublisherTask$NodeStatus.class | Bin 1733 -> 0 bytes
.../CartridgeInstanceDataPublisherTask.class | Bin 16906 -> 0 bytes
.../controller/registry/RegistryManager.class | Bin 3759 -> 0 bytes
.../runtime/FasterLookUpDataHolder.class | Bin 12167 -> 0 bytes
.../topic/ConfigurationPublisher.class | Bin 3377 -> 0 bytes
.../topic/TopologySynchronizerTask.class | Bin 3182 -> 0 bytes
.../stratos/cloud/controller/util/AppType.class | Bin 1173 -> 0 bytes
.../cloud/controller/util/Cartridge.class | Bin 7544 -> 0 bytes
.../cloud/controller/util/CartridgeInfo.class | Bin 4182 -> 0 bytes
.../controller/util/CartridgeInstanceData.class | Bin 2487 -> 0 bytes
.../util/CloudControllerConstants.class | Bin 7981 -> 0 bytes
.../controller/util/CloudControllerUtil.class | Bin 6104 -> 0 bytes
.../DeclarativeServiceReferenceHolder.class | Bin 1822 -> 0 bytes
.../cloud/controller/util/IaasContext.class | Bin 4778 -> 0 bytes
.../cloud/controller/util/IaasProvider.class | Bin 5980 -> 0 bytes
.../cloud/controller/util/PortMapping.class | Bin 1259 -> 0 bytes
.../cloud/controller/util/Properties.class | Bin 707 -> 0 bytes
.../cloud/controller/util/Property.class | Bin 935 -> 0 bytes
.../cloud/controller/util/ServiceContext.class | Bin 8343 -> 0 bytes
.../2.1.3/target/classes/service.xsd | 46 -
.../2.1.3/target/classes/services.xsd | 51 -
....stratos.cloud.controller-3.0.0-SNAPSHOT.jar | Bin 135825 -> 0 bytes
.../OSGI-INF/metatype/metatype.xml | 7 -
.../OSGI-INF/scr-plugin/scrinfo.xml | 9 -
.../OSGI-INF/serviceComponents.xml | 9 -
...scaler.service.axiom.AxiomValidationTest.xml | 63 -
...caler.service.axiom.AxiomXpathParserTest.xml | 62 -
...toscaler.service.util.ServiceContextTest.xml | 63 -
...scaler.service.axiom.AxiomValidationTest.txt | 4 -
...caler.service.axiom.AxiomXpathParserTest.txt | 4 -
...toscaler.service.util.ServiceContextTest.txt | 4 -
.../2.1.3/target/test-classes/cartridges-1.xml | 33 -
.../2.1.3/target/test-classes/cartridges-2.xml | 34 -
.../2.1.3/target/test-classes/cartridges-3.xml | 16 -
.../2.1.3/target/test-classes/cartridges-4.xml | 32 -
.../2.1.3/target/test-classes/cartridges-5.xml | 29 -
.../2.1.3/target/test-classes/cartridges-6.xml | 19 -
.../2.1.3/target/test-classes/cartridges-7.xml | 40 -
.../2.1.3/target/test-classes/cartridges-8.xml | 72 -
.../2.1.3/target/test-classes/cartridges-9.xml | 66 -
.../target/test-classes/cloud-controller.xml | 73 -
.../service/axiom/AxiomValidationTest.class | Bin 3103 -> 0 bytes
.../service/axiom/AxiomXpathParserTest.class | Bin 1822 -> 0 bytes
.../service/util/ServiceContextTest.class | Bin 1614 -> 0 bytes
.../2.1.3/target/timestamp | Bin 276 -> 0 bytes
.../org.apache.stratos.common/2.1.2/pom.xml | 2 +-
.../org.apache.stratos.deployment/2.1.0/pom.xml | 2 +-
.../2.1.0/pom.xml | 2 +-
.../org.apache.stratos.lb.common/4.1.3/pom.xml | 2 +-
.../2.1.0/pom.xml | 2 +-
.../2.1.0/pom.xml | 2 +-
.../2.1.0/pom.xml | 2 +-
.../2.1.0/pom.xml | 2 +-
.../2.1.0/pom.xml | 2 +-
.../org.apache.stratos.tenant.mgt/2.1.0/pom.xml | 2 +-
.../2.1.0/pom.xml | 2 +-
.../2.1.1/pom.xml | 2 +-
components/pom.xml | 9 +-
.../pom.xml | 2 +-
.../org.apache.stratos.tenant.activity/pom.xml | 2 +-
components/tenant-activity/pom.xml | 2 +-
pom.xml | 2 +-
180 files changed, 36 insertions(+), 10868 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/autoscaler-service/org.apache.stratos.autoscaler.service/4.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/components/autoscaler-service/org.apache.stratos.autoscaler.service/4.1.0/pom.xml b/components/autoscaler-service/org.apache.stratos.autoscaler.service/4.1.0/pom.xml
index dc84e21..2bbb943 100644
--- a/components/autoscaler-service/org.apache.stratos.autoscaler.service/4.1.0/pom.xml
+++ b/components/autoscaler-service/org.apache.stratos.autoscaler.service/4.1.0/pom.xml
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.stratos</groupId>
<artifactId>stratos-components-parent</artifactId>
- <version>2.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/pom.xml
----------------------------------------------------------------------
diff --git a/components/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/pom.xml b/components/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/pom.xml
index 9a4906b..c55c091 100644
--- a/components/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/pom.xml
+++ b/components/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/pom.xml
@@ -30,7 +30,7 @@ We need to modify this file since this copied from branch
<parent>
<groupId>org.apache.stratos</groupId>
<artifactId>stratos-components-parent</artifactId>
- <version>2.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/pom.xml
----------------------------------------------------------------------
diff --git a/components/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/pom.xml b/components/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/pom.xml
index 84d9315..04b8e71 100644
--- a/components/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/pom.xml
+++ b/components/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.stratos</groupId>
<artifactId>stratos-components-parent</artifactId>
- <version>2.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/org.apache.stratos.activation/2.1.2/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.activation/2.1.2/pom.xml b/components/org.apache.stratos.activation/2.1.2/pom.xml
index 16f9f3c..1723267 100644
--- a/components/org.apache.stratos.activation/2.1.2/pom.xml
+++ b/components/org.apache.stratos.activation/2.1.2/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.stratos</groupId>
<artifactId>stratos-components-parent</artifactId>
- <version>2.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/org.apache.stratos.adc.mgt.cli/2.1.3/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt.cli/2.1.3/pom.xml b/components/org.apache.stratos.adc.mgt.cli/2.1.3/pom.xml
index 44c27ce..e82ce78 100644
--- a/components/org.apache.stratos.adc.mgt.cli/2.1.3/pom.xml
+++ b/components/org.apache.stratos.adc.mgt.cli/2.1.3/pom.xml
@@ -14,7 +14,7 @@
<parent>
<groupId>org.apache.stratos</groupId>
<artifactId>stratos-components-parent</artifactId>
- <version>2.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/pom.xml b/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/pom.xml
index 32b2a28..ccf706b 100644
--- a/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/pom.xml
+++ b/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.stratos</groupId>
<artifactId>stratos-components-parent</artifactId>
- <version>2.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/org.apache.stratos.adc.mgt/2.1.3/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/pom.xml b/components/org.apache.stratos.adc.mgt/2.1.3/pom.xml
index 8a6d179..ab2759a 100644
--- a/components/org.apache.stratos.adc.mgt/2.1.3/pom.xml
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.stratos</groupId>
<artifactId>stratos-components-parent</artifactId>
- <version>2.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/org.apache.stratos.adc.topology.mgt/2.1.3/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.topology.mgt/2.1.3/pom.xml b/components/org.apache.stratos.adc.topology.mgt/2.1.3/pom.xml
index 9b9bcce..2024ba8 100644
--- a/components/org.apache.stratos.adc.topology.mgt/2.1.3/pom.xml
+++ b/components/org.apache.stratos.adc.topology.mgt/2.1.3/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.stratos</groupId>
<artifactId>stratos-components-parent</artifactId>
- <version>2.0.0</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/org.apache.stratos.cartridge.agent/2.1.3/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/2.1.3/pom.xml b/components/org.apache.stratos.cartridge.agent/2.1.3/pom.xml
index d8b8de9..cadcdc7 100644
--- a/components/org.apache.stratos.cartridge.agent/2.1.3/pom.xml
+++ b/components/org.apache.stratos.cartridge.agent/2.1.3/pom.xml
@@ -23,9 +23,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.apache.stratos</groupId>
- <artifactId>cartridge-agent-parent</artifactId>
- <version>2.0.0</version>
- <relativePath>../../pom.xml</relativePath>
+ <artifactId>stratos-components-parent</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -38,7 +38,7 @@
<dependency>
<groupId>org.apache.stratos</groupId>
<artifactId>org.apache.stratos.cartridge.messages</artifactId>
- <version>2.1.1</version>
+ <version>${apache.stratos.version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2.wso2</groupId>
@@ -48,6 +48,7 @@
<dependency>
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
<artifactId>axiom</artifactId>
+ <version>${orbit.version.axiom}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/org.apache.stratos.cartridge.messages/2.1.1/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.messages/2.1.1/pom.xml b/components/org.apache.stratos.cartridge.messages/2.1.1/pom.xml
index 9370740..ee78a78 100644
--- a/components/org.apache.stratos.cartridge.messages/2.1.1/pom.xml
+++ b/components/org.apache.stratos.cartridge.messages/2.1.1/pom.xml
@@ -23,15 +23,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.apache.stratos</groupId>
- <artifactId>cartridge-agent-parent</artifactId>
- <version>2.0.0</version>
+ <artifactId>stratos-components-parent</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.apache.stratos.cartridge.messages</artifactId>
<packaging>bundle</packaging>
- <version>2.1.1</version>
<name>Apache Stratos Cartridge Agent - Messages</name>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/org.apache.stratos.cartridge.mgt.ui/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.mgt.ui/pom.xml b/components/org.apache.stratos.cartridge.mgt.ui/pom.xml
index 8763c7a..aefbdd4 100644
--- a/components/org.apache.stratos.cartridge.mgt.ui/pom.xml
+++ b/components/org.apache.stratos.cartridge.mgt.ui/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.wso2.carbon</groupId>
<artifactId>stratos-components</artifactId>
- <version>2.1.0</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/org.apache.stratos.cloud.controller/2.1.3/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/2.1.3/pom.xml b/components/org.apache.stratos.cloud.controller/2.1.3/pom.xml
deleted file mode 100644
index 19a38a9..0000000
--- a/components/org.apache.stratos.cloud.controller/2.1.3/pom.xml
+++ /dev/null
@@ -1,331 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (c) 2009-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ 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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <parent>
- <groupId>org.apache.stratos</groupId>
- <artifactId>stratos-components-parent</artifactId>
- <version>2.0.0</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.stratos</groupId>
- <artifactId>org.apache.stratos.cloud.controller</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.3</version>
- <name>Apache Stratos Cloud Controller</name>
- <url>http://apache.org</url>
-
- <build>
- <plugins>
- <!--plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.7.1</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.jclouds:*</include>
- <include>org.jclouds.*:*</include>
- </includes>
- </artifactSet>
- <filtering>true</filtering>
- <filters>
- <filter>
- <artifact>org.jclouds*:*</artifact>
- <includes>
- <include>META-INF/services/org.jclouds.apis.ApiMetadata</include>
- <include>META-INF/services/org.jclouds.providers.ProviderMetadata</include>
- </includes>
- </filter>
- </filters>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer">
- </transformer>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin-->
- <!--plugin>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-aar-maven-plugin</artifactId>
- <version>1.4</version>
- <extensions>true</extensions>
- </plugin-->
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-scr-plugin</artifactId>
- </plugin>
-
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>1.4.0</version>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Name>${project.artifactId}</Bundle-Name>
- <Export-Package>
- og.apache.stratos.cloud.controller.interfaces.*,
- og.apache.stratos.cloud.controller.publisher.*,
- og.apache.stratos.cloud.controller.topic.*,
- og.apache.stratos.cloud.controller.iaases.*,
- og.apache.stratos.cloud.controller.util.*,
- org.apache.stratos.cloud.controller.deployers.*,
- org.apache.stratos.cloud.controller.exception.*,
- org.apache.stratos.cloud.controller.*
- </Export-Package>
- <Private-Package>
- og.apache.stratos.cloud.controller.*,
- !og.apache.stratos.cloud.controller.interfaces,
- !og.apache.stratos.cloud.controller.publisher,
- !og.apache.stratos.cloud.controller.topic,
- !og.apache.stratos.cloud.controller.iaases
- </Private-Package>
- <Import-Package>
- !org.apache.commons.logging,
- org.apache.commons.logging; version=0.0.0,
- org.wso2.carbon.utils.*,
- <!--org.jclouds.compute*;version="${jclouds.version}";resolution:=optional,
- org.jclouds*;version="${jclouds.version}",-->
- *; resolution:=optional
- </Import-Package>
- <DynamicImport-Package>*</DynamicImport-Package>
-
- <Axis2Deployer>CloudControllerDeployer</Axis2Deployer>
-
- <Axis2Deployer>CartridgeDeployer</Axis2Deployer>
-
- <Axis2Deployer>ServiceDeployer</Axis2Deployer>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.core</artifactId>
- <version>4.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.utils</artifactId>
- <version>4.1.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.stratos</groupId>
- <artifactId>org.apache.stratos.lb.common</artifactId>
- <version>4.1.3</version>
- </dependency>
-
-
-<dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.securevault</artifactId>
- <version>${wso2carbon.version}</version>
-</dependency>
-<dependency>
- <groupId>org.hectorclient.wso2</groupId>
- <artifactId>hector-core</artifactId>
- <version>1.1.0.wso2v1</version>
- <exclusions>
- <exclusion>
- <groupId>com.google.guava.wso2</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- </exclusions>
-
-</dependency>
-<dependency>
- <groupId>com.google.guava.wso2</groupId>
- <artifactId>guava</artifactId>
- <version>${google.guava.wso2.version}</version>
-</dependency>
-<dependency>
- <groupId>org.wso2.andes.wso2</groupId>
- <artifactId>andes-client</artifactId>
- <version>0.13.wso2v3</version>
- </dependency>
-<dependency>
- <groupId>org.apache.geronimo.specs.wso2</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>${orbit.version.geronimo-jms_1.1_spec}</version>
- </dependency>
-
-<dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.analytics.hive.stub</artifactId>
- <version>4.1.0</version>
-</dependency>
-
-<!-- Jclouds dependencies -->
- <dependency>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
-<!--
- <dependency>
- <groupId>org.jclouds.api</groupId>
- <artifactId>vcloud</artifactId>
- <version>1.6.0-wso2v1</version>
- </dependency>
--->
- <dependency>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-bouncycastle</artifactId>
- <version>${jclouds.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk16</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-sshj</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-log4j</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-enterprise</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds.api</groupId>
- <artifactId>ec2</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds.provider</groupId>
- <artifactId>aws-ec2</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds.api</groupId>
- <artifactId>openstack-nova</artifactId>
- <version>${jclouds.wso2.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>${jclouds.wso2.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-scriptbuilder</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds.common</groupId>
- <artifactId>aws-common</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>com.jamesmurty.utils.wso2</groupId>
- <artifactId>java-xmlbuilder</artifactId>
- <version>0.4.wso2v1</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds.api</groupId>
- <artifactId>vcloud</artifactId>
- <version>1.6.0-wso2v1</version>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson2.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.guice.wso2</groupId>
- <artifactId>guice</artifactId>
- <version>${google.guice.wso2.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.guice.assistedinject.wso2</groupId>
- <artifactId>guice-assistedinject</artifactId>
- <version>${com.google.guice.assistedinject.wso2.version}</version>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- <version>${sun.jersey.version}</version>
- </dependency>
- <dependency>
- <groupId>net.oauth.core</groupId>
- <artifactId>oauth</artifactId>
- <version>20100527</version>
- </dependency>
- <dependency>
- <groupId>commons-io.wso2</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.0.0.wso2v1</version>
- </dependency>
- <dependency>
- <groupId>rhino.wso2</groupId>
- <artifactId>js</artifactId>
- <version>1.7.0.R1-wso2v3</version>
- </dependency>
- <dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.cartridge.messages</artifactId>
- <version>2.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.databridge.agent.thrift</artifactId>
- <version>4.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.ntask.core</artifactId>
- <version>4.1.0</version>
- </dependency>
- </dependencies>
- <properties>
- <gson2.version>2.2</gson2.version>
- <jclouds.version>1.5.0-beta.5</jclouds.version>
- <jclouds.wso2.version>1.5.0-beta.5.wso2v1</jclouds.wso2.version>
- <com.google.guice.assistedinject.wso2.version>3.0.wso2v1</com.google.guice.assistedinject.wso2.version>
- <sun.jersey.version>1.12</sun.jersey.version>
- </properties>
-</project>
-
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/org.apache.stratos.cloud.controller/2.1.3/src/main/java/org/apache/stratos/cloud/controller/axiom/AxiomXpathParser.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/2.1.3/src/main/java/org/apache/stratos/cloud/controller/axiom/AxiomXpathParser.java b/components/org.apache.stratos.cloud.controller/2.1.3/src/main/java/org/apache/stratos/cloud/controller/axiom/AxiomXpathParser.java
deleted file mode 100644
index 92ca7d0..0000000
--- a/components/org.apache.stratos.cloud.controller/2.1.3/src/main/java/org/apache/stratos/cloud/controller/axiom/AxiomXpathParser.java
+++ /dev/null
@@ -1,1263 +0,0 @@
-/*
- * Copyright (c) 2005-2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. 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.cloud.controller.axiom;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNode;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
-import org.apache.axiom.om.impl.dom.ElementImpl;
-import org.apache.axiom.om.xpath.AXIOMXPath;
-import org.apache.stratos.cloud.controller.exception.CloudControllerException;
-import org.apache.stratos.cloud.controller.runtime.FasterLookUpDataHolder;
-import org.apache.stratos.cloud.controller.util.AppType;
-import org.apache.stratos.cloud.controller.util.Cartridge;
-import org.apache.stratos.cloud.controller.util.CloudControllerConstants;
-import org.apache.stratos.cloud.controller.util.PortMapping;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jaxen.JaxenException;
-import org.w3c.dom.Element;
-import org.apache.stratos.cloud.controller.exception.MalformedConfigurationFileException;
-import org.apache.stratos.cloud.controller.util.CloudControllerUtil;
-import org.apache.stratos.cloud.controller.util.IaasProvider;
-import org.apache.stratos.cloud.controller.util.ServiceContext;
-import org.wso2.securevault.SecretResolver;
-import org.wso2.securevault.SecretResolverFactory;
-
-/**
- * This class is parsing configuration files using Axiom Xpath.
- */
-public class AxiomXpathParser {
-
- private static final Log log = LogFactory.getLog(AxiomXpathParser.class);
- private OMElement documentElement;
- private final File xmlSource;
-
- public AxiomXpathParser(final File xmlFile) {
- xmlSource = xmlFile;
- }
-
- /**
- * @param cartridgeElement Cartridges section as a {@link String}
- * @param aCartridge {@link org.apache.stratos.cloud.controller.util.Cartridge} instance.
- * @param appTypesNodes nodes of App types.
- */
- private void getAppTypes(String cartridgeElementString, Cartridge aCartridge,
- List<?> appTypesNodes) {
- Object nodeObj;
- if (!appTypesNodes.isEmpty()) {
- if ((nodeObj = appTypesNodes.get(0)) instanceof OMNode) {
- OMNode appTypeNode = (OMNode) nodeObj;
-
- if (appTypeNode.getType() == OMNode.ELEMENT_NODE) {
-
- OMElement appTypesElt = (OMElement) appTypeNode;
-
- for (Iterator<?> iterator =
- appTypesElt.getChildrenWithName(new QName(
- CloudControllerConstants.APP_TYPE_ELEMENT)); iterator.hasNext();) {
- OMElement appElt = (OMElement) iterator.next();
-
- String name =
- appElt.getAttributeValue(new QName(
- CloudControllerConstants.NAME_ATTR));
- String appSpecificMapping =
- appElt.getAttributeValue(new QName(
- CloudControllerConstants.APP_SPECIFIC_MAPPING_ATTR));
-
- AppType appType;
-
- if (appSpecificMapping == null) {
- appType = new AppType(name);
- } else {
- appType =
- new AppType(name,
- Boolean.valueOf(appSpecificMapping));
- }
-
- aCartridge.addAppType(appType);
- }
-
- } else {
- String msg =
- "Essential '" + CloudControllerConstants.APP_TYPE_ELEMENT +
- "' element cannot" + " be found in " +
- cartridgeElementString + " of " +
- xmlSource;
- handleException(msg);
- }
-
- }
- }
- }
-
- /**
- * @return a List of {@link Cartridge}s.
- */
- public List<Cartridge> getCartridgesList() {
-
- FasterLookUpDataHolder dataHolder = FasterLookUpDataHolder.getInstance();
-
- List<IaasProvider> iaasProviders = dataHolder.getIaasProviders();
-
- if (iaasProviders == null) {
- dataHolder.setIaasProviders((iaasProviders = new ArrayList<IaasProvider>()));
- }
-
- List<Cartridge> cartridges = new ArrayList<Cartridge>();
-
- String xpath = CloudControllerConstants.CARTRIDGES_ELEMENT_XPATH;
-
- // cartridges can be found from this XPATH
- List<?> cartridgeNodes = getMatchingNodes(xpath, documentElement);
-
- if (cartridgeNodes == null || cartridgeNodes.isEmpty()) {
- // or from this XPATH
- xpath = CloudControllerConstants.CARTRIDGE_ELEMENT_XPATH;
- cartridgeNodes = getMatchingNodes(xpath, documentElement);
- }
-
- if (cartridgeNodes == null || cartridgeNodes.isEmpty()) {
- log.warn("No cartridge found in this configuration file : " + xmlSource.getPath());
- return cartridges;
- }
-
- for (Object obj : cartridgeNodes) {
-
- if (obj instanceof OMNode) {
- OMNode cartridgeNode = (OMNode) obj;
-
- if (cartridgeNode.getType() == OMNode.ELEMENT_NODE) {
-
- OMElement cartridgeElement = (OMElement) cartridgeNode;
-
- // retrieve Attributes of a Cartridge definition
- String type = cartridgeElement.getAttributeValue(new QName(
- CloudControllerConstants.TYPE_ATTR));
- String host = cartridgeElement.getAttributeValue(new QName(
- CloudControllerConstants.HOST_ATTR));
- String provider = cartridgeElement.getAttributeValue(new QName(
- CloudControllerConstants.PROVIDER_ATTR));
-
- String version =
- cartridgeElement.getAttributeValue(new QName(
- CloudControllerConstants.VERSION_ATTR));
-
- boolean multiTenant = Boolean.valueOf(cartridgeElement.getAttributeValue(new QName(
- CloudControllerConstants.MULTI_TENANT_ATTR)));
-
- Cartridge aCartridge;
-
- if ((aCartridge = dataHolder.getCartridge(type)) == null) {
-
- aCartridge = new Cartridge(type, host, provider, version, multiTenant);
- }
-
- // read displayName
- Iterator<?> itName =
- cartridgeElement.getChildrenWithName(new QName(
- CloudControllerConstants.DISPLAY_NAME_ELEMENT));
-
- if (itName.hasNext()) {
- OMElement name = (OMElement) itName.next();
-
- aCartridge.setDisplayName(name.getText());
- }
-
- // read description
- Iterator<?> it =
- cartridgeElement.getChildrenWithName(new QName(
- CloudControllerConstants.DESCRIPTION_ELEMENT));
-
- if (it.hasNext()) {
- OMElement desc = (OMElement) it.next();
-
- aCartridge.setDescription(desc.getText());
- }
-
- // load properties of this cartridge
- loadProperties(cartridgeElement, aCartridge.getProperties());
-
- // retrieve the list of IaaS providers
- List<?> iaasProviderNodes = getMatchingNodes(xpath + CloudControllerConstants.IAAS_PROVIDER_ELEMENT_XPATH,
- cartridgeElement);
-
- getIaasProviders(iaasProviders, cartridgeElement.toString(), aCartridge, iaasProviderNodes);
-
- // load dirs
- List<?> deploymentNodes = getMatchingNodes(xpath + CloudControllerConstants.DEPLOYMENT_ELEMENT_XPATH,
- cartridgeElement);
- setDeploymentDirs(cartridgeElement.toString(), aCartridge, deploymentNodes);
-
- // load port mappings
- List<?> portMappingNodes =
- getMatchingNodes(xpath +
- CloudControllerConstants.PORT_MAPPING_ELEMENT_XPATH,
- cartridgeElement);
- getPortMappings(cartridgeElement.toString(), aCartridge, portMappingNodes);
-
- // load appTypes
- List<?> appTypesNodes =
- getMatchingNodes(xpath +
- CloudControllerConstants.APP_TYPES_ELEMENT_XPATH,
- cartridgeElement);
- getAppTypes(cartridgeElement.toString(), aCartridge, appTypesNodes);
-
- cartridges.add(aCartridge);
-
- if (dataHolder.getCartridge(type) == null) {
- dataHolder.addCartridge(aCartridge);
- }
- }
- }
- }
-
- return cartridges;
-
- }
-
- /**
- * @param iaasProviders
- * @param cartridgeElementString
- * @param aCartridge
- * @param iaasProviderNodes
- */
- private void getIaasProviders(List<IaasProvider> iaasProviders,
- String cartridgeElementString, Cartridge aCartridge,
- List<?> iaasProviderNodes) {
- for (Object nodeObj : iaasProviderNodes) {
- if (nodeObj instanceof OMNode) {
- OMNode iaasProviderNode = (OMNode) nodeObj;
-
- if (iaasProviderNode.getType() == OMNode.ELEMENT_NODE) {
-
- OMElement iaasElt = (OMElement) iaasProviderNode;
-
- // add the IaasProvider to this cartridge
- aCartridge.addIaasProvider(getIaasProvider(iaasElt, iaasProviders));
-
- } else {
- String msg =
- "Essential '" +
- CloudControllerConstants.IAAS_PROVIDER_ELEMENT +
- "' element cannot" + " be found in " +
- cartridgeElementString + " of " +
- xmlSource;
- handleException(msg);
- }
-
- }
- }
- }
-
- private Element getDOMElement(final OMElement omElement) {
-
- // Get the StAX reader from the created element
- XMLStreamReader llomReader = omElement.getXMLStreamReader();
-
- // Create the DOOM OMFactory
- OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
-
- // Create the new builder
- StAXOMBuilder doomBuilder = new StAXOMBuilder(doomFactory, llomReader);
-
- // Get the document element
- OMElement newElem = doomBuilder.getDocumentElement();
-
- return newElem instanceof Element ? (Element) newElem : null;
- }
-
- private OMElement getElement(final Object obj) {
- OMNode node;
- if ((obj instanceof OMNode) && (node = (OMNode) obj).getType() == OMNode.ELEMENT_NODE) {
-
- OMElement element = (OMElement) node;
-
- return element;
-
- }
-
- return null;
- }
-
- private OMElement getElement(final OMElement rootElt, final String eltStr, final String xpath) {
- List<?> nodes = getMatchingNodes(xpath, rootElt);
- neglectingWarn(eltStr, nodes.size());
- OMElement element = getElement(nodes.get(0));
- return element;
- }
-
- private OMElement getFirstChildElement(final OMElement root, final String childName) {
- Iterator<?> it = root.getChildrenWithName(new QName(childName));
- if (it.hasNext()) {
- return (OMElement) it.next();
- }
-
- return null;
- }
-
- /**
- *
- * @param xpath
- * XPATH expression to be read.
- * @param elt
- * OMElement to be used for the search.
- * @return List matching OMNode list
- */
- @SuppressWarnings("unchecked")
- public OMNode getFirstMatchingNode(final String xpath, final OMElement elt) {
-
- AXIOMXPath axiomXpath;
- List<OMNode> nodeList = null;
- try {
- axiomXpath = new AXIOMXPath(xpath);
- nodeList = axiomXpath.selectNodes(elt);
- } catch (JaxenException e) {
- String msg = "Error occurred while reading the Xpath (" + xpath + ")";
- log.error(msg, e);
- throw new CloudControllerException(msg, e);
- }
-
- return nodeList != null ? nodeList.get(0) : null;
- }
-
- private IaasProvider getIaasProvider(final OMNode item, List<IaasProvider> iaases) {
-
- IaasProvider iaas = null;
-
- if (item.getType() == OMNode.ELEMENT_NODE) {
-
- OMElement iaasElt = (OMElement) item;
-
- if (iaases != null) {
- // check whether this is a reference to a predefined IaaS.
- for (IaasProvider iaasProvider : iaases) {
- if (iaasProvider.getType()
- .equals(iaasElt.getAttribute(new QName(
- CloudControllerConstants.TYPE_ATTR))
- .getAttributeValue())) {
- iaas = new IaasProvider(iaasProvider);
- break;
- }
- }
- }
-
- if (iaas == null) {
- iaas = new IaasProvider();
- }
-
- if (iaas.getType() == null) {
- iaas.setType(iaasElt.getAttribute(new QName(CloudControllerConstants.TYPE_ATTR))
- .getAttributeValue());
- }
-
- if ("".equals(iaas.getType())) {
- String msg =
- "'" + CloudControllerConstants.IAAS_PROVIDER_ELEMENT + "' element's '" +
- CloudControllerConstants.TYPE_ATTR +
- "' attribute should be specified!";
-
- handleException(msg);
-
- }
-
- // this is not mandatory
- String name =
- (iaasElt.getAttribute(new QName(CloudControllerConstants.NAME_ATTR)) == null)
- ? iaas.getName()
- : iaasElt.getAttributeValue(new QName(
- CloudControllerConstants.NAME_ATTR));
-
- iaas.setName(name);
-
- String xpath = CloudControllerConstants.IAAS_PROVIDER_ELEMENT_XPATH;
-
- // load other elements
- loadClassName(iaas, iaasElt);
- loadMaxInstanceLimit(iaas, iaasElt);
- loadProperties(iaasElt, iaas.getProperties());
- loadTemplate(iaas, iaasElt);
- loadScalingOrders(iaas, iaasElt);
- loadProvider(iaas, iaasElt);
- loadIdentity(iaas, iaasElt);
- loadCredentials(iaas, iaasElt, xpath);
- }
-
- return iaas;
- }
-
- /**
- *
- * @param xpath
- * XPATH expression to be read.
- * @return List matching OMNode list
- */
- @SuppressWarnings("unchecked")
- public List<OMNode> getMatchingNodes(final String xpath) {
-
- AXIOMXPath axiomXpath;
- List<OMNode> nodeList = null;
- try {
- axiomXpath = new AXIOMXPath(xpath);
- nodeList = axiomXpath.selectNodes(documentElement);
- } catch (JaxenException e) {
- String msg = "Error occurred while reading the Xpath (" + xpath + ")";
- log.error(msg, e);
- throw new CloudControllerException(msg, e);
- }
-
- return nodeList;
- }
-
- /**
- *
- * @param xpath
- * XPATH expression to be read.
- * @param elt
- * OMElement to be used for the search.
- * @return List matching OMNode list
- */
- @SuppressWarnings("unchecked")
- public List<OMNode> getMatchingNodes(final String xpath, final OMElement elt) {
-
- AXIOMXPath axiomXpath;
- List<OMNode> nodeList = null;
- try {
- axiomXpath = new AXIOMXPath(xpath);
- nodeList = axiomXpath.selectNodes(elt);
- } catch (JaxenException e) {
- String msg = "Error occurred while reading the Xpath (" + xpath + ")";
- log.error(msg, e);
- throw new CloudControllerException(msg, e);
- }
-
- return nodeList;
- }
-
- /**
- * @param cartridgeElement Cartridges section as a {@link String}
- * @param aCartridge {@link Cartridge} instance.
- * @param portMappingNodes nodes of port mapping elements
- */
- private void getPortMappings(String cartridgeElementString, Cartridge aCartridge,
- List<?> portMappingNodes) {
- Object nodeObj;
- if (!portMappingNodes.isEmpty()) {
- if ((nodeObj = portMappingNodes.get(0)) instanceof OMNode) {
- OMNode portMappingNode = (OMNode) nodeObj;
-
- if (portMappingNode.getType() == OMNode.ELEMENT_NODE) {
-
- OMElement portMappingElt = (OMElement) portMappingNode;
-
- for (Iterator<?> iterator =
- portMappingElt.getChildrenWithName(new QName(
- CloudControllerConstants.HTTP_ELEMENT)); iterator.hasNext();) {
- OMElement httpElt = (OMElement) iterator.next();
-
- String port =
- httpElt.getAttributeValue(new QName(
- CloudControllerConstants.PORT_ATTR));
- String proxyPort =
- httpElt.getAttributeValue(new QName(
- CloudControllerConstants.PROXY_PORT_ATTR));
-
- PortMapping mapping =
- new PortMapping(
- CloudControllerConstants.HTTP_ELEMENT,
- port, proxyPort);
-
- aCartridge.addPortMapping(mapping);
- }
-
- for (Iterator<?> iterator =
- portMappingElt.getChildrenWithName(new QName(
- CloudControllerConstants.HTTPS_ELEMENT)); iterator.hasNext();) {
- OMElement httpsElt = (OMElement) iterator.next();
-
- String port =
- httpsElt.getAttributeValue(new QName(
- CloudControllerConstants.PORT_ATTR));
- String proxyPort =
- httpsElt.getAttributeValue(new QName(
- CloudControllerConstants.PROXY_PORT_ATTR));
-
- PortMapping mapping =
- new PortMapping(
- CloudControllerConstants.HTTPS_ELEMENT,
- port, proxyPort);
-
- aCartridge.addPortMapping(mapping);
- }
-
- } else {
- String msg =
- "Essential '" +
- CloudControllerConstants.PORT_MAPPING_ELEMENT +
- "' element cannot" + " be found in " +
- cartridgeElementString + " of " +
- xmlSource;
- handleException(msg);
- }
-
- }
- }
- }
-
- public List<ServiceContext> getServiceContexts() {
-
- List<ServiceContext> serviceContextList = new ArrayList<ServiceContext>();
-
- // services can be found from this XPATH
- String xpath = CloudControllerConstants.SERVICES_ELEMENT_XPATH;
- List<?> serviceNodes = getMatchingNodes(xpath, documentElement);
-
- if (serviceNodes == null || serviceNodes.isEmpty()) {
- // or from this XPATH
- xpath = CloudControllerConstants.SERVICE_ELEMENT_XPATH;
- serviceNodes = getMatchingNodes(xpath, documentElement);
- }
-
- if (serviceNodes == null || serviceNodes.isEmpty()) {
- log.warn("No service found in this configuration file : " + xmlSource.getPath());
- return serviceContextList;
- }
-
- for (Object obj : serviceNodes) {
- ServiceContext serviceCtxt = new ServiceContext();
-
- // set the definition file
- serviceCtxt.setFile(xmlSource);
-
- if (obj instanceof OMNode) {
- OMNode serviceNode = (OMNode) obj;
-
- if (serviceNode.getType() == OMNode.ELEMENT_NODE) {
-
- OMElement node = (OMElement) serviceNode;
-
- if (node.getAttribute(new QName(CloudControllerConstants.SERVICE_DOMAIN_ATTR)) == null) {
- String msg =
- "Essential '" + CloudControllerConstants.SERVICE_DOMAIN_ATTR + "' " +
- "attribute of '" + CloudControllerConstants.SERVICE_ELEMENT +
- "' element cannot be found in " + xmlSource;
-
- handleException(msg);
- }
-
- // set domain name
- serviceCtxt.setDomainName(node.getAttribute(new QName(
- CloudControllerConstants.SERVICE_DOMAIN_ATTR))
- .getAttributeValue());
-
- // set sub domain
- serviceCtxt.setSubDomainName(node.getAttribute(new QName(
- CloudControllerConstants.SERVICE_SUB_DOMAIN_ATTR))
- .getAttributeValue());
-
- // set tenant range
- serviceCtxt.setTenantRange(node.getAttribute(new QName(
- CloudControllerConstants.SERVICE_TENANT_RANGE_ATTR))
- .getAttributeValue());
-
- OMNode cartridgeNode =
- getFirstMatchingNode(xpath +
- CloudControllerConstants.CARTRIDGE_ELEMENT_XPATH,
- node);
-
- if (cartridgeNode != null && cartridgeNode.getType() == OMNode.ELEMENT_NODE) {
-
- OMElement cartridgeElt = (OMElement) cartridgeNode;
-
- String type =
- cartridgeElt.getAttribute(new QName(CloudControllerConstants.TYPE_ATTR))
- .getAttributeValue();
-
- if ("".equals(type)) {
- String msg =
- "Essential '" + CloudControllerConstants.TYPE_ATTR + "' " +
- " attribute of '" +
- CloudControllerConstants.CARTRIDGE_ELEMENT + "' of '" +
- CloudControllerConstants.SERVICE_ELEMENT +
- "' element cannot be found in " + xmlSource;
-
- handleException(msg);
- }
-
- // set Cartridge type
- serviceCtxt.setCartridgeType(type);
-
- }
- if (serviceCtxt.getCartridgeType() == null) {
- String msg =
- "Essential '" + CloudControllerConstants.CARTRIDGE_ELEMENT +
- "' element" + " has not specified in " + xmlSource;
- handleException(msg);
- }
-
- // load payload
- loadPayload(getMatchingNodes(xpath + CloudControllerConstants.PAYLOAD_ELEMENT_XPATH,
- node), serviceCtxt);
-
- // load host name
- loadHostName(getMatchingNodes(xpath + CloudControllerConstants.HOST_ELEMENT_XPATH,
- node), serviceCtxt);
-
- // load properties
- loadProperties(node, serviceCtxt.getProperties());
-
- }
- }
-
- FasterLookUpDataHolder.getInstance().addServiceContext(serviceCtxt);
- // add each domain specific template to list
- serviceContextList.add(serviceCtxt);
- }
-
- return serviceContextList;
-
- }
-
- public File getXmlSource() {
- return xmlSource;
- }
-
- private void handleException(final String msg) {
- log.error(msg);
- throw new MalformedConfigurationFileException(msg);
- }
-
- private void handleException(final String msg, final Exception e) {
- log.error(msg, e);
- throw new MalformedConfigurationFileException(msg, e);
- }
-
- private void loadClassName(final IaasProvider iaas, final OMElement iaasElt) {
-
- Iterator<?> it =
- iaasElt.getChildrenWithName(new QName(
- CloudControllerConstants.CLASS_NAME_ELEMENT));
-
- if (it.hasNext()) {
- OMElement classNameElt = (OMElement) it.next();
- iaas.setClassName(classNameElt.getText());
- }
-
- if (it.hasNext()) {
- log.warn(xmlSource + " contains more than one " +
- CloudControllerConstants.CLASS_NAME_ELEMENT + " elements!" +
- " Elements other than the first will be neglected.");
- }
-
- if (iaas.getClassName() == null) {
- String msg =
- "Essential '" + CloudControllerConstants.CLASS_NAME_ELEMENT + "' element " +
- "has not specified in " + xmlSource;
- handleException(msg);
- }
-
- }
-
- private void loadCredentials(final IaasProvider iaas, final OMElement iaasElt,
- final String xpath) {
-
- Iterator<?> it =
- iaasElt.getChildrenWithName(new QName(
- CloudControllerConstants.CREDENTIAL_ELEMENT));
-
- if (it.hasNext()) {
- OMElement credentialElt = (OMElement) it.next();
-
- // retrieve the value using secure vault
- SecretResolver secretResolver = SecretResolverFactory.create(documentElement, false);
- String alias =
- credentialElt.getAttributeValue(new QName(
- CloudControllerConstants.ALIAS_ATTRIBUTE));
-
- // retrieve the secured password
- if (secretResolver != null && secretResolver.isInitialized() &&
- secretResolver.isTokenProtected(alias)) {
-
- iaas.setCredential(secretResolver.resolve(alias));
-
- }
-
- // if we still cannot find a value, we try to assign the value which
- // is specified
- // in the element, if any
- if (iaas.getCredential() == null) {
- log.warn("Unable to find a value for " + CloudControllerConstants.CREDENTIAL_ELEMENT +
- " element from Secure Vault." +
- "Hence we will try to assign the plain text value (if specified).");
- iaas.setCredential(credentialElt.getText());
- }
- }
-
- if (it.hasNext()) {
- log.warn(xmlSource + " contains more than one " +
- CloudControllerConstants.CREDENTIAL_ELEMENT + " elements!" +
- " Elements other than the first will be neglected.");
- }
-
- if (iaas.getCredential() == null) {
- String msg =
- "Essential '" + CloudControllerConstants.CREDENTIAL_ELEMENT + "' element" +
- " has not specified in " + xmlSource;
- handleException(msg);
- }
-
- }
-
- private void loadHostName(final List<OMNode> nodes, final ServiceContext serviceCtxt) {
-
- if (nodes == null || nodes.isEmpty()) {
- return;
- }
-
- // read host element
- if (nodes.get(0).getType() == OMNode.ELEMENT_NODE) {
-
- OMElement node = (OMElement) nodes.get(0);
-
- if (node.getText() != null) {
- serviceCtxt.setHostName(node.getText());
- }
-
- }
- }
-
- private void loadIdentity(final IaasProvider iaas, final OMElement iaasElt) {
-
- Iterator<?> it =
- iaasElt.getChildrenWithName(new QName(CloudControllerConstants.IDENTITY_ELEMENT));
-
- if (it.hasNext()) {
- OMElement identityElt = (OMElement) it.next();
-
- // retrieve the value using secure vault
- SecretResolver secretResolver = SecretResolverFactory.create(documentElement, false);
- String alias =
- identityElt.getAttributeValue(new QName(
- CloudControllerConstants.ALIAS_ATTRIBUTE));
-
- // retrieve the secured password
- if (secretResolver != null && secretResolver.isInitialized() &&
- secretResolver.isTokenProtected(alias)) {
-
- iaas.setIdentity(secretResolver.resolve(alias));
-
- }
-
- // if we still cannot find a value, we try to assign the value which
- // is specified
- // in the element, if any
- if (iaas.getIdentity() == null) {
- log.warn("Unable to find a value for " + CloudControllerConstants.IDENTITY_ELEMENT +
- " element from Secure Vault." +
- "Hence we will try to assign the plain text value (if specified).");
- iaas.setIdentity(identityElt.getText());
- }
- }
-
- if (it.hasNext()) {
- log.warn(xmlSource + " contains more than one " + CloudControllerConstants.IDENTITY_ELEMENT +
- " elements!" + " Elements other than the first will be neglected.");
- }
-
- if (iaas.getIdentity() == null) {
- String msg =
- "Essential '" + CloudControllerConstants.IDENTITY_ELEMENT + "' element" +
- " has not specified in " + xmlSource;
- handleException(msg);
- }
-
- }
-
- private void loadMaxInstanceLimit(IaasProvider iaas, final OMElement iaasElt) {
-
- Iterator<?> it =
- iaasElt.getChildrenWithName(new QName(
- CloudControllerConstants.MAX_INSTANCE_LIMIT_ELEMENT));
-
- if (it.hasNext()) {
- OMElement maxInstanceLimitElt = (OMElement) it.next();
-
- try {
- iaas.setMaxInstanceLimit(Integer.parseInt(maxInstanceLimitElt.getText()));
- } catch (NumberFormatException e) {
- String msg =
- CloudControllerConstants.MAX_INSTANCE_LIMIT_ELEMENT +
- " element contained" + " in " + xmlSource + "" +
- " has a value which is not an Integer value.";
- handleException(msg, e);
- }
-
- }
-
- if (it.hasNext()) {
- log.warn(xmlSource + " contains more than one " +
- CloudControllerConstants.MAX_INSTANCE_LIMIT_ELEMENT + " elements!" +
- " Elements other than the first will be neglected.");
- }
-
- }
-
- private void loadPayload(final List<OMNode> nodes, final ServiceContext serviceCtxt) {
-
- if (nodes == null || nodes.isEmpty()) {
- return;
- }
-
- // read payload element
- if (nodes.get(0).getType() == OMNode.ELEMENT_NODE) {
-
- OMElement node = (OMElement) nodes.get(0);
-
- if (node.getText() != null) {
- byte[] payload = CloudControllerUtil.getBytesFromFile(node.getText());
- serviceCtxt.setPayload(payload);
-
- }
-
- }
-
- }
-
- private void loadProperties(final OMElement iaasElt, final Map<String, String> propertyMap) {
-
- Iterator<?> it =
- iaasElt.getChildrenWithName(new QName(CloudControllerConstants.PROPERTY_ELEMENT));
-
- while (it.hasNext()) {
- OMElement prop = (OMElement) it.next();
-
- if (prop.getAttribute(new QName(CloudControllerConstants.PROPERTY_NAME_ATTR)) == null ||
- prop.getAttribute(new QName(CloudControllerConstants.PROPERTY_VALUE_ATTR)) == null) {
-
- String msg =
- "Property element's, name and value attributes should be specified " +
- "in " + xmlSource;
-
- handleException(msg);
- }
-
- propertyMap.put(prop.getAttribute(new QName(CloudControllerConstants.PROPERTY_NAME_ATTR))
- .getAttributeValue(),
- prop.getAttribute(new QName(CloudControllerConstants.PROPERTY_VALUE_ATTR))
- .getAttributeValue());
- }
-
- }
-
- private void loadProvider(final IaasProvider iaas, final OMElement iaasElt) {
-
- Iterator<?> it =
- iaasElt.getChildrenWithName(new QName(CloudControllerConstants.PROVIDER_ELEMENT));
-
- if (it.hasNext()) {
- OMElement providerElt = (OMElement) it.next();
- iaas.setProvider(providerElt.getText());
- }
-
- if (it.hasNext()) {
- log.warn(xmlSource + " contains more than one " + CloudControllerConstants.PROVIDER_ELEMENT +
- " elements!" + " Elements other than the first will be neglected.");
- }
-
- if (iaas.getProvider() == null) {
- String msg =
- "Essential '" + CloudControllerConstants.PROVIDER_ELEMENT + "' element " +
- "has not specified in " + xmlSource;
- handleException(msg);
- }
-
- }
-
- private void loadScalingOrders(final IaasProvider iaas, final OMElement iaasElt) {
- // set scale up order
- Iterator<?> it =
- iaasElt.getChildrenWithName(new QName(
- CloudControllerConstants.SCALE_UP_ORDER_ELEMENT));
-
- if (it.hasNext()) {
- OMElement scaleUpOrderElt = (OMElement) it.next();
-
- try {
- iaas.setScaleUpOrder(Integer.parseInt(scaleUpOrderElt.getText()));
- } catch (NumberFormatException e) {
- String msg =
- CloudControllerConstants.SCALE_UP_ORDER_ELEMENT + " element contained" +
- " in " + xmlSource + "" +
- " has a value which is not an Integer value.";
- handleException(msg, e);
- }
- }
-
- if (it.hasNext()) {
- log.warn(xmlSource + " contains more than one " +
- CloudControllerConstants.SCALE_UP_ORDER_ELEMENT + " elements!" +
- " Elements other than the first will be neglected.");
- }
-
- if (iaas.getScaleUpOrder() == -1) {
- String msg =
- "Essential '" + CloudControllerConstants.SCALE_UP_ORDER_ELEMENT + "' element" +
- " has not specified in " + xmlSource;
- handleException(msg);
- }
-
- // set scale down order
- it = iaasElt.getChildrenWithName(new QName(CloudControllerConstants.SCALE_DOWN_ORDER_ELEMENT));
-
- if (it.hasNext()) {
- OMElement scaleDownElt = (OMElement) it.next();
-
- try {
- iaas.setScaleDownOrder(Integer.parseInt(scaleDownElt.getText()));
- } catch (NumberFormatException e) {
- String msg =
- CloudControllerConstants.SCALE_DOWN_ORDER_ELEMENT + " element contained" +
- " in " + xmlSource + "" +
- " has a value which is not an Integer value.";
- handleException(msg, e);
- }
- }
-
- if (it.hasNext()) {
- log.warn(xmlSource + " contains more than one " +
- CloudControllerConstants.SCALE_DOWN_ORDER_ELEMENT + " elements!" +
- " Elements other than the first will be neglected.");
- }
-
- if (iaas.getScaleDownOrder() == -1) {
- String msg =
- "Essential '" + CloudControllerConstants.SCALE_DOWN_ORDER_ELEMENT + "' element" +
- " has not specified in " + xmlSource;
- handleException(msg);
- }
-
- }
-
- private void loadTemplate(final IaasProvider iaas, final OMElement iaasElt) {
-
- Iterator<?> it =
- iaasElt.getChildrenWithName(new QName(CloudControllerConstants.IMAGE_ID_ELEMENT));
-
- if (it.hasNext()) {
- OMElement imageElt = (OMElement) it.next();
- iaas.setImage(imageElt.getText());
- }
-
- if (it.hasNext()) {
- log.warn(xmlSource + " contains more than one " + CloudControllerConstants.IMAGE_ID_ELEMENT +
- " elements!" + " Elements other than the first will be neglected.");
- }
-
- }
-
- private void neglectingWarn(final String elt, final int size) {
- if (size > 1) {
- log.warn(xmlSource + " contains more than one " + elt + " elements!" +
- " Elements other than the first will be neglected.");
- }
- }
-
- public void parse() {
-
- if (xmlSource.exists()) {
- try {
- documentElement = new StAXOMBuilder(xmlSource.getPath()).getDocumentElement();
-
- } catch (Exception ex) {
- String msg = "Error occurred when parsing the " + xmlSource.getPath() + ".";
- handleException(msg, ex);
- }
- } else {
- String msg = "Configuration file cannot be found : " + xmlSource.getPath();
- handleException(msg);
- }
- }
-
- private void plainTextWarn(final String elt) {
- log.warn("Unable to find a value for " + elt + " element from Secure Vault." +
- "Hence we will try to assign the plain text value (if specified).");
- }
-
- private String resolveSecret(final OMElement elt) {
- // retrieve the value using secure vault
- SecretResolver secretResolver = SecretResolverFactory.create(documentElement, false);
-
- String alias = elt.getAttributeValue(new QName(CloudControllerConstants.ALIAS_ATTRIBUTE));
-
- // retrieve the secured password
- if (secretResolver != null && secretResolver.isInitialized() &&
- secretResolver.isTokenProtected(alias)) {
-
- return secretResolver.resolve(alias);
-
- }
-
- return null;
- }
-
- public void setDataPublisherRelatedData() {
-
- String eltStr = CloudControllerConstants.DATA_PUBLISHER_ELEMENT;
- // get dataPublisher element
- OMElement element =
- getElement(documentElement, eltStr,
- CloudControllerConstants.DATA_PUBLISHER_XPATH);
-
- if (element == null) {
- return;
- }
-
- FasterLookUpDataHolder dataHolder = FasterLookUpDataHolder.getInstance();
- // get enable attribute
- boolean isEnable =
- Boolean.parseBoolean(element.getAttributeValue(new QName(
- CloudControllerConstants.ENABLE_ATTR)));
- dataHolder.setEnableBAMDataPublisher(isEnable);
-
- if (isEnable) {
- // get bam server info
- OMElement childElement =
- getFirstChildElement(element,
- CloudControllerConstants.BAM_SERVER_ELEMENT);
- OMElement elt;
-
- if (childElement != null) {
- // set bam user name
- elt =
- getFirstChildElement(childElement,
- CloudControllerConstants.BAM_SERVER_ADMIN_USERNAME_ELEMENT);
- if (elt != null) {
- dataHolder.setBamUsername(elt.getText());
- }
- // set bam password
- elt =
- getFirstChildElement(childElement,
- CloudControllerConstants.BAM_SERVER_ADMIN_PASSWORD_ELEMENT);
- if (elt != null) {
- String password = resolveSecret(elt);
- if (password == null) {
- plainTextWarn(CloudControllerConstants.BAM_SERVER_ADMIN_PASSWORD_ELEMENT);
- password = elt.getText();
- }
-
- if (password != null) {
- dataHolder.setBamPassword(password);
- }
- }
- }
-
- // set cron
- childElement = getFirstChildElement(element, CloudControllerConstants.CRON_ELEMENT);
- if (childElement != null) {
- dataHolder.setDataPublisherCron(childElement.getText());
- }
-
- // set cassandra info
- childElement = getFirstChildElement(element, CloudControllerConstants.CASSANDRA_INFO_ELEMENT);
-
- if (childElement != null) {
- // set connection url
- elt = getFirstChildElement(childElement, CloudControllerConstants.CONNECTION_URL_ELEMENT);
- if (elt != null) {
- dataHolder.setCassandraConnUrl(elt.getText());
- }
-
- // set user name
- elt = getFirstChildElement(childElement, CloudControllerConstants.USER_NAME_ELEMENT);
- if (elt != null) {
- dataHolder.setCassandraUser(elt.getText());
- }
- // set password
- elt = getFirstChildElement(childElement, CloudControllerConstants.PASSWORD_ELEMENT);
- if (elt != null) {
- String password = resolveSecret(elt);
- if (password == null) {
- plainTextWarn(CloudControllerConstants.PASSWORD_ELEMENT);
- password = elt.getText();
- }
-
- if (password != null) {
- dataHolder.setCassandraPassword(password);
- }
- }
- }
-
- }
-
- }
-
- /**
- * @param cartridgeElement Cartridges section as a {@link String}
- * @param aCartridge {@link Cartridge} instance.
- * @param deploymentNodes list of deployment directory nodes
- */
- private void setDeploymentDirs(String cartridgeElementString, Cartridge aCartridge,
- List<?> deploymentNodes) {
- Object nodeObj;
- if ((nodeObj = deploymentNodes.get(0)) instanceof OMNode) {
- OMNode deploymentNode = (OMNode) nodeObj;
-
- if (deploymentNode.getType() == OMNode.ELEMENT_NODE) {
-
- OMElement deployElt = (OMElement) deploymentNode;
-
- if (deployElt.getAttributeValue(new QName(
- CloudControllerConstants.BASE_DIR_ATTR)) != null) {
-
- aCartridge.setBaseDir(deployElt.getAttributeValue(new QName(
- CloudControllerConstants.BASE_DIR_ATTR)));
- }
-
- for (Iterator<?> iterator =
- deployElt.getChildrenWithName(new QName(
- CloudControllerConstants.DIRECTORY_ELEMENT)); iterator.hasNext();) {
- OMElement dir = (OMElement) iterator.next();
- aCartridge.addDeploymentDir(dir.getText());
- }
-
- } else {
- String msg =
- "Essential '" + CloudControllerConstants.DEPLOYMENT_ELEMENT +
- "' element cannot" + " be found in " +
- cartridgeElementString + " of " + xmlSource;
- handleException(msg);
- }
-
- }
- }
-
- public void setIaasProvidersList() {
-
- List<IaasProvider> iaasProviders = FasterLookUpDataHolder.getInstance().getIaasProviders();
-
- if (iaasProviders == null) {
- FasterLookUpDataHolder.getInstance()
- .setIaasProviders((iaasProviders = new ArrayList<IaasProvider>()));
- }
-
- List<OMNode> nodeList = getMatchingNodes(CloudControllerConstants.IAAS_PROVIDER_XPATH);
-
- // this is a valid scenario. User can have 0..1 iaas provider elements
- // in cloud-controller xml.
- if (nodeList == null || nodeList.isEmpty()) {
- return;
- }
-
- for (OMNode node : nodeList) {
- iaasProviders.add(getIaasProvider(node, iaasProviders));
- }
-
- }
-
-
- public void setTopologySyncRelatedData() {
-
- String eltStr = CloudControllerConstants.TOPOLOGY_SYNC_ELEMENT;
- // get topologySync element
- OMElement element =
- getElement(documentElement, eltStr,
- CloudControllerConstants.TOPOLOGY_SYNC_XPATH);
-
- if (element == null) {
- return;
- }
-
- // get enable attribute
- boolean isEnable =
- Boolean.parseBoolean(element.getAttributeValue(new QName(
- CloudControllerConstants.ENABLE_ATTR)));
-
- FasterLookUpDataHolder dataHolder = FasterLookUpDataHolder.getInstance();
- dataHolder.setEnableTopologySync(isEnable);
-
- if (isEnable) {
- // get MB server info
- OMElement childElement =
- getFirstChildElement(element,
- CloudControllerConstants.MB_SERVER_ELEMENT);
-
- if (childElement != null) {
- // set MB server IP
- dataHolder.setMBServerUrl(childElement.getText());
- }
-
- // set cron
- childElement = getFirstChildElement(element, CloudControllerConstants.CRON_ELEMENT);
- if (childElement != null) {
- dataHolder.setTopologySynchronizerCron(childElement.getText());
- }
-
- }
-
- }
-
- public boolean validate(final File schemaFile) throws Exception {
- validate(documentElement, schemaFile);
- return true;
- }
-
- public void validate(final OMElement omElement, final File schemaFile) throws Exception {
-
- Element sourceElement;
-
- // if the OMElement is created using DOM implementation use it
- if (omElement instanceof ElementImpl) {
- sourceElement = (Element) omElement;
- } else { // else convert from llom to dom
- sourceElement = getDOMElement(omElement);
- }
-
- // Create a SchemaFactory capable of understanding WXS schemas.
-
- // Load a WXS schema, represented by a Schema instance.
- SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- Source source = new StreamSource(schemaFile);
-
- // Create a Validator object, which can be used to validate
- // an instance document.
- Schema schema = factory.newSchema(source);
- Validator validator = schema.newValidator();
-
- // Validate the DOM tree.
- validator.validate(new DOMSource(sourceElement));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a95bcac0/components/org.apache.stratos.cloud.controller/2.1.3/src/main/java/org/apache/stratos/cloud/controller/concurrent/ThreadExecutor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/2.1.3/src/main/java/org/apache/stratos/cloud/controller/concurrent/ThreadExecutor.java b/components/org.apache.stratos.cloud.controller/2.1.3/src/main/java/org/apache/stratos/cloud/controller/concurrent/ThreadExecutor.java
deleted file mode 100644
index ac4eeae..0000000
--- a/components/org.apache.stratos.cloud.controller/2.1.3/src/main/java/org/apache/stratos/cloud/controller/concurrent/ThreadExecutor.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-* Copyright (c) 2005-2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-*
-* WSO2 Inc. 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.cloud.controller.concurrent;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * This class can be used to create a thread pool, and hand over new jobs to the pool.
- */
-public class ThreadExecutor {
- private ExecutorService executor;
-
- public ThreadExecutor(int poolSize) {
- executor = Executors.newFixedThreadPool(poolSize);
- }
-
- public void execute(Runnable job){
- executor.execute(job);
- }
-
- public void executeAll(Runnable[] jobs){
- for (Runnable job : jobs) {
-
- executor.execute(job);
- }
- }
-
- public void shutdown() {
- // This will make the executor accept no new threads
- // and finish all existing threads in the queue
- executor.shutdown();
- // Wait until all threads are finished
- while (!executor.isTerminated()) {}
- }
-
-
-}