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/05 12:32:50 UTC
[13/34] git commit: adding changes to adc components
adding changes to adc components
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/4f217859
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/4f217859
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/4f217859
Branch: refs/heads/master
Commit: 4f217859a73aa4e5ab1e126e78203806ce9b4d26
Parents: 35006ac
Author: Isuru <is...@wso2.com>
Authored: Fri Jul 5 12:26:41 2013 +0530
Committer: Isuru <is...@wso2.com>
Committed: Fri Jul 5 12:26:41 2013 +0530
----------------------------------------------------------------------
.../2.1.1/pom.xml | 87 ++
.../service/RepositorySynchronizer.java | 37 +
.../src/main/webapp/WEB-INF/cxf-servlet.xml | 34 +
.../2.1.1/src/main/webapp/WEB-INF/web.xml | 49 +
.../2.1.1/src/main/webapp/servicelist.css | 117 ++
.../org.apache.stratos.adc.mgt/2.1.3/pom.xml | 144 +++
.../2.1.3/src/conf/cartridge-config.properties | 38 +
.../2.1.3/src/conf/tenant-resource-policy.xml | 1 +
.../adc/mgt/client/CartridgeAgentClient.java | 39 +
.../client/CloudControllerServiceClient.java | 94 ++
.../stratos/adc/mgt/client/RegistryClient.java | 112 ++
.../adc/mgt/custom/domain/RegistryManager.java | 106 ++
.../adc/mgt/dao/CartridgeSubscription.java | 186 +++
.../stratos/adc/mgt/dao/DataCartridge.java | 49 +
.../apache/stratos/adc/mgt/dao/PortMapping.java | 56 +
.../apache/stratos/adc/mgt/dao/Repository.java | 56 +
.../adc/mgt/dao/RepositoryCredentials.java | 27 +
.../apache/stratos/adc/mgt/dns/DNSManager.java | 86 ++
.../org/apache/stratos/adc/mgt/dto/AppRepo.java | 85 ++
.../apache/stratos/adc/mgt/dto/Cartridge.java | 198 ++++
.../stratos/adc/mgt/dto/CartridgeDetail.java | 1 +
.../adc/mgt/dto/CartridgeInformation.java | 1 +
.../stratos/adc/mgt/dto/CartridgeWrapper.java | 49 +
.../org/apache/stratos/adc/mgt/dto/Policy.java | 145 +++
.../stratos/adc/mgt/dto/PolicyDefinition.java | 80 ++
.../adc/mgt/dto/RepositoryInformation.java | 43 +
.../stratos/adc/mgt/dto/SubscriptionInfo.java | 43 +
.../stratos/adc/mgt/exception/ADCException.java | 46 +
.../exception/AlreadySubscribedException.java | 45 +
.../exception/DomainMappingExistsException.java | 45 +
.../DuplicateCartridgeAliasException.java | 53 +
.../InvalidCartridgeAliasException.java | 54 +
.../exception/InvalidRepositoryException.java | 32 +
.../mgt/exception/NotSubscribedException.java | 46 +
.../adc/mgt/exception/PolicyException.java | 38 +
.../RepositoryCredentialsRequiredException.java | 37 +
.../exception/RepositoryRequiredException.java | 37 +
.../exception/RepositoryTransportException.java | 37 +
.../UnregisteredCartridgeException.java | 45 +
.../internal/ADCManagementServerComponent.java | 106 ++
.../stratos/adc/mgt/internal/DataHolder.java | 77 ++
.../adc/mgt/internal/HostingConstants.java | 37 +
.../internal/HostingManagementActivator.java | 60 +
.../service/ApplicationManagementService.java | 620 ++++++++++
.../InstanceInformationManagementService.java | 55 +
.../mgt/service/RepoNotificationService.java | 179 +++
.../adc/mgt/service/RepositoryInfoBean.java | 78 ++
.../service/RepositoryInformationService.java | 66 ++
.../mgt/utils/ApplicationManagementUtil.java | 1095 ++++++++++++++++++
.../stratos/adc/mgt/utils/CartridgeAppType.java | 41 +
.../mgt/utils/CartridgeConfigFileReader.java | 59 +
.../adc/mgt/utils/CartridgeConstants.java | 74 ++
.../stratos/adc/mgt/utils/CartridgeDomain.java | 143 +++
.../stratos/adc/mgt/utils/DomainInfo.java | 40 +
.../adc/mgt/utils/PersistenceManager.java | 853 ++++++++++++++
.../stratos/adc/mgt/utils/PolicyHolder.java | 289 +++++
.../adc/mgt/utils/RepositoryCreator.java | 266 +++++
.../adc/mgt/utils/RepositoryFactory.java | 129 +++
.../stratos/adc/mgt/utils/StratosDBUtils.java | 210 ++++
.../mgt/utils/SynchronizeRepositoryRequest.java | 143 +++
.../src/main/resources/META-INF/services.xml | 86 ++
.../2.1.3/src/main/resources/policies.xsd | 36 +
.../2.1.3/src/scripts/append_zone_file.sh | 24 +
.../stratos/adc/mgt/test/PolicyHolderTest.java | 63 +
.../2.1.3/src/test/resources/log4j.properties | 8 +
.../2.1.3/src/test/resources/policies-1.xml | 22 +
.../2.1.3/pom.xml | 137 +++
.../topology/mgt/builder/TopologySyncher.java | 114 ++
.../mgt/exception/TopologyMgtException.java | 35 +
.../mgt/group/mgt/GroupMgtAgentBuilder.java | 109 ++
.../mgt/SubDomainAwareGroupManagementAgent.java | 32 +
.../mgt/internal/TopologyMgtDSComponent.java | 290 +++++
.../mgt/service/TopologyManagementService.java | 69 ++
.../impl/TopologyManagementServiceImpl.java | 127 ++
.../mgt/serviceobjects/DomainContext.java | 90 ++
.../mgt/subscriber/TopicHealthChecker.java | 67 ++
.../mgt/subscriber/TopologyListener.java | 44 +
.../mgt/subscriber/TopologySubscriber.java | 92 ++
.../mgt/subscriber/TopologySubscriberTask.java | 1 +
.../adc/topology/mgt/util/ConfigHolder.java | 197 ++++
.../topology/mgt/util/TopologyConstants.java | 13 +
.../adc/topology/mgt/util/TopologyMgtUtil.java | 5 +
.../src/main/resources/META-INF/services.xml | 9 +
.../org.wso2.carbon.adc.mgt.cli/2.1.3/pom.xml | 124 ++
.../2.1.3/src/main/assembly/src.xml | 33 +
.../org/wso2/carbon/adc/mgt/cli/CliTool.java | 73 ++
.../org/wso2/carbon/adc/mgt/cli/Command.java | 64 +
.../wso2/carbon/adc/mgt/cli/CommandContext.java | 85 ++
.../adc/mgt/cli/CommandLineApplication.java | 187 +++
.../carbon/adc/mgt/cli/CommandLineService.java | 553 +++++++++
.../carbon/adc/mgt/cli/StratosApplication.java | 501 ++++++++
.../adc/mgt/cli/StratosCommandContext.java | 28 +
.../cli/commands/AddDomainMappingCommand.java | 84 ++
.../adc/mgt/cli/commands/CartridgesCommand.java | 68 ++
.../adc/mgt/cli/commands/ExitCommand.java | 67 ++
.../adc/mgt/cli/commands/HelpCommand.java | 70 ++
.../adc/mgt/cli/commands/InfoCommand.java | 72 ++
.../adc/mgt/cli/commands/ListCommand.java | 120 ++
.../adc/mgt/cli/commands/PoliciesCommand.java | 68 ++
.../commands/RemoveDomainMappingCommand.java | 72 ++
.../adc/mgt/cli/commands/SubscribeCommand.java | 205 ++++
.../adc/mgt/cli/commands/SyncCommand.java | 73 ++
.../mgt/cli/commands/UnsubscribeCommand.java | 127 ++
.../adc/mgt/cli/completer/CommandCompleter.java | 130 +++
.../adc/mgt/cli/exception/CommandException.java | 36 +
.../carbon/adc/mgt/cli/utils/CliConstants.java | 111 ++
.../carbon/adc/mgt/cli/utils/CliMessages.java | 0
.../adc/mgt/cli/utils/CommandLineUtils.java | 91 ++
.../carbon/adc/mgt/cli/utils/RowMapper.java | 20 +
.../src/main/resources/Resources.properties | 25 +
.../2.1.3/src/main/resources/log4j.properties | 15 +
.../2.1.3/src/main/resources/wso2carbon.jks | Bin 0 -> 33260 bytes
components/pom.xml | 5 +-
.../2.1.1/pom.xml | 87 --
.../service/RepositorySynchronizer.java | 37 -
.../src/main/webapp/WEB-INF/cxf-servlet.xml | 34 -
.../2.1.1/src/main/webapp/WEB-INF/web.xml | 49 -
.../2.1.1/src/main/webapp/servicelist.css | 117 --
.../org.apache.stratos.adc.mgt/2.1.3/pom.xml | 134 ---
.../2.1.3/src/conf/cartridge-config.properties | 38 -
.../2.1.3/src/conf/tenant-resource-policy.xml | 1 -
.../adc/mgt/client/CartridgeAgentClient.java | 39 -
.../client/CloudControllerServiceClient.java | 94 --
.../stratos/adc/mgt/client/RegistryClient.java | 112 --
.../adc/mgt/custom/domain/RegistryManager.java | 106 --
.../adc/mgt/dao/CartridgeSubscription.java | 186 ---
.../stratos/adc/mgt/dao/DataCartridge.java | 49 -
.../apache/stratos/adc/mgt/dao/PortMapping.java | 56 -
.../apache/stratos/adc/mgt/dao/Repository.java | 56 -
.../adc/mgt/dao/RepositoryCredentials.java | 27 -
.../apache/stratos/adc/mgt/dns/DNSManager.java | 86 --
.../org/apache/stratos/adc/mgt/dto/AppRepo.java | 85 --
.../apache/stratos/adc/mgt/dto/Cartridge.java | 198 ----
.../stratos/adc/mgt/dto/CartridgeDetail.java | 1 -
.../adc/mgt/dto/CartridgeInformation.java | 1 -
.../stratos/adc/mgt/dto/CartridgeWrapper.java | 49 -
.../org/apache/stratos/adc/mgt/dto/Policy.java | 145 ---
.../stratos/adc/mgt/dto/PolicyDefinition.java | 80 --
.../adc/mgt/dto/RepositoryInformation.java | 43 -
.../stratos/adc/mgt/dto/SubscriptionInfo.java | 43 -
.../stratos/adc/mgt/exception/ADCException.java | 46 -
.../exception/AlreadySubscribedException.java | 45 -
.../exception/DomainMappingExistsException.java | 45 -
.../DuplicateCartridgeAliasException.java | 53 -
.../InvalidCartridgeAliasException.java | 54 -
.../exception/InvalidRepositoryException.java | 32 -
.../mgt/exception/NotSubscribedException.java | 46 -
.../adc/mgt/exception/PolicyException.java | 38 -
.../RepositoryCredentialsRequiredException.java | 37 -
.../exception/RepositoryRequiredException.java | 37 -
.../exception/RepositoryTransportException.java | 37 -
.../UnregisteredCartridgeException.java | 45 -
.../internal/ADCManagementServerComponent.java | 106 --
.../stratos/adc/mgt/internal/DataHolder.java | 77 --
.../adc/mgt/internal/HostingConstants.java | 37 -
.../internal/HostingManagementActivator.java | 60 -
.../service/ApplicationManagementService.java | 620 ----------
.../InstanceInformationManagementService.java | 55 -
.../mgt/service/RepoNotificationService.java | 179 ---
.../adc/mgt/service/RepositoryInfoBean.java | 78 --
.../service/RepositoryInformationService.java | 66 --
.../mgt/utils/ApplicationManagementUtil.java | 1095 ------------------
.../stratos/adc/mgt/utils/CartridgeAppType.java | 41 -
.../mgt/utils/CartridgeConfigFileReader.java | 59 -
.../adc/mgt/utils/CartridgeConstants.java | 74 --
.../stratos/adc/mgt/utils/CartridgeDomain.java | 143 ---
.../stratos/adc/mgt/utils/DomainInfo.java | 40 -
.../adc/mgt/utils/PersistenceManager.java | 853 --------------
.../stratos/adc/mgt/utils/PolicyHolder.java | 289 -----
.../adc/mgt/utils/RepositoryCreator.java | 266 -----
.../adc/mgt/utils/RepositoryFactory.java | 129 ---
.../stratos/adc/mgt/utils/StratosDBUtils.java | 210 ----
.../mgt/utils/SynchronizeRepositoryRequest.java | 143 ---
.../src/main/resources/META-INF/services.xml | 86 --
.../2.1.3/src/main/resources/policies.xsd | 36 -
.../2.1.3/src/scripts/append_zone_file.sh | 24 -
.../stratos/adc/mgt/test/PolicyHolderTest.java | 63 -
.../2.1.3/src/test/resources/log4j.properties | 8 -
.../2.1.3/src/test/resources/policies-1.xml | 22 -
.../2.1.3/pom.xml | 131 ---
.../topology/mgt/builder/TopologySyncher.java | 114 --
.../mgt/exception/TopologyMgtException.java | 35 -
.../mgt/group/mgt/GroupMgtAgentBuilder.java | 109 --
.../mgt/SubDomainAwareGroupManagementAgent.java | 32 -
.../mgt/internal/TopologyMgtDSComponent.java | 290 -----
.../mgt/service/TopologyManagementService.java | 69 --
.../impl/TopologyManagementServiceImpl.java | 127 --
.../mgt/serviceobjects/DomainContext.java | 90 --
.../mgt/subscriber/TopicHealthChecker.java | 67 --
.../mgt/subscriber/TopologyListener.java | 44 -
.../mgt/subscriber/TopologySubscriber.java | 92 --
.../mgt/subscriber/TopologySubscriberTask.java | 1 -
.../adc/topology/mgt/util/ConfigHolder.java | 197 ----
.../topology/mgt/util/TopologyConstants.java | 13 -
.../adc/topology/mgt/util/TopologyMgtUtil.java | 5 -
.../src/main/resources/META-INF/services.xml | 9 -
.../org.wso2.carbon.adc.mgt.cli/2.1.3/pom.xml | 124 --
.../2.1.3/src/main/assembly/src.xml | 33 -
.../org/wso2/carbon/adc/mgt/cli/CliTool.java | 73 --
.../org/wso2/carbon/adc/mgt/cli/Command.java | 64 -
.../wso2/carbon/adc/mgt/cli/CommandContext.java | 85 --
.../adc/mgt/cli/CommandLineApplication.java | 187 ---
.../carbon/adc/mgt/cli/CommandLineService.java | 553 ---------
.../carbon/adc/mgt/cli/StratosApplication.java | 501 --------
.../adc/mgt/cli/StratosCommandContext.java | 28 -
.../cli/commands/AddDomainMappingCommand.java | 84 --
.../adc/mgt/cli/commands/CartridgesCommand.java | 68 --
.../adc/mgt/cli/commands/ExitCommand.java | 67 --
.../adc/mgt/cli/commands/HelpCommand.java | 70 --
.../adc/mgt/cli/commands/InfoCommand.java | 72 --
.../adc/mgt/cli/commands/ListCommand.java | 120 --
.../adc/mgt/cli/commands/PoliciesCommand.java | 68 --
.../commands/RemoveDomainMappingCommand.java | 72 --
.../adc/mgt/cli/commands/SubscribeCommand.java | 205 ----
.../adc/mgt/cli/commands/SyncCommand.java | 73 --
.../mgt/cli/commands/UnsubscribeCommand.java | 127 --
.../adc/mgt/cli/completer/CommandCompleter.java | 130 ---
.../adc/mgt/cli/exception/CommandException.java | 36 -
.../carbon/adc/mgt/cli/utils/CliConstants.java | 111 --
.../carbon/adc/mgt/cli/utils/CliMessages.java | 0
.../adc/mgt/cli/utils/CommandLineUtils.java | 91 --
.../carbon/adc/mgt/cli/utils/RowMapper.java | 20 -
.../src/main/resources/Resources.properties | 25 -
.../2.1.3/src/main/resources/log4j.properties | 15 -
.../2.1.3/src/main/resources/wso2carbon.jks | Bin 33260 -> 0 bytes
225 files changed, 11873 insertions(+), 11856 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/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
new file mode 100644
index 0000000..6f0f4a6
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/pom.xml
@@ -0,0 +1,87 @@
+<!--
+ ~ Copyright 2011-2012 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.
+ -->
+
+<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.wso2.carbon</groupId>
+ <artifactId>adc-mgt</artifactId>
+ <version>2.1.0</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>org.apache.stratos.adc.mgt.repository.synchronizer</artifactId>
+ <version>2.1.1</version>
+ <name>Repository Synchronizer</name>
+ <description>Repository Synchronizer</description>
+ <packaging>war</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ <version>2.3.2</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
+ <warName>${project.artifactId}</warName>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http</artifactId>
+ <version>2.6.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>2.6.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.json-lib</groupId>
+ <artifactId>json-lib</artifactId>
+ <version>2.4</version>
+ <classifier>jdk15</classifier>
+ </dependency>
+
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/java/org/apache/stratos/adc/mgt/reposync/service/RepositorySynchronizer.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/java/org/apache/stratos/adc/mgt/reposync/service/RepositorySynchronizer.java b/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/java/org/apache/stratos/adc/mgt/reposync/service/RepositorySynchronizer.java
new file mode 100644
index 0000000..937baab
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/java/org/apache/stratos/adc/mgt/reposync/service/RepositorySynchronizer.java
@@ -0,0 +1,37 @@
+/**
+ *
+ */
+package org.apache.stratos.adc.mgt.reposync.service;
+
+import java.util.Map;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.MediaType;
+
+import net.sf.json.JSONObject;
+
+/**
+ * @author wso2
+ *
+ */
+@Path("/reposyncservice/")
+public class RepositorySynchronizer {
+
+ @POST
+ @Path("/notify/")
+ @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+ public void execute(@FormParam("payload") String payload) {
+ Map jsonObject = JSONObject.fromObject(payload);
+ System.out.println("Printing......");
+ Map repoMap = (Map) jsonObject.get("repository");
+ System.out.println("-------------");
+ System.out.println("Repo URL : " + repoMap.get("url"));
+ System.out.println("-------------");
+ System.out.println("-------------");
+ System.out.println("-------------");
+ System.out.println("---JSON customer : " + payload);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/cxf-servlet.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/cxf-servlet.xml
new file mode 100644
index 0000000..9454028
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/cxf-servlet.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Copyright 2011-2012 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.
+ -->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
+
+ <jaxrs:server id="repoSynchronizer" address="/notify">
+ <jaxrs:serviceBeans>
+ <ref bean="serviceBean"/>
+ </jaxrs:serviceBeans>
+ </jaxrs:server>
+
+ <bean id="serviceBean" class="org.apache.stratos.adc.mgt.reposync.service.RepositorySynchronizer"/>
+</beans>
+
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/web.xml b/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..696d5cc
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2011-2012 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.
+ -->
+
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name>JAX-WS/JAX-RS Webapp</display-name>
+
+ <servlet>
+ <servlet-name>JAXServlet</servlet-name>
+ <display-name>JAX-WS/JAX-RS Servlet</display-name>
+ <description>JAX-WS/JAX-RS Endpoint</description>
+ <servlet-class>
+ org.apache.cxf.transport.servlet.CXFServlet
+ </servlet-class>
+ <init-param>
+ <param-name>service-list-stylesheet</param-name>
+ <param-value>servicelist.css</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>JAXServlet</servlet-name>
+ <url-pattern>/services/*</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>60</session-timeout>
+ </session-config>
+
+</web-app>
+
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/servicelist.css
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/servicelist.css b/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/servicelist.css
new file mode 100644
index 0000000..bbc4987
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/servicelist.css
@@ -0,0 +1,117 @@
+@CHARSET "ISO-8859-1";
+
+/* http://meyerweb.com/eric/tools/css/reset/
+ v2.0 | 20110126
+ License: none (public domain)
+*/
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+
+html {
+ background: #efefef;
+}
+
+body {
+ line-height: 1;
+ width:960px;
+ margin:auto;
+ background:white;
+ padding:10px;
+ box-shadow:0px 0px 5px #CCC;
+ font-family:"Lucida Grande","Lucida Sans","Microsoft Sans Serif", "Lucida Sans Unicode","Verdana","Sans-serif","trebuchet ms" !important;
+
+}
+ol, ul {
+ list-style: none;
+}
+blockquote, q {
+ quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: '';
+ content: none;
+}
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+ width:960px;
+ border:solid 1px #ccc;
+}
+
+table a {
+ font-size:12px;
+ color:#1e90ff;
+ padding:7px;
+float:left;
+;
+}
+
+.heading {
+ font-size: 18px;
+ margin-top: 20px;
+ float:left;
+ color:#0067B1;
+ margin-bottom:20px;
+ padding-top:20px;
+}
+
+.field {
+ font-weight: normal;
+ width:120px;
+ font-size:12px;
+ float:left;
+ padding:7px;
+ clear:left;
+}
+.value {
+ font-weight: bold;
+ font-size:12px;
+ float:left;
+ padding:7px;
+ clear:right;
+}
+.porttypename {
+ font-weight: bold;
+ font-size:14px;
+}
+UL {
+ margin-top: 0;
+}
+LI {
+ font-weight: normal;
+ font-size:12px;
+ margin-top:10px;
+}
+
+TD {
+ border:1px solid #ccc;
+ vertical-align: text-top;
+ padding: 5px;
+}
+
+
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/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
new file mode 100644
index 0000000..8a6d179
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/pom.xml
@@ -0,0 +1,144 @@
+<?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.
+-->
+
+<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>
+ <artifactId>org.apache.stratos.adc.mgt</artifactId>
+ <version>2.1.3</version>
+ <packaging>bundle</packaging>
+ <name>Apache Stratos - ADC BE</name>
+ <description>BE functionalities of ADC</description>
+ <url>http://apache.org</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.wso2.carbon</groupId>
+ <artifactId>org.wso2.carbon.registry.ws.client</artifactId>
+ </dependency>
+ <!--<dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging-api</artifactId>
+ </dependency> -->
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.load.balance.cartridge.autoscaler.service.stub</artifactId>
+ <version>4.1.3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.adc.topology.mgt</artifactId>
+ <version>2.1.3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.wso2.carbon</groupId>
+ <artifactId>org.wso2.carbon.utils</artifactId>
+ <version>${wso2carbon.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.wso2.carbon</groupId>
+ <artifactId>org.wso2.carbon.cartridge.agent.stub</artifactId>
+ <version>4.1.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat.wso2</groupId>
+ <artifactId>jdbc-pool</artifactId>
+ <version>${version.tomcat}.wso2v1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.gitblit</groupId>
+ <artifactId>gitblit</artifactId>
+ <version>1.2.0.wso2v1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jgit</groupId>
+ <artifactId>org.eclipse.jgit</artifactId>
+ <version>2.1.0.wso2v1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jcraft</groupId>
+ <artifactId>jsch</artifactId>
+ <version>0.1.49.wso2v1</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+ <Bundle-Name>${project.artifactId}</Bundle-Name>
+ <Bundle-Activator>
+ org.apache.stratos.adc.mgt.internal.HostingManagementActivator
+ </Bundle-Activator>
+ <Private-Package>org.apache.stratos.adc.mgt.internal.*</Private-Package>
+ <Export-Package>
+ org.apache.stratos.adc.mgt.utils*,
+ org.apache.stratos.adc.mgt.service.*,
+ org.apache.stratos.adc.mgt.*
+ </Export-Package>
+ <Import-Package>
+ org.apache.axis2.*; version="1.6.1.wso2v6",
+ org.apache.axiom.*;
+ version="1.2.11.wso2v2",
+ org.apache.neethi.*;
+ version="2.0.4.wso2v4",
+ javax.xml.stream.*; version="1.0.1",
+ javax.wsdl.*; version="1.6.2",
+ org.osgi.framework.*,
+ *;resolution:=optional
+ </Import-Package>
+ <DynamicImport-Package>*</DynamicImport-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/conf/cartridge-config.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/conf/cartridge-config.properties b/components/org.apache.stratos.adc.mgt/2.1.3/src/conf/cartridge-config.properties
new file mode 100644
index 0000000..b495014
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/conf/cartridge-config.properties
@@ -0,0 +1,38 @@
+# Configuration properties
+
+sc.ip=s2_ip
+autoscalerService.url=https://cc.wso2.com:9444/services/CloudControllerService/
+autoscaler.time.out=190000
+cartridge.agent.epr=https://s2_ip:9447/services/CartridgeAgentService
+git.host.name=s2_hostname
+git.host.ip=s2_ip
+git.repo.notification.url=https://sc.wso2.com:9445/services/RepoNotificationService/
+identity.server.url=https://sc.wso2.com:9447/services/RepoNotificationService/
+
+adc.jdbc.url=jdbc:h2:repository/database/WSO2S2_DB
+adc.jdbc.username=wso2carbon
+adc.jdbc.password=wso2carbon
+adc.jdbc.driver=org.h2.Driver
+
+mb.server.ip=cc.wso2.com:5673
+
+feature.externalrepo.validation.enabled=true
+feature.internalrepo.enabled=false
+feature.multitenant.multiplesubscription.enabled=false
+
+internal.repo.username=admin
+internal.repo.password=admin
+
+append.script=SCRIPT_PATH/add_entry_zone_file.sh
+remove.script=SCRIPT_PATH/remove_entry_zone_file.sh
+bind.file.path=/etc/bind/db.STRATOS_DOMAIN
+elb.ip=s2_ip
+
+bam.ip=s2_ip
+bam.port=7714
+
+max.attempts=1000
+
+cartridge.key=KEYPATH
+
+repository.info.epr=https://s2_ip:9445/services/RepositoryInformationService
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/conf/tenant-resource-policy.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/conf/tenant-resource-policy.xml b/components/org.apache.stratos.adc.mgt/2.1.3/src/conf/tenant-resource-policy.xml
new file mode 100644
index 0000000..12bbf74
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/conf/tenant-resource-policy.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/client/CartridgeAgentClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/client/CartridgeAgentClient.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/client/CartridgeAgentClient.java
new file mode 100644
index 0000000..3731107
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/client/CartridgeAgentClient.java
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.adc.mgt.client;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.adc.mgt.internal.DataHolder;
+import org.wso2.carbon.cartridge.agent.stub.CartridgeAgentServiceStub;
+
+public class CartridgeAgentClient {
+
+ private static final Log log = LogFactory.getLog(CartridgeAgentClient.class);
+ CartridgeAgentServiceStub stub = null;
+ public CartridgeAgentClient(String epr) throws AxisFault {
+ ConfigurationContext clientConfigContext = DataHolder.getClientConfigContext();
+ stub = new CartridgeAgentServiceStub(clientConfigContext, epr);
+ }
+
+ public void unregister(String domain, String subDomain, String hostName) throws Exception {
+ log.info(" ** Unregistering -- ");
+ stub.unregister(domain, subDomain, hostName);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/client/CloudControllerServiceClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/client/CloudControllerServiceClient.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/client/CloudControllerServiceClient.java
new file mode 100644
index 0000000..6dbba78
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/client/CloudControllerServiceClient.java
@@ -0,0 +1,94 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.adc.mgt.client;
+
+import java.rmi.RemoteException;
+
+import javax.activation.DataHandler;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.adc.mgt.exception.UnregisteredCartridgeException;
+import org.apache.stratos.adc.mgt.internal.DataHolder;
+import org.apache.stratos.cloud.controller.stub.CloudControllerServiceStub;
+import org.apache.stratos.cloud.controller.stub.CloudControllerServiceUnregisteredCartridgeExceptionException;
+import org.apache.stratos.cloud.controller.util.xsd.CartridgeInfo;
+import org.apache.stratos.cloud.controller.util.xsd.Properties;
+
+public class CloudControllerServiceClient {
+
+ private CloudControllerServiceStub stub;
+
+ private static final Log log = LogFactory.getLog(CloudControllerServiceClient.class);
+
+ public CloudControllerServiceClient(String epr) throws AxisFault {
+
+ ConfigurationContext clientConfigContext = DataHolder.getClientConfigContext();
+ try {
+ stub = new CloudControllerServiceStub(clientConfigContext, epr);
+ stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(300000);
+
+ } catch (AxisFault axisFault) {
+ String msg = "Failed to initiate AutoscalerService client. " + axisFault.getMessage();
+ log.error(msg, axisFault);
+ throw new AxisFault(msg, axisFault);
+ }
+
+ }
+
+ public boolean register(String domainName, String subDomain, String cartridgeType,
+ DataHandler payload, String tenantRange, String hostName, Properties properties) throws RemoteException, CloudControllerServiceUnregisteredCartridgeExceptionException
+ {
+ return stub.registerService(domainName, subDomain, tenantRange, cartridgeType, hostName,
+ properties, payload);
+
+ }
+
+ public String startInstance(String domain, String subDomain) throws Exception {
+ return stub.startInstance(domain, subDomain);
+ }
+
+ public boolean terminateAllInstances(String domain, String subDomain) throws Exception {
+ return stub.terminateAllInstances(domain, subDomain);
+ }
+
+ public String[] getRegisteredCartridges() throws Exception {
+ return stub.getRegisteredCartridges();
+ }
+
+ public boolean createKeyPair(String cartridge, String keyPairName, String publicKey)
+ throws Exception {
+ return stub.createKeyPairFromPublicKey(cartridge, keyPairName, publicKey);
+ }
+
+ public CartridgeInfo getCartridgeInfo(String cartridgeType) throws UnregisteredCartridgeException, Exception {
+ try {
+ return stub.getCartridgeInfo(cartridgeType);
+ } catch (RemoteException e) {
+ throw e;
+ } catch (CloudControllerServiceUnregisteredCartridgeExceptionException e) {
+ throw new UnregisteredCartridgeException("Not a registered cartridge " + cartridgeType, cartridgeType, e);
+ }
+ }
+
+ public boolean unregisterService(String domain, String subDomain) throws Exception {
+ return stub.unregisterService(domain, subDomain);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/client/RegistryClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/client/RegistryClient.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/client/RegistryClient.java
new file mode 100644
index 0000000..c1d6cd3
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/client/RegistryClient.java
@@ -0,0 +1,112 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.adc.mgt.client;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.UUID;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.commons.io.IOUtils;
+import org.wso2.carbon.registry.core.Association;
+import org.wso2.carbon.registry.core.Collection;
+import org.wso2.carbon.registry.core.Registry;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.registry.ws.client.registry.WSRegistryServiceClient;
+
+public class RegistryClient {
+
+ // url where the repository is running its services interface
+ private static String backendURL = "http://localhost:9763/services/";
+ private static ConfigurationContext configContext = null;
+
+ // configuration locations used to bootstrap axis2
+ private static String axis2Repo =
+ "/home/wso2/Desktop/HP-demo-packs-with-video/cartridge/wso2stratos-cartridge-1.0.0-SNAPSHOT/repository/conf/axis2";
+ private static String axis2Conf =
+ "/home/wso2/Desktop/HP-demo-packs-with-video/cartridge/wso2stratos-cartridge-1.0.0-SNAPSHOT/repository/conf/axis2/axis2_client.xml";
+ private static String serverURL = "https://localhost:9443/services/";
+
+ public RegistryClient() {
+ // TODO Auto-generated constructor stub
+ }
+
+ private static WSRegistryServiceClient initialize() throws Exception {
+ // set these properties, this is used for authentication over https to
+ // the registry
+ // if you have a newer version, you can update the keystore by copying
+ // it from
+ // the security directory of the repository
+ System.setProperty("javax.net.ssl.trustStore", "wso2carbon.jks");
+ System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");
+ System.setProperty("javax.net.ssl.trustStoreType", "JKS");
+
+ configContext =
+ ConfigurationContextFactory.createConfigurationContextFromFileSystem(axis2Repo,
+ axis2Conf);
+ return new WSRegistryServiceClient(serverURL, "admin", "admin", backendURL, configContext);
+ }
+
+ public static void addKey(String keyName, String content) throws Exception {
+ Registry registry = initialize();
+
+ // get the governance folder
+ Resource governanceFolder = registry.get("/_system/governance");
+ System.out.println("Folder description: " + governanceFolder.getDescription());
+ Resource r1 = registry.newResource();
+ String path = "/_system/governance/" + keyName;
+ r1.setContent(content);
+ registry.put(path, r1);
+
+ /*
+ * List<Resource> paths = getServicePath(registry,
+ * "/_system/governance/trunk/services");
+ *
+ * for (Resource service : paths) { // we've got all the services here
+ *
+ * Properties props = service.getProperties(); for (Object prop :
+ * props.keySet()) { System.out.println(prop + " - " + props.get(prop));
+ * }
+ *
+ * Association[] associations =
+ * registry.getAssociations(service.getPath(), "Documentation"); for
+ * (Association association : associations) {
+ * System.out.println(association.getAssociationType()); } }
+ */
+ }
+
+ private static List<Resource> getServicePath(Registry registry, String servicesResource)
+ throws RegistryException {
+ List<Resource> result = new ArrayList<Resource>();
+ Resource resource = registry.get(servicesResource);
+
+ if (resource instanceof Collection) {
+ Object content = resource.getContent();
+ for (Object path : (Object[]) content) {
+ result.addAll(getServicePath(registry, (String) path));
+ }
+ } else if (resource instanceof Resource) {
+ result.add(resource);
+ }
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/custom/domain/RegistryManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/custom/domain/RegistryManager.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/custom/domain/RegistryManager.java
new file mode 100644
index 0000000..d53fcc0
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/custom/domain/RegistryManager.java
@@ -0,0 +1,106 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.adc.mgt.custom.domain;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.adc.mgt.exception.ADCException;
+import org.apache.stratos.adc.mgt.exception.DomainMappingExistsException;
+import org.apache.stratos.adc.mgt.internal.DataHolder;
+import org.apache.stratos.adc.mgt.utils.CartridgeConstants;
+import org.wso2.carbon.registry.core.Collection;
+import org.wso2.carbon.registry.core.Registry;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+
+public class RegistryManager {
+ private static Log log = LogFactory.getLog(RegistryManager.class);
+ private static Registry registry = DataHolder.getRegistry();
+
+ public RegistryManager() {
+ try {
+ if (!registry.resourceExists(CartridgeConstants.DomainMappingInfo.HOSTINFO)) {
+ registry.put(CartridgeConstants.DomainMappingInfo.HOSTINFO,
+ registry.newCollection());
+ }
+ } catch (RegistryException e) {
+ String msg =
+ "Error while accessing registry or initializing domain mapping registry path\n";
+ log.error(msg + e.getMessage());
+ }
+ }
+
+ /**
+ *
+ */
+ public void addDomainMappingToRegistry(String hostName, String actualHost)
+ throws ADCException, RegistryException, DomainMappingExistsException {
+ try {
+ registry.beginTransaction();
+ Resource hostResource = registry.newResource();
+ hostResource.addProperty(CartridgeConstants.DomainMappingInfo.ACTUAL_HOST, actualHost);
+ if (!registry.resourceExists(CartridgeConstants.DomainMappingInfo.HOSTINFO +
+ hostName)) {
+ registry.put(CartridgeConstants.DomainMappingInfo.HOSTINFO + hostName,
+ hostResource);
+ } else {
+ registry.rollbackTransaction();
+ String msg = "Requested domain is already taken!";
+ log.error(msg);
+ throw new DomainMappingExistsException(msg, hostName);
+ }
+ registry.commitTransaction();
+ } catch (RegistryException e) {
+ registry.rollbackTransaction();
+ throw e;
+ }
+ }
+
+
+ /**
+ *
+ */
+ public void removeDomainMappingFromRegistry(String actualHost) throws Exception {
+ try {
+ registry.beginTransaction();
+ String hostResourcePath = CartridgeConstants.DomainMappingInfo.HOSTINFO;
+ if (registry.resourceExists(hostResourcePath)) {
+ Resource hostResource = registry.get(hostResourcePath);
+ Collection hostInfoCollection;
+ if(hostResource instanceof Collection){
+ hostInfoCollection = (Collection) hostResource;
+ } else {
+ throw new Exception("Resource is not a collection " + hostResourcePath );
+ }
+ String[] paths = hostInfoCollection.getChildren();
+ for (String path: paths){
+ Resource domainMapping = registry.get(path);
+ String actualHostInRegistry = domainMapping.getProperty(CartridgeConstants.DomainMappingInfo.ACTUAL_HOST);
+ if(actualHostInRegistry != null && actualHost.equalsIgnoreCase(actualHostInRegistry)){
+ registry.delete(path);
+ }
+ }
+ }
+ registry.commitTransaction();
+ } catch (RegistryException e) {
+ registry.rollbackTransaction();
+ log.error("Unable to remove the mapping", e);
+ throw e;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/CartridgeSubscription.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/CartridgeSubscription.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/CartridgeSubscription.java
new file mode 100644
index 0000000..9d48b0f
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/CartridgeSubscription.java
@@ -0,0 +1,186 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.adc.mgt.dao;
+
+import java.util.List;
+
+public class CartridgeSubscription {
+
+ private int subscriptionId;
+ private int tenantId;
+ private String cartridge;
+ private String provider;
+ private String hostName;
+ private String policy;
+ private List<PortMapping> portMappings;
+ private String clusterDomain;
+ private String clusterSubdomain;
+ private Repository repository;
+ private String state;
+ private String alias;
+ private String tenantDomain;
+ private DataCartridge dataCartridge;
+ private String baseDirectory;
+ private String mappedDomain;
+ private String mgtClusterDomain;
+ private String mgtClusterSubDomain;
+
+ public int getSubscriptionId() {
+ return subscriptionId;
+ }
+
+ public void setSubscriptionId(int subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ }
+
+ public int getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(int tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public String getCartridge() {
+ return cartridge;
+ }
+
+ public void setCartridge(String cartridge) {
+ this.cartridge = cartridge;
+ }
+
+ public String getProvider() {
+ return provider;
+ }
+
+ public void setProvider(String provider) {
+ this.provider = provider;
+ }
+
+ public String getHostName() {
+ return hostName;
+ }
+
+ public void setHostName(String hostName) {
+ this.hostName = hostName;
+ }
+
+ public String getPolicy() {
+ return policy;
+ }
+
+ public void setPolicy(String policy) {
+ this.policy = policy;
+ }
+
+ public List<PortMapping> getPortMappings() {
+ return portMappings;
+ }
+
+ public void setPortMappings(List<PortMapping> portMappings) {
+ this.portMappings = portMappings;
+ }
+
+ public String getClusterDomain() {
+ return clusterDomain;
+ }
+
+ public void setClusterDomain(String clusterDomain) {
+ this.clusterDomain = clusterDomain;
+ }
+
+ public String getClusterSubdomain() {
+ return clusterSubdomain;
+ }
+
+ public void setClusterSubdomain(String clusterSubdomain) {
+ this.clusterSubdomain = clusterSubdomain;
+ }
+
+ public Repository getRepository() {
+ return repository;
+ }
+
+ public void setRepository(Repository repository) {
+ this.repository = repository;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getAlias() {
+ return alias;
+ }
+
+ public void setAlias(String alias) {
+ this.alias = alias;
+ }
+
+ public String getTenantDomain() {
+ return tenantDomain;
+ }
+
+ public void setTenantDomain(String tenantDomain) {
+ this.tenantDomain = tenantDomain;
+ }
+
+ public DataCartridge getDataCartridge() {
+ return dataCartridge;
+ }
+
+ public void setDataCartridge(DataCartridge dataCartridge) {
+ this.dataCartridge = dataCartridge;
+ }
+
+ public String getBaseDirectory() {
+ return baseDirectory;
+ }
+
+ public void setBaseDirectory(String baseDirectory) {
+ this.baseDirectory = baseDirectory;
+ }
+
+ public String getMappedDomain() {
+ return mappedDomain;
+ }
+
+ public void setMappedDomain(String mappedDomain) {
+ this.mappedDomain = mappedDomain;
+ }
+
+ public String getMgtClusterDomain() {
+ return mgtClusterDomain;
+ }
+
+ public void setMgtClusterDomain(String mgtClusterDomain) {
+ this.mgtClusterDomain = mgtClusterDomain;
+ }
+
+ public String getMgtClusterSubDomain() {
+ return mgtClusterSubDomain;
+ }
+
+ public void setMgtClusterSubDomain(String mgtClusterSubDomain) {
+ this.mgtClusterSubDomain = mgtClusterSubDomain;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/DataCartridge.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/DataCartridge.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/DataCartridge.java
new file mode 100644
index 0000000..8e43079
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/DataCartridge.java
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.adc.mgt.dao;
+
+public class DataCartridge {
+
+ private int id;
+ private String dataCartridgeType;
+ private String userName;
+ private String password;
+ public int getId() {
+ return id;
+ }
+ public void setId(int id) {
+ this.id = id;
+ }
+ public String getDataCartridgeType() {
+ return dataCartridgeType;
+ }
+ public void setDataCartridgeType(String dataCartridgeType) {
+ this.dataCartridgeType = dataCartridgeType;
+ }
+ public String getUserName() {
+ return userName;
+ }
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+ public String getPassword() {
+ return password;
+ }
+ public void setPassword(String password) {
+ this.password = password;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/PortMapping.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/PortMapping.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/PortMapping.java
new file mode 100644
index 0000000..5916847
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/PortMapping.java
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.adc.mgt.dao;
+
+public class PortMapping {
+ private int id;
+ private String type;
+ private String primaryPort;
+ private String proxyPort;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getPrimaryPort() {
+ return primaryPort;
+ }
+
+ public void setPrimaryPort(String primaryPort) {
+ this.primaryPort = primaryPort;
+ }
+
+ public String getProxyPort() {
+ return proxyPort;
+ }
+
+ public void setProxyPort(String proxyPort) {
+ this.proxyPort = proxyPort;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/Repository.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/Repository.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/Repository.java
new file mode 100644
index 0000000..a951e78
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/Repository.java
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.adc.mgt.dao;
+
+public class Repository {
+ private int repoId;
+ private String repoName;
+ private String repoUserName;
+ private String repoUserPassword;
+
+ public int getRepoId() {
+ return repoId;
+ }
+
+ public void setRepoId(int repoId) {
+ this.repoId = repoId;
+ }
+
+ public String getRepoName() {
+ return repoName;
+ }
+
+ public void setRepoName(String repoName) {
+ this.repoName = repoName;
+ }
+
+ public String getRepoUserName() {
+ return repoUserName;
+ }
+
+ public void setRepoUserName(String repoUserName) {
+ this.repoUserName=repoUserName;
+ }
+
+ public String getRepoUserPassword() {
+ return repoUserPassword;
+ }
+
+ public void setRepoUserPassword(String repoUserPassword) {
+ this.repoUserPassword=repoUserPassword;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/RepositoryCredentials.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/RepositoryCredentials.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/RepositoryCredentials.java
new file mode 100644
index 0000000..90670e7
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dao/RepositoryCredentials.java
@@ -0,0 +1,27 @@
+package org.apache.stratos.adc.mgt.dao;
+
+public class RepositoryCredentials {
+
+ private String url;
+ private String userName;
+ private String password;
+ public String getUrl() {
+ return url;
+ }
+ public void setUrl(String url) {
+ this.url = url;
+ }
+ public String getUserName() {
+ return userName;
+ }
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+ public String getPassword() {
+ return password;
+ }
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dns/DNSManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dns/DNSManager.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dns/DNSManager.java
new file mode 100644
index 0000000..ceb77fb
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dns/DNSManager.java
@@ -0,0 +1,86 @@
+ /*
+ * 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.
+ */
+
+package org.apache.stratos.adc.mgt.dns;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.adc.mgt.utils.CartridgeConstants;
+
+/**
+ * This class is for handling dns entries.
+ */
+public class DNSManager {
+ private static final Log log = LogFactory.getLog(DNSManager.class);
+
+ /**
+ * This is get called when there is a need of adding new sub domain to
+ * exciting domain.
+ * It will append required text to bind9 zone file and reload bind9 server.
+ * Note: make sure the user who run ADC has got rights to run sudo scripts
+ * without password
+ *
+ * @param subDomain
+ * will be added in front of domain
+ */
+ public void addNewSubDomain(String subDomain, String ip) {
+ try {
+ Runtime.getRuntime()
+ .exec(CartridgeConstants.SUDO_SH + " " +
+ // script script file that will be used to edit
+ // required files
+ System.getProperty(CartridgeConstants.APPEND_SCRIPT) + " " +
+ subDomain + " " +
+ // machineIp ip of the machine DNS bind service
+ // is running
+ ip + " " +
+ // bindFile the file which we edit to append
+ // the DNS entry
+ System.getProperty(CartridgeConstants.BIND_FILE_PATH));
+ log.info("New sub domain is added to zone file");
+ } catch (Exception e) {
+ log.error(e.getMessage());
+ throw new RuntimeException(e);
+ }
+ }
+ /**
+ * This is get called when there is a need of remove a sub domain.
+ * It will remove required text from bind9 zone file and reload bind9 server.
+ * Note: make sure the user who run ADC has got rights to run sudo scripts
+ * without password
+ *
+ * @param subDomain
+ * will be used to delete the entry related to this
+ */
+ public void removeSubDomain(String subDomain) {
+ try {
+ Runtime.getRuntime()
+ .exec(CartridgeConstants.SUDO_SH + " " +
+ // script script file that will be used to edit
+ // required files
+ System.getProperty(CartridgeConstants.REMOVE_SCRIPT) + " " +
+ subDomain + " " +
+ // bindFile the file which we edit to remove
+ // the DNS entry
+ System.getProperty(CartridgeConstants.BIND_FILE_PATH));
+ log.info("Sub domain is removed from zone file");
+ } catch (Exception e) {
+ log.error(e.getMessage());
+ throw new RuntimeException(e);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/AppRepo.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/AppRepo.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/AppRepo.java
new file mode 100644
index 0000000..facfbe3
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/AppRepo.java
@@ -0,0 +1,85 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.adc.mgt.dto;
+
+public class AppRepo {
+
+ private int tenantId;
+ private String repoName;
+ private String cartridge;
+ private String appName;
+ private boolean isWebRoot;
+ private String tenantPubKey;
+ private String tenantCartridgePubKey;
+
+ public int getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(int tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public String getRepoName() {
+ return repoName;
+ }
+
+ public void setRepoName(String repoName) {
+ this.repoName = repoName;
+ }
+
+ public String getCartridge() {
+ return cartridge;
+ }
+
+ public void setCartridge(String cartridge) {
+ this.cartridge = cartridge;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public boolean isWebRoot() {
+ return isWebRoot;
+ }
+
+ public void setWebRoot(boolean isWebRoot) {
+ this.isWebRoot = isWebRoot;
+ }
+
+ public String getTenantPubKey() {
+ return tenantPubKey;
+ }
+
+ public void setTenantPubKey(String tenantPubKey) {
+ this.tenantPubKey = tenantPubKey;
+ }
+
+ public String getTenantCartridgePubKey() {
+ return tenantCartridgePubKey;
+ }
+
+ public void setTenantCartridgePubKey(String tenantCartridgePubKey) {
+ this.tenantCartridgePubKey = tenantCartridgePubKey;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/Cartridge.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/Cartridge.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/Cartridge.java
new file mode 100644
index 0000000..4d990ce
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/Cartridge.java
@@ -0,0 +1,198 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.adc.mgt.dto;
+
+public class Cartridge implements Comparable<Cartridge> {
+
+ private String displayName;
+ private String description;
+ private String cartridgeAlias;
+ private String cartridgeType;
+ private int activeInstances;
+ private String status;
+ private String ip;
+ private String password;
+ private String provider;
+ private String version;
+ private boolean multiTenant;
+ private String hostName;
+ private String policy;
+ private String policyDescription;
+ private String repoURL;
+ private String dbUserName;
+ private String mappedDomain;
+
+ private String[] accessURLs;
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getCartridgeAlias() {
+ return cartridgeAlias;
+ }
+
+ public void setCartridgeAlias(String cartridgeAlias) {
+ this.cartridgeAlias = cartridgeAlias;
+ }
+
+ public String getCartridgeType() {
+ return cartridgeType;
+ }
+
+ public void setCartridgeType(String cartridgeType) {
+ this.cartridgeType = cartridgeType;
+ }
+
+ public int getActiveInstances() {
+ return activeInstances;
+ }
+
+ public void setActiveInstances(int activeInstances) {
+ this.activeInstances = activeInstances;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getIp() {
+ return ip;
+ }
+
+ public void setIp(String ip) {
+ this.ip = ip;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getProvider() {
+ return provider;
+ }
+
+ public void setProvider(String provider) {
+ this.provider = provider;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public boolean isMultiTenant() {
+ return multiTenant;
+ }
+
+ public void setMultiTenant(boolean multiTenant) {
+ this.multiTenant = multiTenant;
+ }
+
+ public String getHostName() {
+ return hostName;
+ }
+
+ public void setHostName(String hostName) {
+ this.hostName = hostName;
+ }
+
+ public String getPolicy() {
+ return policy;
+ }
+
+ public void setPolicy(String policy) {
+ this.policy = policy;
+ }
+
+ public String getPolicyDescription() {
+ return policyDescription;
+ }
+
+ public void setPolicyDescription(String policyDescription) {
+ this.policyDescription = policyDescription;
+ }
+
+ public String getRepoURL() {
+ return repoURL;
+ }
+
+ public void setRepoURL(String repoURL) {
+ this.repoURL = repoURL;
+ }
+
+ public String getDbUserName() {
+ return dbUserName;
+ }
+
+ public String[] getAccessURLs() {
+ return accessURLs;
+ }
+
+ public void setAccessURLs(String[] accessURLs) {
+ this.accessURLs = accessURLs;
+ }
+
+ public void setDbUserName(String dbUserName) {
+ this.dbUserName = dbUserName;
+ }
+
+ public String getMappedDomain() {
+ return mappedDomain;
+ }
+
+ public void setMappedDomain(String mappedDomain) {
+ this.mappedDomain = mappedDomain;
+ }
+
+ @Override
+ public int compareTo(Cartridge o) {
+ int compare = 0;
+ if (cartridgeAlias != null && o.cartridgeAlias != null) {
+ compare = cartridgeAlias.compareTo(o.cartridgeAlias);
+ }
+ if (compare == 0 && cartridgeType != null && o.cartridgeType != null) {
+ compare = cartridgeType.compareTo(o.cartridgeType);
+ }
+ return compare;
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/CartridgeDetail.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/CartridgeDetail.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/CartridgeDetail.java
new file mode 100644
index 0000000..48a0086
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/CartridgeDetail.java
@@ -0,0 +1 @@
+package org.apache.stratos.adc.mgt.dto;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/CartridgeInformation.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/CartridgeInformation.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/CartridgeInformation.java
new file mode 100644
index 0000000..48a0086
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/CartridgeInformation.java
@@ -0,0 +1 @@
+package org.apache.stratos.adc.mgt.dto;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/CartridgeWrapper.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/CartridgeWrapper.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/CartridgeWrapper.java
new file mode 100644
index 0000000..1339a16
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/CartridgeWrapper.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.stratos.adc.mgt.dto;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.wso2.carbon.utils.Pageable;
+
+/**
+ * This class holds paginated information about cartridges
+ */
+public final class CartridgeWrapper implements Pageable {
+
+ private Cartridge[] cartridges;
+ private int numberOfPages;
+
+ public CartridgeWrapper() {
+ }
+
+ public int getNumberOfPages() {
+ return numberOfPages;
+ }
+
+ public void setNumberOfPages(int numberOfPages) {
+ this.numberOfPages = numberOfPages;
+ }
+
+ public <T> void set(List<T> items) {
+ this.cartridges = items.toArray(new Cartridge[items.size()]);
+ }
+
+ public Cartridge[] getCartridges() {
+ return cartridges != null ? Arrays.copyOf(cartridges, cartridges.length) : null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/Policy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/Policy.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/Policy.java
new file mode 100644
index 0000000..451618d
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/Policy.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2013, WSO2, Inc. http://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
+ */
+package org.apache.stratos.adc.mgt.dto;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+public class Policy implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String name;
+ private String description;
+ private boolean defaultPolicy;
+
+ private Integer minAppInstances;
+ private Integer maxAppInstances;
+ private Integer maxRequestsPerSecond;
+ private BigDecimal alarmingUpperRate;
+ private BigDecimal alarmingLowerRate;
+ private BigDecimal scaleDownFactor;
+ private Integer roundsToAverage;
+
+ public Policy() {
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public boolean isDefaultPolicy() {
+ return defaultPolicy;
+ }
+
+ public void setDefaultPolicy(boolean defaultPolicy) {
+ this.defaultPolicy = defaultPolicy;
+ }
+
+ public Integer getMinAppInstances() {
+ return minAppInstances;
+ }
+
+ public void setMinAppInstances(Integer minAppInstances) {
+ this.minAppInstances = minAppInstances;
+ }
+
+ public Integer getMaxAppInstances() {
+ return maxAppInstances;
+ }
+
+ public void setMaxAppInstances(Integer maxAppInstances) {
+ this.maxAppInstances = maxAppInstances;
+ }
+
+ public Integer getMaxRequestsPerSecond() {
+ return maxRequestsPerSecond;
+ }
+
+ public void setMaxRequestsPerSecond(Integer maxRequestsPerSecond) {
+ this.maxRequestsPerSecond = maxRequestsPerSecond;
+ }
+
+ public BigDecimal getAlarmingUpperRate() {
+ return alarmingUpperRate;
+ }
+
+ public void setAlarmingUpperRate(BigDecimal alarmingUpperRate) {
+ this.alarmingUpperRate = alarmingUpperRate;
+ }
+
+ public BigDecimal getAlarmingLowerRate() {
+ return alarmingLowerRate;
+ }
+
+ public void setAlarmingLowerRate(BigDecimal alarmingLowerRate) {
+ this.alarmingLowerRate = alarmingLowerRate;
+ }
+
+ public BigDecimal getScaleDownFactor() {
+ return scaleDownFactor;
+ }
+
+ public void setScaleDownFactor(BigDecimal scaleDownFactor) {
+ this.scaleDownFactor = scaleDownFactor;
+ }
+
+ public Integer getRoundsToAverage() {
+ return roundsToAverage;
+ }
+
+ public void setRoundsToAverage(Integer roundsToAverage) {
+ this.roundsToAverage = roundsToAverage;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof Policy))
+ return false;
+ Policy other = (Policy) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/PolicyDefinition.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/PolicyDefinition.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/PolicyDefinition.java
new file mode 100644
index 0000000..b21df4f
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/PolicyDefinition.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2013, WSO2, Inc. http://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
+ */
+package org.apache.stratos.adc.mgt.dto;
+
+import java.io.Serializable;
+
+public class PolicyDefinition implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String name;
+ private String description;
+ private boolean defaultPolicy;
+
+ public PolicyDefinition() {
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public boolean isDefaultPolicy() {
+ return defaultPolicy;
+ }
+
+ public void setDefaultPolicy(boolean defaultPolicy) {
+ this.defaultPolicy = defaultPolicy;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof PolicyDefinition))
+ return false;
+ PolicyDefinition other = (PolicyDefinition) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4f217859/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/RepositoryInformation.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/RepositoryInformation.java b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/RepositoryInformation.java
new file mode 100644
index 0000000..3a88700
--- /dev/null
+++ b/components/org.apache.stratos.adc.mgt/2.1.3/src/main/java/org/apache/stratos/adc/mgt/dto/RepositoryInformation.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2013, WSO2, Inc. http://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
+ */
+package org.apache.stratos.adc.mgt.dto;
+
+import java.io.Serializable;
+
+public class RepositoryInformation implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String repoURL;
+ private String[] refName;
+
+ public String getRepoURL() {
+ return repoURL;
+ }
+
+ public void setRepoURL(String repoURL) {
+ this.repoURL = repoURL;
+ }
+
+ public String[] getRefName() {
+ return refName;
+ }
+
+ public void setRefName(String[] refName) {
+ this.refName = refName;
+ }
+
+}