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 18:51:51 UTC
[16/45] fixing component version issues and adding currently
refactored components to the parent pom
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/util/StratosConfiguration.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/util/StratosConfiguration.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/util/StratosConfiguration.java
new file mode 100644
index 0000000..2226593
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/util/StratosConfiguration.java
@@ -0,0 +1,319 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.common.util;
+
+import java.lang.String;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Class for the stratos specific parameters configuration
+ */
+public class StratosConfiguration {
+
+ // By default email sending is disabled. Changed according to the configuration file.
+ private boolean emailsDisabled = true;
+
+ private boolean emailValidationRequired = false;
+ private boolean isPublicCloudSetup = true;
+ private boolean isTenantActivationModerated = false;
+ private boolean chargeOnRegistration = false;
+ private String SuperAdminEmail = "";
+ private String paypalUrl = "";
+ private String paypalAPIUsername = "";
+ private String paypalAPIPassword = "";
+ private String paypalAPISignature = "";
+ private String paypalEnvironment="";
+ private String usagePlanURL = "";
+ private String paidJIRAUrl = "";
+ private String paidJIRAProject = "";
+ private String forumUrl = "";
+ private String paidUserGroup = "";
+ private String nonpaidUserGroup = "";
+ private String supportInfoUrl = "";
+ private String incidentCustomFieldId = ""; // todo this is a custom field id of JIRA, this need to be dynamically get in jira reporting component
+ private String incidentImpactCustomFieldId = "";
+ private String stratosEventListenerName ="";
+ private Map<String, String> stratosEventProperties = new HashMap<String, String>();
+ private String googleAnalyticsURL;
+ private String managerServiceUrl = "";
+ private String adminUserName = "";
+ private String adminPassword = "";
+ private String ssoLoadingMessage="";
+
+ /**
+ * @return Stratos Manager service url
+ */
+ public String getManagerServiceUrl() {
+ return managerServiceUrl;
+ }
+
+ public void setManagerServiceUrl(String managerServiceUrl) {
+ this.managerServiceUrl = managerServiceUrl;
+ }
+
+ /**
+ * @return Super admin User name
+ */
+ public String getAdminUserName() {
+ return adminUserName;
+ }
+
+ public void setAdminUserName(String adminUserName) {
+ this.adminUserName = adminUserName;
+ }
+
+ /**
+ * @return super admin password
+ */
+ public String getAdminPassword() {
+ return adminPassword;
+ }
+
+ public void setAdminPassword(String adminPassword) {
+ this.adminPassword = adminPassword;
+ }
+
+ //This parameter used to skip usage summary generator
+ private boolean skipSummaryGenerator = false;
+
+ public boolean isSkipSummaryGenerator() {
+ return skipSummaryGenerator;
+ }
+
+ public void setSkipSummaryGenerator(boolean skipSummaryGenerator) {
+ this.skipSummaryGenerator = skipSummaryGenerator;
+ }
+ //This is the url that we pointed users when they need to aware about usage plans
+
+ public String getUsagePlanURL() {
+ return usagePlanURL;
+ }
+
+ public void setUsagePlanURL(String usagePlanURL) {
+ this.usagePlanURL = usagePlanURL;
+ }
+
+ //Email address for general notifications
+ private String notificationEmail = "";
+ //Email address for finance related notifications
+ private String financeNotificationEmail = "";
+
+ public boolean isTenantActivationModerated() {
+ return isTenantActivationModerated;
+ }
+
+ public void setTenantActivationModerated(boolean tenantActivationModerated) {
+ isTenantActivationModerated = tenantActivationModerated;
+ }
+
+ public String getSuperAdminEmail() {
+ return SuperAdminEmail;
+ }
+
+ public void setSuperAdminEmail(String superAdminEmail) {
+ SuperAdminEmail = superAdminEmail;
+ }
+
+ public boolean getEmailValidationRequired() {
+ return emailValidationRequired;
+ }
+
+ public String getPaypalUrl() {
+ return paypalUrl;
+ }
+
+ public void setPaypalUrl(String paypalUrl) {
+ this.paypalUrl = paypalUrl;
+ }
+
+ public void setEmailValidationRequired(boolean emailValidationRequired) {
+ this.emailValidationRequired = emailValidationRequired;
+ }
+
+ public boolean isPublicCloudSetup() {
+ return isPublicCloudSetup;
+ }
+
+ public void setPublicCloudSetup(boolean publicCloudSetup) {
+ isPublicCloudSetup = publicCloudSetup;
+ }
+
+ public String getNotificationEmail() {
+ return notificationEmail;
+ }
+
+ public void setNotificationEmail(String notificationEmail) {
+ this.notificationEmail = notificationEmail;
+ }
+
+ public String getPaypalAPIUsername() {
+ return paypalAPIUsername;
+ }
+
+ public void setPaypalAPIUsername(String paypalAPIUsername) {
+ this.paypalAPIUsername = paypalAPIUsername;
+ }
+
+ public String getPaypalAPIPassword() {
+ return paypalAPIPassword;
+ }
+
+ public void setPaypalAPIPassword(String paypalAPIPassword) {
+ this.paypalAPIPassword = paypalAPIPassword;
+ }
+
+ public String getPaypalAPISignature() {
+ return paypalAPISignature;
+ }
+
+ public void setPaypalAPISignature(String paypalAPISignature) {
+ this.paypalAPISignature = paypalAPISignature;
+ }
+
+ public String getFinanceNotificationEmail() {
+ return financeNotificationEmail;
+ }
+
+ public void setFinanceNotificationEmail(String financeNotificationEmail) {
+ this.financeNotificationEmail = financeNotificationEmail;
+ }
+
+ public String getPaidJIRAUrl() {
+ return paidJIRAUrl;
+ }
+
+ public void setPaidJIRAUrl(String paidJIRAUrl) {
+ this.paidJIRAUrl = paidJIRAUrl;
+ }
+
+ public String getPaidJIRAProject() {
+ return paidJIRAProject;
+ }
+
+ public void setPaidJIRAProject(String paidJIRAProject) {
+ this.paidJIRAProject = paidJIRAProject;
+ }
+
+ public String getForumUrl() {
+ return forumUrl;
+ }
+
+ public void setForumUrl(String forumUrl) {
+ this.forumUrl = forumUrl;
+ }
+
+ public String getPaidUserGroup() {
+ return paidUserGroup;
+ }
+
+ public void setPaidUserGroup(String paidUserGroup) {
+ this.paidUserGroup = paidUserGroup;
+ }
+
+ public String getNonpaidUserGroup() {
+ return nonpaidUserGroup;
+ }
+
+ public void setNonpaidUserGroup(String nonpaidUserGroup) {
+ this.nonpaidUserGroup = nonpaidUserGroup;
+ }
+
+ public String getSupportInfoUrl() {
+ return supportInfoUrl;
+ }
+
+ public void setSupportInfoUrl(String supportInfoUrl) {
+ this.supportInfoUrl = supportInfoUrl;
+ }
+
+ public String getIncidentCustomFieldId() {
+ return incidentCustomFieldId;
+ }
+
+ public void setIncidentCustomFieldId(String incidentCustomFieldId) {
+ this.incidentCustomFieldId = incidentCustomFieldId;
+ }
+
+ public String getIncidentImpactCustomFieldId() {
+ return incidentImpactCustomFieldId;
+ }
+
+ public void setIncidentImpactCustomFieldId(String incidentImpactCustomFieldId) {
+ this.incidentImpactCustomFieldId = incidentImpactCustomFieldId;
+ }
+
+ public String getStratosEventListenerName() {
+ return stratosEventListenerName;
+ }
+
+ public void setStratosEventListenerName(String stratosEventListenerName) {
+ this.stratosEventListenerName = stratosEventListenerName;
+ }
+
+ public String getStratosEventListenerPropertyValue(String key) {
+ return stratosEventProperties.get(key);
+ }
+
+ public void setStratosEventListenerProperty(String key, String value) {
+ stratosEventProperties.put(key, value);
+ }
+
+ public String getPaypalEnvironment() {
+ return paypalEnvironment;
+ }
+
+ public void setPaypalEnvironment(String paypalEnvironment) {
+ this.paypalEnvironment = paypalEnvironment;
+ }
+
+ public String getGoogleAnalyticsURL() {
+ return googleAnalyticsURL;
+ }
+
+ public void setGoogleAnalyticsURL(String googleAnalyticsURL) {
+ this.googleAnalyticsURL = googleAnalyticsURL;
+ }
+
+ public boolean isEmailsDisabled() {
+ return emailsDisabled;
+ }
+
+ public void setEmailsDisabled(boolean emailsDisabled) {
+ this.emailsDisabled = emailsDisabled;
+ }
+
+ public boolean isChargeOnRegistration() {
+ return chargeOnRegistration;
+ }
+
+ public void setChargeOnRegistration(boolean chargeOnRegistration) {
+ this.chargeOnRegistration = chargeOnRegistration;
+ }
+
+ public String getSsoLoadingMessage() {
+ return ssoLoadingMessage;
+ }
+
+ public void setSsoLoadingMessage(String ssoLoadingMessage) {
+ this.ssoLoadingMessage = ssoLoadingMessage;
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.common/src/main/resources/META-INF/services.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/resources/META-INF/services.xml b/components/org.apache.stratos.common/src/main/resources/META-INF/services.xml
new file mode 100644
index 0000000..7f0bcf3
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/resources/META-INF/services.xml
@@ -0,0 +1,34 @@
+<?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.
+ -->
+<serviceGroup>
+
+ <service name="PackageInfoService" scope="transportsession">
+ <transports>
+ <transport>https</transport>
+ </transports>
+ <parameter name="ServiceClass" locked="false">
+ org.apache.stratos.common.services.PackageInfoService
+ </parameter>
+ <parameter name="adminService" locked="ture">false</parameter>
+ </service>
+
+ <parameter name="hiddenService" locked="ture">true</parameter>
+
+</serviceGroup>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.common/src/main/resources/cloud-services-desc.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/resources/cloud-services-desc.xml b/components/org.apache.stratos.common/src/main/resources/cloud-services-desc.xml
new file mode 100644
index 0000000..15fb4b9
--- /dev/null
+++ b/components/org.apache.stratos.common/src/main/resources/cloud-services-desc.xml
@@ -0,0 +1,109 @@
+<!--
+ ~ Copyright (c) 2005-2010, 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.
+ -->
+<cloudServices xmlns="http://wso2.com/carbon/cloud/mgt/services">
+ <cloudService name="WSO2 Stratos Manager">
+ </cloudService>
+ <cloudService name="WSO2 Enterprise Service Bus" default="true">
+ <label>Enterprise Service Bus</label>
+ <link>https://esb.stratoslive.wso2.com</link>
+ <icon>
+ https://localhost:9443/cloud-services-icons/esb.gif
+ </icon>
+ <description>Enterprise Service Bus in the cloud.</description>
+ </cloudService>
+ <cloudService name="WSO2 Application Server" default="true">
+ <label>Application Server</label>
+ <link>https://appserver.stratoslive.wso2.com</link>
+ <icon>
+ https://localhost:9443/cloud-services-icons/appserver.gif
+ </icon>
+ <description>Application Server in the cloud.</description>
+ </cloudService>
+ <cloudService name="WSO2 Data Services Server" default="true">
+ <label>Data Services Server</label>
+ <link>https://dss.stratoslive.wso2.com</link>
+ <icon>
+ https://localhost:9443/cloud-services-icons/ds.gif
+ </icon>
+ <description>Data Services Server in the cloud.</description>
+ </cloudService>
+ <cloudService name="WSO2 Governance" default="true">
+ <label>Governance</label>
+ <link>https://governance.stratoslive.wso2.com</link>
+ <description>Governance in the cloud.</description>
+ <icon>
+ https://localhost:9443/cloud-services-icons/governance.gif
+ </icon>
+ </cloudService>
+ <cloudService name="WSO2 Identity" default="true">
+ <label>Identity</label>
+ <link>https://identity.stratoslive.wso2.com</link>
+ <icon>
+ https://localhost:9443/cloud-services-icons/identity.gif
+ </icon>
+ <description>Identity in the cloud.</description>
+ </cloudService>
+ <cloudService name="WSO2 Business Activity Monitor" default="true">
+ <label>Business Activity Monitor</label>
+ <link>https://bam.stratoslive.wso2.com</link>
+ <icon>
+ https://localhost:9443/cloud-services-icons/bam.gif
+ </icon>
+ <description>Business Activity Monitor in the cloud.</description>
+ </cloudService>
+ <cloudService name="WSO2 Business Process Server" default="true">
+ <label>Business Process Server</label>
+ <link>https://bps.stratoslive.wso2.com</link>
+ <icon>
+ https://localhost:9443/cloud-services-icons/bps.gif
+ </icon>
+ <description>Business Process Server in the cloud.</description>
+ </cloudService>
+ <cloudService name="WSO2 Business Rule Server" default="true">
+ <label>Business Rule Server</label>
+ <link>https://brs.stratoslive.wso2.com</link>
+ <icon>
+ https://localhost:9443/cloud-services-icons/brs.gif
+ </icon>
+ <description>Business Rule Server in the cloud.</description>
+ </cloudService>
+ <cloudService name="WSO2 Mashup Server" default="true">
+ <label>Mashup Server</label>
+ <link>https://mashup.stratoslive.wso2.com</link>
+ <icon>
+ https://localhost:9443/cloud-services-icons/mashup.gif
+ </icon>
+ <description>Mashup Server in the cloud.</description>
+ </cloudService>
+ <cloudService name="WSO2 Gadgets" default="true">
+ <label>Gadgets</label>
+ <link>https://gadget.stratoslive.wso2.com</link>
+ <icon>
+ https://localhost:9443/cloud-services-icons/gadget.gif
+ </icon>
+ <description>Gadgets in the cloud.</description>
+ </cloudService>
+ <cloudService name="WSO2 Cloud Services Gateway" default="true">
+ <label>Cloud Gateway</label>
+ <link>https://csg.stratoslive.wso2.com</link>
+ <icon>
+ https://localhost:9443/cloud-services-icons/csg.gif
+ </icon>
+ <description>WSO2 Cloud Services Gateway in the cloud.</description>
+ </cloudService>
+</cloudServices>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/CommonTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/CommonTest.java b/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/CommonTest.java
new file mode 100644
index 0000000..dc61fc4
--- /dev/null
+++ b/components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/CommonTest.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.common.test;
+
+import junit.framework.TestCase;
+import org.apache.stratos.common.util.CommonUtil;
+
+public class CommonTest extends TestCase {
+ public void testEmailValidation() throws Exception {
+ try {
+ CommonUtil.validateEmail("damn@right.com");
+ assertTrue(true);
+ } catch (Exception e) {
+ assertTrue(false);
+ }
+
+ try {
+ CommonUtil.validateEmail("damn@right].com");
+ assertTrue(false);
+ } catch (Exception e) {
+ assertTrue(true);
+ assertEquals("Wrong characters in the email.", e.getMessage());
+ }
+
+ try {
+ CommonUtil.validateEmail("damn@right@wrong.com");
+ assertTrue(false);
+ } catch (Exception e) {
+ assertTrue(true);
+ assertEquals("Invalid email address is provided.", e.getMessage());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.deployment/2.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.deployment/2.1.0/pom.xml b/components/org.apache.stratos.deployment/2.1.0/pom.xml
deleted file mode 100644
index 25caef9..0000000
--- a/components/org.apache.stratos.deployment/2.1.0/pom.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<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>3.0.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>org.apache.stratos.deployment</artifactId>
- <version>2.1.0</version>
- <packaging>bundle</packaging>
- <name>Apache Stratos - Deployment</name>
-
- <build>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <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>
- <Private-Package>
- org.apache.stratos.deployment.internal.*
- </Private-Package>
- <Export-Package>
- !org.apache.stratos.deployment.internal.*,
- org.apache.stratos.deployment.*
- </Export-Package>
- <Import-Package>
- !javax.xml.namespace,
- org.apache.axis2.*; version="${axis2.osgi.version.range}",
- javax.xml.namespace; version=0.0.0,
- javax.servlet;version="${imp.pkg.version.javax.servlet}",
- javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
- *;resolution:=optional
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.stratos.common</artifactId>
- <version>2.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.axis2.wso2</groupId>
- <artifactId>axis2</artifactId>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
- <dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.registry.core</artifactId>
- <version>${wso2carbon.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
- </dependencies>
-</project>
-
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/CloudDeploymentInterceptor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/CloudDeploymentInterceptor.java b/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/CloudDeploymentInterceptor.java
deleted file mode 100644
index 469c459..0000000
--- a/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/CloudDeploymentInterceptor.java
+++ /dev/null
@@ -1,91 +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.deployment;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.description.AxisModule;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.AxisEvent;
-import org.apache.axis2.engine.AxisObserver;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-
-/**
- * Deployment interceptor for handling modification of ServiceAdmin so that the service list is not
- * displayed when the user has not logged in.
- */
-public class CloudDeploymentInterceptor implements AxisObserver {
- private static final Log log = LogFactory.getLog(CloudDeploymentInterceptor.class);
-
- public void init(AxisConfiguration axisConfiguration) {
- }
-
- public void serviceUpdate(AxisEvent axisEvent, AxisService axisService) {
- try {
- if (axisEvent.getEventType() == AxisEvent.SERVICE_DEPLOY &&
- axisService.getName().equals("ServiceAdmin")){
- AxisOperation operation = axisService.getOperation(new QName("listServiceGroups"));
- ArrayList<Parameter> params = operation.getParameters();
- for(Parameter param: params) {
- operation.removeParameter(param);
- }
- Parameter authAction = new Parameter("AuthorizationAction",
- "/permission/admin/manage/monitor/service");
- operation.addParameter(authAction);
- }
- } catch (AxisFault e) {
- log.error("Cannot add AuthorizationAction parameter to ServiceAdmin", e);
- }
- }
-
- public void serviceGroupUpdate(AxisEvent axisEvent, AxisServiceGroup axisServiceGroup) {
- }
-
- public void moduleUpdate(AxisEvent axisEvent, AxisModule axisModule) {
- }
-
- public void addParameter(Parameter parameter) throws AxisFault {
- }
-
- public void removeParameter(Parameter parameter) throws AxisFault {
- }
-
- public void deserializeParameters(OMElement omElement) throws AxisFault {
- }
-
- public Parameter getParameter(String s) {
- return null;
- }
-
- public ArrayList<Parameter> getParameters() {
- return null;
- }
-
- public boolean isParameterLocked(String s) {
- return false;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/SuperTenantRolePlayer.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/SuperTenantRolePlayer.java b/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/SuperTenantRolePlayer.java
deleted file mode 100644
index efd37d9..0000000
--- a/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/SuperTenantRolePlayer.java
+++ /dev/null
@@ -1,45 +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.deployment;
-
-import org.apache.axiom.soap.RolePlayer;
-import org.wso2.carbon.base.MultitenantConstants;
-import org.wso2.carbon.context.CarbonContext;
-
-import java.util.List;
-import java.util.ArrayList;
-
-public class SuperTenantRolePlayer implements RolePlayer{
-
- private List<String> roles;
-
- public SuperTenantRolePlayer() {
- this.roles = new ArrayList<String>();
- this.roles.add("supertenant");
- }
-
- public List getRoles() {
- return this.roles;
- }
-
- public boolean isUltimateDestination() {
- return (CarbonContext.getCurrentContext().getTenantId() ==
- MultitenantConstants.SUPER_TENANT_ID);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/internal/CloudDeploymentServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/internal/CloudDeploymentServiceComponent.java b/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/internal/CloudDeploymentServiceComponent.java
deleted file mode 100644
index 926264f..0000000
--- a/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/internal/CloudDeploymentServiceComponent.java
+++ /dev/null
@@ -1,73 +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.deployment.internal;
-
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.AxisObserver;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.deployment.CloudDeploymentInterceptor;
-import org.apache.stratos.deployment.SuperTenantRolePlayer;
-import org.osgi.service.component.ComponentContext;
-import org.wso2.carbon.CarbonConstants;
-import org.wso2.carbon.utils.ConfigurationContextService;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-/**
- * @scr.component name="org.apache.stratos.deployment.internal.CloudDeploymentServiceComponent" immediate="true"
- * @scr.reference name="config.context.service"
- * interface="org.wso2.carbon.utils.ConfigurationContextService" cardinality="1..1"
- * policy="dynamic" bind="setConfigurationContextService"
- * unbind="unsetConfigurationContextService"
- */
-public class CloudDeploymentServiceComponent {
- private static final Log log = LogFactory.getLog(CloudDeploymentServiceComponent.class);
-
- protected void activate(ComponentContext ctxt) {
- //TODO: Modify the permission in the UI
- try {
- ConfigurationContext configContext = DataHolder.getInstance().getServerConfigContext();
- Dictionary props = new Hashtable();
- props.put(CarbonConstants.AXIS2_CONFIG_SERVICE, AxisObserver.class.getName());
- ctxt.getBundleContext().registerService(AxisObserver.class.getName(), new CloudDeploymentInterceptor(),props);
-
- // register the role player for this configuration
- AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
- axisConfiguration.addParameter(new Parameter("rolePlayer", new SuperTenantRolePlayer()));
- } catch (Exception e) {
- log.error("CloudDeploymentServiceComponent activation failed", e);
- }
- }
-
- protected void deactivate(ComponentContext ctxt) {
-
- }
-
- protected void setConfigurationContextService(ConfigurationContextService contextService) {
- DataHolder.getInstance().setServerConfigContext(contextService.getServerConfigContext());
- }
-
- protected void unsetConfigurationContextService(ConfigurationContextService contextService) {
- DataHolder.getInstance().setServerConfigContext(null);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/internal/DataHolder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/internal/DataHolder.java b/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/internal/DataHolder.java
deleted file mode 100644
index 585ac1e..0000000
--- a/components/org.apache.stratos.deployment/2.1.0/src/main/java/org/apache/stratos/deployment/internal/DataHolder.java
+++ /dev/null
@@ -1,45 +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.deployment.internal;
-
-import org.apache.axis2.context.ConfigurationContext;
-
-/**
- * DataHolder for Service deployment component
- */
-public class DataHolder {
- private static DataHolder instance = new DataHolder();
-
- private ConfigurationContext serverConfigContext;
-
- public static DataHolder getInstance() {
- return instance;
- }
-
- private DataHolder() {
- }
-
- public ConfigurationContext getServerConfigContext() {
- return serverConfigContext;
- }
-
- public void setServerConfigContext(ConfigurationContext serverConfigContext) {
- this.serverConfigContext = serverConfigContext;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.deployment/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.deployment/pom.xml b/components/org.apache.stratos.deployment/pom.xml
new file mode 100644
index 0000000..7a7399d
--- /dev/null
+++ b/components/org.apache.stratos.deployment/pom.xml
@@ -0,0 +1,104 @@
+<!--
+ 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>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>org.apache.stratos.deployment</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Stratos - Deployment</name>
+
+ <build>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <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>
+ <Private-Package>
+ org.apache.stratos.deployment.internal.*
+ </Private-Package>
+ <Export-Package>
+ !org.apache.stratos.deployment.internal.*,
+ org.apache.stratos.deployment.*
+ </Export-Package>
+ <Import-Package>
+ !javax.xml.namespace,
+ org.apache.axis2.*; version="${axis2.osgi.version.range}",
+ javax.xml.namespace; version=0.0.0,
+ javax.servlet;version="${imp.pkg.version.javax.servlet}",
+ javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
+ *;resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.common</artifactId>
+ <version>${apache.stratos.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2.wso2</groupId>
+ <artifactId>axis2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.wso2.carbon</groupId>
+ <artifactId>org.wso2.carbon.registry.core</artifactId>
+ <version>${wso2carbon.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ </dependencies>
+</project>
+
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/CloudDeploymentInterceptor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/CloudDeploymentInterceptor.java b/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/CloudDeploymentInterceptor.java
new file mode 100644
index 0000000..469c459
--- /dev/null
+++ b/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/CloudDeploymentInterceptor.java
@@ -0,0 +1,91 @@
+/*
+* 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.deployment;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.description.AxisModule;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.AxisServiceGroup;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.AxisEvent;
+import org.apache.axis2.engine.AxisObserver;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+
+/**
+ * Deployment interceptor for handling modification of ServiceAdmin so that the service list is not
+ * displayed when the user has not logged in.
+ */
+public class CloudDeploymentInterceptor implements AxisObserver {
+ private static final Log log = LogFactory.getLog(CloudDeploymentInterceptor.class);
+
+ public void init(AxisConfiguration axisConfiguration) {
+ }
+
+ public void serviceUpdate(AxisEvent axisEvent, AxisService axisService) {
+ try {
+ if (axisEvent.getEventType() == AxisEvent.SERVICE_DEPLOY &&
+ axisService.getName().equals("ServiceAdmin")){
+ AxisOperation operation = axisService.getOperation(new QName("listServiceGroups"));
+ ArrayList<Parameter> params = operation.getParameters();
+ for(Parameter param: params) {
+ operation.removeParameter(param);
+ }
+ Parameter authAction = new Parameter("AuthorizationAction",
+ "/permission/admin/manage/monitor/service");
+ operation.addParameter(authAction);
+ }
+ } catch (AxisFault e) {
+ log.error("Cannot add AuthorizationAction parameter to ServiceAdmin", e);
+ }
+ }
+
+ public void serviceGroupUpdate(AxisEvent axisEvent, AxisServiceGroup axisServiceGroup) {
+ }
+
+ public void moduleUpdate(AxisEvent axisEvent, AxisModule axisModule) {
+ }
+
+ public void addParameter(Parameter parameter) throws AxisFault {
+ }
+
+ public void removeParameter(Parameter parameter) throws AxisFault {
+ }
+
+ public void deserializeParameters(OMElement omElement) throws AxisFault {
+ }
+
+ public Parameter getParameter(String s) {
+ return null;
+ }
+
+ public ArrayList<Parameter> getParameters() {
+ return null;
+ }
+
+ public boolean isParameterLocked(String s) {
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/SuperTenantRolePlayer.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/SuperTenantRolePlayer.java b/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/SuperTenantRolePlayer.java
new file mode 100644
index 0000000..efd37d9
--- /dev/null
+++ b/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/SuperTenantRolePlayer.java
@@ -0,0 +1,45 @@
+/*
+* 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.deployment;
+
+import org.apache.axiom.soap.RolePlayer;
+import org.wso2.carbon.base.MultitenantConstants;
+import org.wso2.carbon.context.CarbonContext;
+
+import java.util.List;
+import java.util.ArrayList;
+
+public class SuperTenantRolePlayer implements RolePlayer{
+
+ private List<String> roles;
+
+ public SuperTenantRolePlayer() {
+ this.roles = new ArrayList<String>();
+ this.roles.add("supertenant");
+ }
+
+ public List getRoles() {
+ return this.roles;
+ }
+
+ public boolean isUltimateDestination() {
+ return (CarbonContext.getCurrentContext().getTenantId() ==
+ MultitenantConstants.SUPER_TENANT_ID);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/internal/CloudDeploymentServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/internal/CloudDeploymentServiceComponent.java b/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/internal/CloudDeploymentServiceComponent.java
new file mode 100644
index 0000000..926264f
--- /dev/null
+++ b/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/internal/CloudDeploymentServiceComponent.java
@@ -0,0 +1,73 @@
+/*
+* 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.deployment.internal;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.AxisObserver;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.deployment.CloudDeploymentInterceptor;
+import org.apache.stratos.deployment.SuperTenantRolePlayer;
+import org.osgi.service.component.ComponentContext;
+import org.wso2.carbon.CarbonConstants;
+import org.wso2.carbon.utils.ConfigurationContextService;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+/**
+ * @scr.component name="org.apache.stratos.deployment.internal.CloudDeploymentServiceComponent" immediate="true"
+ * @scr.reference name="config.context.service"
+ * interface="org.wso2.carbon.utils.ConfigurationContextService" cardinality="1..1"
+ * policy="dynamic" bind="setConfigurationContextService"
+ * unbind="unsetConfigurationContextService"
+ */
+public class CloudDeploymentServiceComponent {
+ private static final Log log = LogFactory.getLog(CloudDeploymentServiceComponent.class);
+
+ protected void activate(ComponentContext ctxt) {
+ //TODO: Modify the permission in the UI
+ try {
+ ConfigurationContext configContext = DataHolder.getInstance().getServerConfigContext();
+ Dictionary props = new Hashtable();
+ props.put(CarbonConstants.AXIS2_CONFIG_SERVICE, AxisObserver.class.getName());
+ ctxt.getBundleContext().registerService(AxisObserver.class.getName(), new CloudDeploymentInterceptor(),props);
+
+ // register the role player for this configuration
+ AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
+ axisConfiguration.addParameter(new Parameter("rolePlayer", new SuperTenantRolePlayer()));
+ } catch (Exception e) {
+ log.error("CloudDeploymentServiceComponent activation failed", e);
+ }
+ }
+
+ protected void deactivate(ComponentContext ctxt) {
+
+ }
+
+ protected void setConfigurationContextService(ConfigurationContextService contextService) {
+ DataHolder.getInstance().setServerConfigContext(contextService.getServerConfigContext());
+ }
+
+ protected void unsetConfigurationContextService(ConfigurationContextService contextService) {
+ DataHolder.getInstance().setServerConfigContext(null);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/internal/DataHolder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/internal/DataHolder.java b/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/internal/DataHolder.java
new file mode 100644
index 0000000..585ac1e
--- /dev/null
+++ b/components/org.apache.stratos.deployment/src/main/java/org/apache/stratos/deployment/internal/DataHolder.java
@@ -0,0 +1,45 @@
+/*
+* 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.deployment.internal;
+
+import org.apache.axis2.context.ConfigurationContext;
+
+/**
+ * DataHolder for Service deployment component
+ */
+public class DataHolder {
+ private static DataHolder instance = new DataHolder();
+
+ private ConfigurationContext serverConfigContext;
+
+ public static DataHolder getInstance() {
+ return instance;
+ }
+
+ private DataHolder() {
+ }
+
+ public ConfigurationContext getServerConfigContext() {
+ return serverConfigContext;
+ }
+
+ public void setServerConfigContext(ConfigurationContext serverConfigContext) {
+ this.serverConfigContext = serverConfigContext;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.keystore.mgt/2.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.keystore.mgt/2.1.0/pom.xml b/components/org.apache.stratos.keystore.mgt/2.1.0/pom.xml
deleted file mode 100644
index c482ee2..0000000
--- a/components/org.apache.stratos.keystore.mgt/2.1.0/pom.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-# Copyright (c) 2008, 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>3.0.0-SNAPSHOT</version>
-<relativePath>../../pom.xml</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>org.apache.stratos.keystore.mgt</artifactId>
- <version>2.1.0</version>
- <packaging>bundle</packaging>
- <name>Apache Stratos - Keystore Generation and Management</name>
-
- <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>
- <Private-Package>
- org.apache.stratos.keystore.mgt.internal
- </Private-Package>
- <Export-Package>
- !org.apache.stratos.keystore.mgt.internal,
- org.apache.stratos.keystore.mgt.*,
- </Export-Package>
- <Import-Package>
- javax.servlet;version="${imp.pkg.version.javax.servlet}",
- javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
- org.wso2.carbon.security.*,
- org.apache.lucene.*,
- *;resolution:=optional
- </Import-Package>
- <Embed-Dependency>
- bcprov-jdk15|naming-factory|naming-resources|commons-collections;scope=compile|runtime;inline=false
- </Embed-Dependency>
- <DynamicImport-Package>*</DynamicImport-Package>
- </instructions>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-
- <dependencies>
-
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-codec.wso2</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.4.0.wso2v1</version>
- </dependency>
- <dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.registry.core</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>javax.servlet</artifactId>
- <version>${version.javax.servlet}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.axis2.wso2</groupId>
- <artifactId>axis2</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.ws.commons.axiom.wso2</groupId>
- <artifactId>axiom</artifactId>
- <version>1.2.11.wso2v3</version>
- </dependency>
- <dependency>
- <groupId>org.apache.stratos</groupId>
- <artifactId>org.apache.stratos.common</artifactId>
- <version>2.1.2</version>
- </dependency>
- <dependency>
- <groupId>bouncycastle</groupId>
- <artifactId>bcprov-jdk15</artifactId>
- <version>132</version>
- </dependency>
- <dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.security.mgt</artifactId>
- <version>${wso2carbon.version}</version>
- </dependency>
- </dependencies>
-
- <properties>
- <version.javax.servlet>3.0.0.v201112011016</version.javax.servlet>
- </properties>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/KeyStoreGenerator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/KeyStoreGenerator.java b/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/KeyStoreGenerator.java
deleted file mode 100644
index b8e892e..0000000
--- a/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/KeyStoreGenerator.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
-* Copyright (c) 2005-2010, 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.keystore.mgt;
-
-import org.apache.axiom.om.util.UUIDGenerator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.bouncycastle.jce.X509Principal;
-import org.bouncycastle.jce.X509V3CertificateGenerator;
-import org.wso2.carbon.core.RegistryResources;
-import org.wso2.carbon.core.util.CryptoUtil;
-import org.apache.stratos.keystore.mgt.util.RealmServiceHolder;
-import org.apache.stratos.keystore.mgt.util.RegistryServiceHolder;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.security.SecurityConstants;
-import org.wso2.carbon.security.keystore.KeyStoreAdmin;
-import org.wso2.carbon.user.core.service.RealmService;
-
-import java.io.ByteArrayOutputStream;
-import java.math.BigInteger;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.KeyStore;
-import java.security.SecureRandom;
-import java.security.cert.X509Certificate;
-import java.util.Date;
-
-/**
- * This class is used to generate a key store for a tenant and store it in the governance registry.
- */
-public class KeyStoreGenerator {
-
- private static Log log = LogFactory.getLog(KeyStoreGenerator.class);
- private UserRegistry govRegistry;
- private int tenantId;
- private String tenantDomain;
- private String password;
-
-
- public KeyStoreGenerator(int tenantId) throws KeyStoreMgtException {
- try {
- this.tenantId = tenantId;
- this.tenantDomain = getTenantDomainName();
- this.govRegistry = RegistryServiceHolder.getRegistryService().
- getGovernanceSystemRegistry(tenantId);
- if(govRegistry == null){
- log.error("Governance registry instance is null");
- throw new KeyStoreMgtException("Governance registry instance is null");
- }
- } catch (RegistryException e) {
- String errorMsg = "Error while obtaining the governance registry for tenant : " +
- tenantId;
- log.error(errorMsg, e);
- throw new KeyStoreMgtException(errorMsg, e);
- }
- }
-
-
- /**
- * This method first generates the keystore, then persist it in the gov.registry of that tenant
- *
- * @throws KeyStoreMgtException Error when generating or storing the keystore
- */
- public void generateKeyStore() throws KeyStoreMgtException {
- try {
- password = generatePassword();
- KeyStore keyStore = KeyStore.getInstance("JKS");
- keyStore.load(null, password.toCharArray());
- X509Certificate pubCert = generateKeyPair(keyStore);
- persistKeyStore(keyStore, pubCert);
- } catch (Exception e) {
- String msg = "Error while instantiating a keystore";
- log.error(msg, e);
- throw new KeyStoreMgtException(msg, e);
- }
- }
-
- /**
- * This method generates the keypair and stores it in the keystore
- *
- * @param keyStore A keystore instance
- * @return Generated public key for the tenant
- * @throws KeyStoreMgtException Error when generating key pair
- */
- private X509Certificate generateKeyPair(KeyStore keyStore) throws KeyStoreMgtException {
- try {
- CryptoUtil.getDefaultCryptoUtil();
- //generate key pair
- KeyPairGenerator keyPairGenerator = null;
- keyPairGenerator = KeyPairGenerator.getInstance("RSA");
- keyPairGenerator.initialize(1024);
- KeyPair keyPair = keyPairGenerator.generateKeyPair();
-
- // Common Name and alias for the generated certificate
- String commonName = "CN=" + tenantDomain + ", OU=None, O=None L=None, C=None";
-
- //generate certificates
- X509V3CertificateGenerator v3CertGen = new X509V3CertificateGenerator();
- v3CertGen.setSerialNumber(BigInteger.valueOf(new SecureRandom().nextInt()));
- v3CertGen.setIssuerDN(new X509Principal(commonName));
- v3CertGen.setNotBefore(new Date(System.currentTimeMillis() - 1000L * 60 * 60 * 24 * 30));
- v3CertGen.setNotAfter(new Date(System.currentTimeMillis() + (1000L * 60 * 60 * 24 * 365 * 10)));
- v3CertGen.setSubjectDN(new X509Principal(commonName));
- v3CertGen.setPublicKey(keyPair.getPublic());
- v3CertGen.setSignatureAlgorithm("MD5WithRSAEncryption");
- X509Certificate PKCertificate = v3CertGen.generateX509Certificate(keyPair.getPrivate());
-
- //add private key to KS
- keyStore.setKeyEntry(tenantDomain, keyPair.getPrivate(), password.toCharArray(),
- new java.security.cert.Certificate[]{PKCertificate});
- return PKCertificate;
- } catch (Exception ex) {
- String msg = "Error while generating the certificate for tenant :" +
- tenantDomain + ".";
- log.error(msg, ex);
- throw new KeyStoreMgtException(msg, ex);
- }
-
- }
-
- /**
- * Persist the keystore in the gov.registry
- *
- * @param keyStore created Keystore of the tenant
- * @param PKCertificate pub. key of the tenant
- * @throws KeyStoreMgtException Exception when storing the keystore in the registry
- */
- private void persistKeyStore(KeyStore keyStore, X509Certificate PKCertificate)
- throws KeyStoreMgtException {
- try {
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- keyStore.store(outputStream, password.toCharArray());
- outputStream.flush();
- outputStream.close();
-
- String keyStoreName = generateKSNameFromDomainName();
- // Use the keystore using the keystore admin
- KeyStoreAdmin keystoreAdmin = new KeyStoreAdmin(tenantId, govRegistry);
- keystoreAdmin.addKeyStore(outputStream.toByteArray(), keyStoreName,
- password, " ", "JKS", password);
-
- //Create the pub. key resource
- Resource pubKeyResource = govRegistry.newResource();
- pubKeyResource.setContent(PKCertificate.getEncoded());
- pubKeyResource.addProperty(SecurityConstants.PROP_TENANT_PUB_KEY_FILE_NAME_APPENDER,
- generatePubKeyFileNameAppender());
-
- govRegistry.put(RegistryResources.SecurityManagement.TENANT_PUBKEY_RESOURCE, pubKeyResource);
-
- //associate the public key with the keystore
- govRegistry.addAssociation(RegistryResources.SecurityManagement.KEY_STORES + "/" + keyStoreName,
- RegistryResources.SecurityManagement.TENANT_PUBKEY_RESOURCE,
- SecurityConstants.ASSOCIATION_TENANT_KS_PUB_KEY);
-
- } catch (RegistryException e) {
- String msg = "Error when writing the keystore/pub.cert to registry";
- log.error(msg, e);
- throw new KeyStoreMgtException(msg, e);
- }
- catch (Exception e) {
- String msg = "Error when processing keystore/pub. cert to be stored in registry";
- log.error(msg, e);
- throw new KeyStoreMgtException(msg, e);
- }
- }
-
- /**
- * This method is used to generate a random password for the generated keystore
- *
- * @return generated password
- */
- private String generatePassword() {
- SecureRandom random = new SecureRandom();
- String randString = new BigInteger(130, random).toString(12);
- return randString.substring(randString.length() - 10, randString.length());
- }
-
- /**
- * This method is used to generate a file name appender for the pub. cert, e.g.
- * example-com-343743.cert
- * @return generated string to be used as a file name appender
- */
- private String generatePubKeyFileNameAppender(){
- String uuid = UUIDGenerator.getUUID();
- return uuid.substring(uuid.length() - 6, uuid.length()-1);
- }
-
- /**
- * This method generates the key store file name from the Domain Name
- * @return
- */
- private String generateKSNameFromDomainName(){
- String ksName = tenantDomain.trim().replace(".", "-");
- return (ksName + ".jks" );
- }
-
- private String getTenantDomainName() throws KeyStoreMgtException {
- RealmService realmService = RealmServiceHolder.getRealmService();
- if (realmService == null) {
- String msg = "Error in getting the domain name, realm service is null.";
- log.error(msg);
- throw new KeyStoreMgtException(msg);
- }
- try {
- return realmService.getTenantManager().getDomain(tenantId);
- } catch (org.wso2.carbon.user.api.UserStoreException e) {
- String msg = "Error in getting the domain name for the tenant id: " + tenantId;
- log.error(msg, e);
- throw new KeyStoreMgtException(msg, e);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/KeyStoreMgtException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/KeyStoreMgtException.java b/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/KeyStoreMgtException.java
deleted file mode 100644
index de486f0..0000000
--- a/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/KeyStoreMgtException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2005-2010, 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.keystore.mgt;
-
-/**
- * This class is used to wrap the exceptions thrown from stratos keystore mgt component.
- */
-public class KeyStoreMgtException extends Exception {
- public KeyStoreMgtException() {
- }
-
- public KeyStoreMgtException(String message) {
- super(message);
- }
-
- public KeyStoreMgtException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public KeyStoreMgtException(Throwable cause) {
- super(cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/KeystoreTenantMgtListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/KeystoreTenantMgtListener.java b/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/KeystoreTenantMgtListener.java
deleted file mode 100644
index b4eaf6c..0000000
--- a/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/KeystoreTenantMgtListener.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
-* Copyright (c) 2005-2010, 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.keystore.mgt;
-
-import org.apache.stratos.common.beans.TenantInfoBean;
-import org.apache.stratos.common.exception.StratosException;
-import org.apache.stratos.common.listeners.TenantMgtListener;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * This class is used to listen to the tenant creation events and fire the keystore creation event
- */
-public class KeystoreTenantMgtListener implements TenantMgtListener {
-
- private static Log log = LogFactory.getLog(KeystoreTenantMgtListener.class);
- private static final int EXEC_ORDER = 20;
-
- /**
- * Generate the keystore when a new tenant is registered.
- * @param tenantInfo Information about the newly created tenant
- */
- public void onTenantCreate(TenantInfoBean tenantInfo) throws StratosException {
- try {
- KeyStoreGenerator ksGenerator = new KeyStoreGenerator(tenantInfo.getTenantId());
- ksGenerator.generateKeyStore();
- } catch (KeyStoreMgtException e) {
- String message = "Error when generating the keystore";
- log.error(message, e);
- throw new StratosException(message, e);
- }
- }
-
- public void onTenantUpdate(TenantInfoBean tenantInfo) throws StratosException {
- // It is not required to implement this method for keystore mgt.
- }
-
- public void onTenantRename(int tenantId, String oldDomainName,
- String newDomainName) throws StratosException {
- // It is not required to implement this method for keystore mgt.
- }
-
- public int getListenerOrder() {
- return EXEC_ORDER;
- }
-
- public void onTenantInitialActivation(int tenantId) throws StratosException {
- // It is not required to implement this method for keystore mgt.
- }
-
- public void onTenantActivation(int tenantId) throws StratosException {
- // It is not required to implement this method for keystore mgt.
- }
-
- public void onTenantDeactivation(int tenantId) throws StratosException {
- // It is not required to implement this method for keystore mgt.
- }
-
- public void onSubscriptionPlanChange(int tenentId, String oldPlan,
- String newPlan) throws StratosException {
- // It is not required to implement this method for keystore mgt.
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/internal/KeyStoreMgtServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/internal/KeyStoreMgtServiceComponent.java b/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/internal/KeyStoreMgtServiceComponent.java
deleted file mode 100644
index bc9b44f..0000000
--- a/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/internal/KeyStoreMgtServiceComponent.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-* Copyright (c) 2005-2010, 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.keystore.mgt.internal;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.osgi.service.component.ComponentContext;
-import org.wso2.carbon.registry.core.service.RegistryService;
-import org.wso2.carbon.user.core.service.RealmService;
-import org.apache.stratos.keystore.mgt.KeystoreTenantMgtListener;
-import org.apache.stratos.keystore.mgt.util.RealmServiceHolder;
-import org.apache.stratos.keystore.mgt.util.RegistryServiceHolder;
-
-/**
- * @scr.component name="org.apache.stratos.keystore.mgt"
- * immediate="true"
- * @scr.reference name="registry.service"
- * interface="org.wso2.carbon.registry.core.service.RegistryService" cardinality="1..1"
- * policy="dynamic" bind="setRegistryService" unbind="unsetRegistryService"
- * @scr.reference name="user.realmservice.default" interface="org.wso2.carbon.user.core.service.RealmService"
- * cardinality="1..1" policy="dynamic" bind="setRealmService"
- * unbind="unsetRealmService"
- */
-public class KeyStoreMgtServiceComponent {
-
- private static Log log = LogFactory.getLog(KeyStoreMgtServiceComponent.class);
-
-
- protected void activate(ComponentContext ctxt){
- KeystoreTenantMgtListener keystoreTenantMgtListener = new KeystoreTenantMgtListener();
- ctxt.getBundleContext().registerService(
- org.apache.stratos.common.listeners.TenantMgtListener.class.getName(),
- keystoreTenantMgtListener, null);
- if (log.isDebugEnabled()) {
- log.debug("*************Stratos Keystore mgt component is activated.**************");
- }
- }
-
- protected void deactivate(ComponentContext ctxt) {
- if(log.isDebugEnabled()){
- log.debug("************Stratos keystore mgt component is decativated.*************");
- }
- }
-
- protected void setRegistryService(RegistryService registryService){
- RegistryServiceHolder.setRegistryService(registryService);
- if (log.isDebugEnabled()) {
- log.debug("Registry Service is set for KeyStoreMgtServiceComponent.");
- }
- }
-
- protected void unsetRegistryService(RegistryService registryService){
- RegistryServiceHolder.setRegistryService(null);
- if(log.isDebugEnabled()){
- log.debug("Registry Service is unset for KeyStoreMgtServiceComponent.");
- }
- }
-
- protected void setRealmService(RealmService realmService){
- RealmServiceHolder.setRealmService(realmService);
- if (log.isDebugEnabled()) {
- log.debug("Realm Service is set for KeyStoreMgtServiceComponent.");
- }
- }
-
- protected void unsetRealmService(RealmService realmService){
- RealmServiceHolder.setRealmService(null);
- if(log.isDebugEnabled()){
- log.debug("Realm Service is unset for KeyStoreMgtServiceComponent.");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/util/RealmServiceHolder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/util/RealmServiceHolder.java b/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/util/RealmServiceHolder.java
deleted file mode 100644
index a1e6b16..0000000
--- a/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/util/RealmServiceHolder.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-* Copyright (c) 2005-2010, 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.keystore.mgt.util;
-
-import org.wso2.carbon.user.core.service.RealmService;
-
-public class RealmServiceHolder {
-
- private static RealmService realmServiceService;
-
- public static RealmService getRealmService() {
- return realmServiceService;
- }
-
- public static void setRealmService(RealmService realmService) {
- RealmServiceHolder.realmServiceService = realmService;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/util/RegistryServiceHolder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/util/RegistryServiceHolder.java b/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/util/RegistryServiceHolder.java
deleted file mode 100644
index 5b7ab4a..0000000
--- a/components/org.apache.stratos.keystore.mgt/2.1.0/src/main/java/org/apache/stratos/keystore/mgt/util/RegistryServiceHolder.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-* Copyright (c) 2005-2010, 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.keystore.mgt.util;
-
-import org.wso2.carbon.registry.core.service.RegistryService;
-
-public class RegistryServiceHolder {
-
- private static RegistryService registryService;
-
- public static RegistryService getRegistryService() {
- return registryService;
- }
-
- public static void setRegistryService(RegistryService registryService) {
- RegistryServiceHolder.registryService = registryService;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac065d73/components/org.apache.stratos.keystore.mgt/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.keystore.mgt/pom.xml b/components/org.apache.stratos.keystore.mgt/pom.xml
new file mode 100644
index 0000000..df523be
--- /dev/null
+++ b/components/org.apache.stratos.keystore.mgt/pom.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+# Copyright (c) 2008, 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>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>org.apache.stratos.keystore.mgt</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Stratos - Keystore Generation and Management</name>
+
+ <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>
+ <Private-Package>
+ org.apache.stratos.keystore.mgt.internal
+ </Private-Package>
+ <Export-Package>
+ !org.apache.stratos.keystore.mgt.internal,
+ org.apache.stratos.keystore.mgt.*,
+ </Export-Package>
+ <Import-Package>
+ javax.servlet;version="${imp.pkg.version.javax.servlet}",
+ javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
+ org.wso2.carbon.security.*,
+ org.apache.lucene.*,
+ *;resolution:=optional
+ </Import-Package>
+ <Embed-Dependency>
+ bcprov-jdk15|naming-factory|naming-resources|commons-collections;scope=compile|runtime;inline=false
+ </Embed-Dependency>
+ <DynamicImport-Package>*</DynamicImport-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec.wso2</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.4.0.wso2v1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.wso2.carbon</groupId>
+ <artifactId>org.wso2.carbon.registry.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>javax.servlet</artifactId>
+ <version>${version.javax.servlet}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2.wso2</groupId>
+ <artifactId>axis2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom.wso2</groupId>
+ <artifactId>axiom</artifactId>
+ <version>1.2.11.wso2v3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.common</artifactId>
+ <version>${apache.stratos.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>bouncycastle</groupId>
+ <artifactId>bcprov-jdk15</artifactId>
+ <version>132</version>
+ </dependency>
+ <dependency>
+ <groupId>org.wso2.carbon</groupId>
+ <artifactId>org.wso2.carbon.security.mgt</artifactId>
+ <version>${wso2carbon.version}</version>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <version.javax.servlet>3.0.0.v201112011016</version.javax.servlet>
+ </properties>
+</project>