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/09 07:47:31 UTC

[4/7] removing components/stratos/tenant-mgt

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantMgtUtil.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantMgtUtil.java b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantMgtUtil.java
deleted file mode 100644
index 676e878..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantMgtUtil.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * 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.
- */
-package org.wso2.carbon.tenant.mgt.util;
-
-import org.apache.commons.dbcp.BasicDataSource;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.registry.core.RegistryConstants;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.registry.core.jdbc.dataaccess.JDBCDataAccessManager;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.registry.core.utils.UUIDGenerator;
-import org.wso2.carbon.stratos.common.beans.TenantInfoBean;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.stratos.common.exception.StratosException;
-import org.wso2.carbon.stratos.common.listeners.TenantMgtListener;
-import org.wso2.carbon.stratos.common.util.ClaimsMgtUtil;
-import org.wso2.carbon.stratos.common.util.CommonUtil;
-import org.wso2.carbon.tenant.mgt.internal.TenantMgtServiceComponent;
-import org.wso2.carbon.user.api.RealmConfiguration;
-import org.wso2.carbon.user.api.TenantMgtConfiguration;
-import org.wso2.carbon.user.core.UserCoreConstants;
-import org.wso2.carbon.user.core.UserRealm;
-import org.wso2.carbon.user.core.UserStoreException;
-import org.wso2.carbon.user.core.UserStoreManager;
-import org.wso2.carbon.user.core.config.multitenancy.MultiTenantRealmConfigBuilder;
-import org.wso2.carbon.user.core.jdbc.JDBCRealmConstants;
-import org.wso2.carbon.user.core.tenant.Tenant;
-import org.wso2.carbon.user.core.tenant.TenantManager;
-import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Utility methods for tenant management.
- */
-public class TenantMgtUtil {
-
-    private static final Log log = LogFactory.getLog(TenantMgtUtil.class);
-    private static final String ILLEGAL_CHARACTERS_FOR_TENANT_DOMAIN = ".*[^a-zA-Z0-9\\._\\-].*";
-
-    /**
-     * Prepares string to show theme management page.
-     *
-     * @param tenantId - tenant id
-     * @return UUID
-     * @throws RegistryException, if failed.
-     */
-    public static String prepareStringToShowThemeMgtPage(int tenantId) throws RegistryException {
-        // first we generate a UUID
-        UserRegistry systemRegistry =
-                TenantMgtServiceComponent.getRegistryService().getGovernanceSystemRegistry();
-        String uuid = UUIDGenerator.generateUUID();
-        // store it in the registry.
-        Resource resource = systemRegistry.newResource();
-        String tenantIdStr = Integer.toString(tenantId);
-        resource.setProperty(MultitenantConstants.TENANT_ID, tenantIdStr);
-        String uuidPath = StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN
-                          + RegistryConstants.PATH_SEPARATOR + uuid;
-        systemRegistry.put(uuidPath, resource);
-
-        // restrict access
-        CommonUtil.denyAnonAuthorization(uuidPath, systemRegistry.getUserRealm());
-        return uuid;
-    }
-
-    /**
-     * Triggers adding the tenant for TenantMgtListener
-     *
-     * @param tenantInfo tenant
-     * @throws StratosException, trigger failed
-     */
-    public static void triggerAddTenant(TenantInfoBean tenantInfo) throws StratosException {
-        // initializeRegistry(tenantInfoBean.getTenantId());
-        for (TenantMgtListener tenantMgtListener :
-                TenantMgtServiceComponent.getTenantMgtListeners()) {
-            tenantMgtListener.onTenantCreate(tenantInfo);
-        }
-    }
-
-    /**
-     * Triggers an update for the tenant for TenantMgtListener
-     *
-     * @param tenantInfoBean tenantInfoBean
-     * @throws org.wso2.carbon.stratos.common.exception.StratosException, if update failed
-     */
-    public static void triggerUpdateTenant(
-            TenantInfoBean tenantInfoBean) throws StratosException {
-        for (TenantMgtListener tenantMgtListener :
-                TenantMgtServiceComponent.getTenantMgtListeners()) {
-            tenantMgtListener.onTenantUpdate(tenantInfoBean);
-        }
-    }
-    
-    public static void triggerTenantInitialActivation(
-                                  TenantInfoBean tenantInfoBean) throws StratosException {
-        for (TenantMgtListener tenantMgtListener :
-                TenantMgtServiceComponent.getTenantMgtListeners()) {
-            tenantMgtListener.onTenantInitialActivation(tenantInfoBean.getTenantId());
-        }
-    }
-    
-    public static void triggerTenantActivation(int tenantId) throws StratosException {
-        for (TenantMgtListener tenantMgtListener : 
-                TenantMgtServiceComponent.getTenantMgtListeners()) {
-            tenantMgtListener.onTenantActivation(tenantId);
-        }
-    }
-    
-    public static void triggerTenantDeactivation(int tenantId) throws StratosException {
-        for (TenantMgtListener tenantMgtListener : 
-                TenantMgtServiceComponent.getTenantMgtListeners()) {
-            tenantMgtListener.onTenantDeactivation(tenantId);
-        }
-    }
-
-    /**
-     * Validate the tenant domain
-     *
-     * @param domainName tenant domain
-     * @throws Exception , if invalid tenant domain name is given
-     */
-    public static void validateDomain(String domainName) throws Exception {
-        if (domainName == null || domainName.equals("")) {
-            String msg = "Provided domain name is empty.";
-            log.error(msg);
-            throw new Exception(msg);
-        }
-        // ensures the .ext for the public clouds.
-        if (CommonUtil.isPublicCloudSetup()) {
-            int lastIndexOfDot = domainName.lastIndexOf(".");
-            if (lastIndexOfDot <= 0) {
-                String msg = "You should have an extension to your domain.";
-                log.error(msg);
-                throw new Exception(msg);
-            }
-        }
-        int indexOfDot = domainName.indexOf(".");
-        if (indexOfDot == 0) {
-            // can't start a domain starting with ".";
-            String msg = "Invalid domain, starting with '.'";
-            log.error(msg);
-            throw new Exception(msg);
-        }
-        // check the tenant domain contains any illegal characters
-        if (domainName.matches(ILLEGAL_CHARACTERS_FOR_TENANT_DOMAIN)) {
-            String msg = "The tenant domain ' " + domainName +
-                         " ' contains one or more illegal characters. the valid characters are " +
-                         "letters, numbers, '.', '-' and '_'";
-            log.error(msg);
-            throw new Exception(msg);
-        }
-    }
-
-    /**
-     * gets the UserStoreManager for a tenant
-     *
-     * @param tenant   - a tenant
-     * @param tenantId - tenant Id. To avoid the sequences where tenant.getId() may
-     *                 produce the super tenant's tenant Id.
-     * @return UserStoreManager
-     * @throws Exception UserStoreException
-     */
-    public static UserStoreManager getUserStoreManager(Tenant tenant, int tenantId)
-            throws Exception {
-        // get the system registry for the tenant
-        RealmConfiguration realmConfig = TenantMgtServiceComponent.getBootstrapRealmConfiguration();
-        TenantMgtConfiguration tenantMgtConfiguration =
-                TenantMgtServiceComponent.getRealmService().getTenantMgtConfiguration();
-        UserRealm userRealm;
-        try {
-            MultiTenantRealmConfigBuilder builder = TenantMgtServiceComponent.getRealmService().
-                    getMultiTenantRealmConfigBuilder();
-            RealmConfiguration realmConfigToPersist = builder.
-                    getRealmConfigForTenantToPersist(realmConfig, tenantMgtConfiguration,
-                                                             tenant, tenantId);
-            RealmConfiguration realmConfigToCreate =
-                    builder.getRealmConfigForTenantToCreateRealmOnTenantCreation(
-                            realmConfig, realmConfigToPersist, tenantId);
-            userRealm = TenantMgtServiceComponent.getRealmService().
-                    getUserRealm(realmConfigToCreate);
-        } catch (UserStoreException e) {
-            String msg = "Error in creating Realm for tenant, tenant domain: " + tenant.getDomain();
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }
-
-        UserStoreManager userStoreManager;
-        try {
-            userStoreManager = userRealm.getUserStoreManager();
-
-            return userStoreManager;
-        } catch (UserStoreException e) {
-            String msg = "Error in getting the userstore/authorization manager for tenant: " +
-                         tenant.getDomain();
-            log.error(msg);
-            throw new Exception(msg, e);
-        }
-    }
-
-    /**
-     * initializes tenant from the user input (tenant info bean)
-     *
-     * @param tenantInfoBean input
-     * @return tenant
-     */
-    public static Tenant initializeTenant(TenantInfoBean tenantInfoBean) {
-        Tenant tenant = new Tenant();
-        tenant.setDomain(tenantInfoBean.getTenantDomain());
-        tenant.setEmail(tenantInfoBean.getEmail());
-        tenant.setAdminName(tenantInfoBean.getAdmin());
-
-        // we are duplicating the params stored in the claims here as well; they
-        // are in Tenant class
-        // to make it work with LDAP; but they do not make it to the databases.
-        tenant.setAdminFirstName(tenantInfoBean.getFirstname());
-        tenant.setAdminLastName(tenantInfoBean.getLastname());
-
-        tenant.setAdminPassword(tenantInfoBean.getAdminPassword());
-
-        // sets created date.
-        Calendar createdDateCal = tenantInfoBean.getCreatedDate();
-        long createdDate;
-        if (createdDateCal != null) {
-            createdDate = createdDateCal.getTimeInMillis();
-        } else {
-            createdDate = System.currentTimeMillis();
-        }
-        tenant.setCreatedDate(new Date(createdDate));
-
-        if (log.isDebugEnabled()) {
-            log.debug("Tenant object Initialized from the TenantInfoBean");
-        }
-        return tenant;
-    }
-
-    /**
-     * Initializes a tenantInfoBean object for a given tenant.
-     *
-     * @param tenantId tenant id.
-     * @param tenant   a tenant.
-     * @return tenantInfoBean
-     * @throws Exception , exception in getting the adminUserName from tenantId
-     */
-    public static TenantInfoBean initializeTenantInfoBean(
-            int tenantId, Tenant tenant) throws Exception {
-        TenantInfoBean bean = getTenantInfoBeanfromTenant(tenantId, tenant);
-        if (tenant != null) {
-            bean.setAdmin(ClaimsMgtUtil.getAdminUserNameFromTenantId(
-                    TenantMgtServiceComponent.getRealmService(), tenantId));
-        }
-        return bean;
-    }
-
-    /**
-     * initializes a TenantInfoBean object from the tenant
-     * @param tenantId, tenant id
-     * @param tenant, tenant
-     * @return TenantInfoBean.
-     */
-    public static TenantInfoBean getTenantInfoBeanfromTenant(int tenantId, Tenant tenant) {
-        TenantInfoBean bean = new TenantInfoBean();
-        if (tenant != null) {
-            bean.setTenantId(tenantId);
-            bean.setTenantDomain(tenant.getDomain());
-            bean.setEmail(tenant.getEmail());
-
-            /*gets the created date*/
-            Calendar createdDate = Calendar.getInstance();
-            createdDate.setTimeInMillis(tenant.getCreatedDate().getTime());
-            bean.setCreatedDate(createdDate);
-
-            bean.setActive(tenant.isActive());
-            if(log.isDebugEnabled()) {
-                log.debug("The TenantInfoBean object has been created from the tenant.");
-            }
-        } else {
-            if(log.isDebugEnabled()) {
-                log.debug("The tenant is null.");
-            }
-        }
-        return bean;
-    }
-
-    /**
-     * Adds claims to UserStoreManager
-     *
-     * @param tenant a tenant
-     * @throws Exception if error in adding claims to the user.
-     */
-    public static void addClaimsToUserStoreManager(Tenant tenant) throws Exception {
-        try {
-            Map<String, String> claimsMap = new HashMap<String, String>();
-
-            claimsMap.put(UserCoreConstants.ClaimTypeURIs.GIVEN_NAME, tenant.getAdminFirstName());
-            claimsMap.put(UserCoreConstants.ClaimTypeURIs.SURNAME, tenant.getAdminLastName());
-
-            // can be extended to store other user information.
-            UserStoreManager userStoreManager =
-                    (UserStoreManager) TenantMgtServiceComponent.getRealmService().
-                            getTenantUserRealm(tenant.getId()).getUserStoreManager();
-            userStoreManager.setUserClaimValues(tenant.getAdminName(), claimsMap,
-                                                UserCoreConstants.DEFAULT_PROFILE);
-
-        } catch (Exception e) {
-            String msg = "Error in adding claims to the user.";
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }
-    }
-
-    /**
-     * Activate a tenant during the time of the tenant creation.
-     *
-     * @param tenantInfoBean tenant information
-     * @param tenantId tenant Id
-     * @throws Exception UserStoreException.
-     */
-    public static void activateTenantInitially(TenantInfoBean tenantInfoBean,
-                                               int tenantId) throws Exception {
-        TenantManager tenantManager = TenantMgtServiceComponent.getTenantManager();
-        String tenantDomain = tenantInfoBean.getTenantDomain();
-
-        TenantMgtUtil.activateTenant(tenantDomain, tenantManager, tenantId);
-        if (log.isDebugEnabled()) {
-            log.debug("Activated the tenant " + tenantDomain + " at the time of tenant creation");
-        }
-
-        //Notify tenant activation
-        try {
-            TenantMgtUtil.triggerTenantInitialActivation(tenantInfoBean);
-        } catch (StratosException e) {
-            String msg = "Error in notifying tenant initial activation.";
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }
-    }
-
-    /**
-     * Activate the given tenant, either at the time of tenant creation, or later by super admin.
-     *
-     * @param tenantDomain tenant domain
-     * @param tenantManager TenantManager object
-     * @param tenantId tenant Id
-     * @throws Exception UserStoreException.
-     */
-    public static void activateTenant(String tenantDomain, TenantManager tenantManager,
-                                      int tenantId) throws Exception {
-        try {
-            tenantManager.activateTenant(tenantId);
-        } catch (UserStoreException e) {
-            String msg = "Error in activating the tenant for tenant domain: " + tenantDomain + ".";
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }
-
-        //activating the subscription
-        /*try {
-            if (TenantMgtServiceComponent.getBillingService() != null) {
-                TenantMgtServiceComponent.getBillingService().activateUsagePlan(tenantDomain);
-            }
-        } catch (Exception e) {
-            String msg = "Error while activating subscription for domain: " + tenantDomain + ".";
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }*/
-    }
-
-    /**
-     * Deactivate the given tenant, by super admin.
-     *
-     * @param tenantDomain tenant domain
-     * @param tenantManager TenantManager object
-     * @param tenantId tenant Id
-     * @throws Exception UserStoreException.
-     */
-    public static void deactivateTenant(String tenantDomain, TenantManager tenantManager,
-                                        int tenantId) throws Exception {
-        try {
-            tenantManager.deactivateTenant(tenantId);
-        } catch (UserStoreException e) {
-            String msg = "Error in deactivating tenant for tenant domain: " + tenantDomain + ".";
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }
-
-        //deactivating the subscription
-        /*try {
-            if (TenantMgtServiceComponent.getBillingService() != null) {
-                TenantMgtServiceComponent.getBillingService().deactivateActiveUsagePlan(tenantDomain);
-            }
-        } catch (Exception e) {
-            String msg = "Error while deactivating subscription for domain: " + tenantDomain + ".";
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }*/
-    }
-
-    public static void deleteTenantRegistryData(int tenantId) throws Exception {
-        // delete data from mounted config registry database
-        JDBCDataAccessManager configMgr = (JDBCDataAccessManager) TenantMgtServiceComponent.getRegistryService().
-                getConfigUserRegistry().getRegistryContext().getDataAccessManager();
-        TenantRegistryDataDeletionUtil.deleteTenantRegistryData(tenantId, configMgr.getDataSource().getConnection());
-
-        // delete data from mounted governance registry database
-        JDBCDataAccessManager govMgr = (JDBCDataAccessManager) TenantMgtServiceComponent.getRegistryService().
-                getGovernanceUserRegistry().getRegistryContext().getDataAccessManager();
-        TenantRegistryDataDeletionUtil.deleteTenantRegistryData(tenantId, govMgr.getDataSource().getConnection());
-
-    }
-
-    public static void deleteTenantUMData(int tenantId) throws Exception {
-        RealmConfiguration realmConfig = TenantMgtServiceComponent.getRealmService().
-                getBootstrapRealmConfiguration();
-        BasicDataSource dataSource = new BasicDataSource();
-        dataSource.setDriverClassName(realmConfig.getRealmProperty(JDBCRealmConstants.DRIVER_NAME));
-        dataSource.setUrl(realmConfig.getRealmProperty(JDBCRealmConstants.URL));
-        dataSource.setUsername(realmConfig.getRealmProperty(JDBCRealmConstants.USER_NAME));
-        dataSource.setPassword(realmConfig.getRealmProperty(JDBCRealmConstants.PASSWORD));
-        dataSource.setMaxActive(Integer.parseInt(realmConfig.getRealmProperty(JDBCRealmConstants.MAX_ACTIVE)));
-        dataSource.setMinIdle(Integer.parseInt(realmConfig.getRealmProperty(JDBCRealmConstants.MIN_IDLE)));
-        dataSource.setMaxWait(Integer.parseInt(realmConfig.getRealmProperty(JDBCRealmConstants.MAX_WAIT)));
-
-        TenantUMDataDeletionUtil.deleteTenantUMData(tenantId, dataSource.getConnection());
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantRegistryDataDeletionUtil.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantRegistryDataDeletionUtil.java b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantRegistryDataDeletionUtil.java
deleted file mode 100644
index e8f368e..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantRegistryDataDeletionUtil.java
+++ /dev/null
@@ -1,119 +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.wso2.carbon.tenant.mgt.util;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-public class TenantRegistryDataDeletionUtil {
-    public static final Log log = LogFactory.getLog(TenantRegistryDataDeletionUtil.class);
-    
-    /**
-     * Delete all tenant information related to tenant stored in REG tables
-     * @param tenantId id of tenant whose data should be deleted
-     * @param conn database connection object
-     * @throws SQLException thrown if an error occurs while executing the queries 
-     */
-    public static void deleteTenantRegistryData(int tenantId, Connection conn) throws Exception {
-        try {
-            conn.setAutoCommit(false);
-            String deleteClusterLockSql = "DELETE FROM REG_CLUSTER_LOCK WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteClusterLockSql, tenantId);
-
-            String deleteLogSql = "DELETE FROM REG_LOG WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteLogSql, tenantId);
-
-            String deleteAssociationSql = "DELETE FROM REG_ASSOCIATION WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteAssociationSql, tenantId);
-
-            String deleteSnapshotSql = "DELETE FROM REG_SNAPSHOT WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteSnapshotSql, tenantId);
-
-            String deleteResourceCommentSql = "DELETE FROM REG_RESOURCE_COMMENT WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteResourceCommentSql, tenantId);
-
-            String deleteCommentSql = "DELETE FROM REG_COMMENT WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteCommentSql, tenantId);
-
-            String deleteResourceRatingSql = "DELETE FROM REG_RESOURCE_RATING WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteResourceRatingSql, tenantId);
-
-            String deleteRatingSql = "DELETE FROM REG_RATING WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteRatingSql, tenantId);
-
-            String deleteResourceTagSql = "DELETE FROM REG_RESOURCE_TAG WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteResourceTagSql, tenantId);
-
-            String deleteTagSql = "DELETE FROM REG_TAG WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteTagSql, tenantId);
-
-            String deleteResourcePropertySql = "DELETE FROM REG_RESOURCE_PROPERTY WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteResourcePropertySql, tenantId);
-
-            String deletePropertySql = "DELETE FROM REG_PROPERTY WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deletePropertySql, tenantId);
-
-            String deleteResourceHistorySql = "DELETE FROM REG_RESOURCE_HISTORY WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteResourceHistorySql, tenantId);
-
-            String deleteContentHistorySql = "DELETE FROM REG_CONTENT_HISTORY WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteContentHistorySql, tenantId);
-
-            String deleteResourceSql = "DELETE FROM REG_RESOURCE WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteResourceSql, tenantId);
-
-            String deleteContentSql = "DELETE FROM REG_CONTENT WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteContentSql, tenantId);
-
-            String deletePathSql = "DELETE FROM REG_PATH WHERE REG_TENANT_ID = ?";
-            executeDeleteQuery(conn, deletePathSql, tenantId);
-
-            conn.commit();
-        } catch (SQLException e) {
-            conn.rollback();
-            String errorMsg = "An error occurred while deleting registry data for tenant: " + tenantId;
-            log.error(errorMsg, e);
-            throw new Exception(errorMsg, e);
-        } finally {
-            conn.close();
-        }
-    }
-
-    private static void executeDeleteQuery(Connection conn, String query, int tenantId)
-            throws Exception {
-        PreparedStatement ps = null;
-        try {
-            ps = conn.prepareStatement(query);
-            ps.setInt(1, tenantId);
-            ps.executeUpdate();
-        } catch (SQLException e) {
-            String errMsg = "Error executing query " + query + " for tenant: " + tenantId;
-            log.error(errMsg, e);
-            throw new Exception(errMsg, e);
-        } finally {
-            if (ps != null) {
-                ps.close();
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantUMDataDeletionUtil.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantUMDataDeletionUtil.java b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantUMDataDeletionUtil.java
deleted file mode 100644
index 4130e8f..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantUMDataDeletionUtil.java
+++ /dev/null
@@ -1,112 +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.wso2.carbon.tenant.mgt.util;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-public class TenantUMDataDeletionUtil {
-    public static final Log log = LogFactory.getLog(TenantUMDataDeletionUtil.class);
-
-    /**
-     * Delete all tenant information related to tenant stored in UM tables
-     * @param tenantId id of tenant whose data should be deleted
-     * @param conn database connection object
-     * @throws SQLException thrown if an error occurs while executing the queries
-     */
-    public static void deleteTenantUMData(int tenantId, Connection conn) throws Exception {
-        try {
-            conn.setAutoCommit(false);
-            String deleteUserPermissionSql = "DELETE FROM UM_USER_PERMISSION WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteUserPermissionSql, tenantId);
-
-            String deleteRolePermissionSql = "DELETE FROM UM_ROLE_PERMISSION WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteRolePermissionSql, tenantId);
-
-            String deletePermissionSql = "DELETE FROM UM_PERMISSION WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deletePermissionSql, tenantId);
-
-            String deleteClaimBehaviourSql = "DELETE FROM UM_CLAIM_BEHAVIOR WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteClaimBehaviourSql, tenantId);
-
-            String deleteProfileConfigSql = "DELETE FROM UM_PROFILE_CONFIG WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteProfileConfigSql, tenantId);
-
-            String deleteClaimSql = "DELETE FROM UM_CLAIM WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteClaimSql, tenantId);
-
-            String deleteDialectSql = "DELETE FROM UM_DIALECT WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteDialectSql, tenantId);
-
-            String deleteUserAttributeSql = "DELETE FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteUserAttributeSql, tenantId);
-
-            String deleteHybridUserRoleSql = "DELETE FROM UM_HYBRID_USER_ROLE WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteHybridUserRoleSql, tenantId);
-
-            String deleteHybridRoleSql = "DELETE FROM UM_HYBRID_ROLE WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteHybridRoleSql, tenantId);
-
-            String deleteHybridRememberMeSql = "DELETE FROM UM_HYBRID_REMEMBER_ME WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteHybridRememberMeSql, tenantId);
-
-            String deleteUserRoleSql = "DELETE FROM UM_USER_ROLE WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteUserRoleSql, tenantId);
-
-            String deleteRoleSql = "DELETE FROM UM_ROLE WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteRoleSql, tenantId);
-
-            String deleteUserSql = "DELETE FROM UM_USER WHERE UM_TENANT_ID = ?";
-            executeDeleteQuery(conn, deleteUserSql, tenantId);
-
-            String deleteTenantSql = "DELETE FROM UM_TENANT WHERE UM_ID = ?";
-            executeDeleteQuery(conn, deleteTenantSql, tenantId);
-
-            conn.commit();
-        } catch (Exception e) {
-            conn.rollback();
-            String errorMsg = "An error occurred while deleting registry data for tenant: " + tenantId;
-            log.error(errorMsg, e);
-            throw new Exception(errorMsg, e);
-        } finally {
-            conn.close();
-        }
-    }
-
-    private static void executeDeleteQuery(Connection conn, String query, int tenantId)
-            throws Exception {
-        PreparedStatement ps = null;
-        try {
-            ps = conn.prepareStatement(query);
-            ps.setInt(1, tenantId);
-            ps.executeUpdate();
-        } catch (SQLException e) {
-            String errMsg = "Error executing query " + query + " for tenant: " + tenantId;
-            log.error(errMsg, e);
-            throw new Exception(errMsg, e);
-        } finally {
-            if (ps != null) {
-                ps.close();
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/resources/META-INF/component.xml b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/resources/META-INF/component.xml
deleted file mode 100644
index 883930f..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/resources/META-INF/component.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~  Copyright (c) 2009, 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.
-  -->
-
-<component xmlns="http://products.wso2.org/carbon">
-    <ManagementPermissions>
-        <ManagementPermission>
-            <DisplayName>Manage</DisplayName>
-            <ResourceId>/permission/protected/manage</ResourceId>
-        </ManagementPermission>
-        <ManagementPermission>
-            <DisplayName>Monitor</DisplayName>
-            <ResourceId>/permission/protected/manage/monitor</ResourceId>
-        </ManagementPermission>
-        <ManagementPermission>
-            <DisplayName>Tenants</DisplayName>
-            <ResourceId>/permission/protected/manage/monitor/tenants</ResourceId>
-        </ManagementPermission>
-        <ManagementPermission>
-            <DisplayName>Modify</DisplayName>
-            <ResourceId>/permission/protected/manage/modify</ResourceId>
-        </ManagementPermission>
-        <ManagementPermission>
-            <DisplayName>Tenants</DisplayName>
-            <ResourceId>/permission/protected/manage/modify/tenants</ResourceId>
-        </ManagementPermission>
-   </ManagementPermissions>
-</component>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/resources/META-INF/services.xml
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/resources/META-INF/services.xml b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/resources/META-INF/services.xml
deleted file mode 100644
index e028811..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt/2.1.0/src/main/resources/META-INF/services.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- !
- ! Copyright 2006 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.
- !-->
-<serviceGroup>
-
-    <service name="TenantMgtService" scope="transportsession">
-        <transports>
-            <transport>https</transport>
-        </transports>
-        <parameter name="ServiceClass" locked="false">
-            org.wso2.carbon.tenant.mgt.services.TenantSelfRegistrationService
-        </parameter>
-        <operation name="registerTenant">
-        </operation>
-        <operation name="checkDomainAvailability">
-        </operation>
-        <operation name="validateOrSuggestDomain">
-        </operation>
-        <operation name="generateRandomCaptcha">
-        </operation>
-    </service>
-
-    <service name="TenantMgtAdminService" scope="transportsession">
-        <transports>
-            <transport>https</transport>
-        </transports>
-        <parameter name="ServiceClass" locked="false">
-            org.wso2.carbon.tenant.mgt.services.TenantMgtAdminService
-        </parameter>
-        <operation name="addTenant">
-            <parameter name="superTenantService" locked="true">true</parameter>
-            <parameter name="AuthorizationAction" locked="true">/permission/protected/manage/monitor/tenants</parameter>
-        </operation>
-        <operation name="retrieveTenants">
-            <parameter name="superTenantService" locked="true">true</parameter>
-            <parameter name="AuthorizationAction" locked="true">/permission/protected/manage/monitor/tenants</parameter>
-        </operation>
-        <operation name="retrievePaginatedTenants">
-            <parameter name="superTenantService" locked="true">true</parameter>
-            <parameter name="AuthorizationAction" locked="true">/permission/protected/manage/monitor/tenants</parameter>
-        </operation>
-         <operation name="retrievePartialSearchTenants">
-            <parameter name="superTenantService" locked="true">true</parameter>
-            <parameter name="AuthorizationAction" locked="true">/permission/protected/manage/monitor/tenants</parameter>
-        </operation>
-        <operation name="retrievePaginatedPartialSearchTenants">
-            <parameter name="superTenantService" locked="true">true</parameter>
-            <parameter name="AuthorizationAction" locked="true">/permission/protected/manage/monitor/tenants</parameter>
-        </operation>
-        <operation name="getTenant">
-            <parameter name="superTenantService" locked="true">true</parameter>
-            <parameter name="AuthorizationAction" locked="true">/permission/protected/manage/monitor/tenants</parameter>
-        </operation>
-        <operation name="updateTenant">
-            <parameter name="superTenantService" locked="true">true</parameter>
-            <parameter name="AuthorizationAction" locked="true">/permission/protected/manage/modify/tenants</parameter>
-        </operation>
-        <operation name="activateTenant">
-            <parameter name="superTenantService" locked="true">true</parameter>
-            <parameter name="AuthorizationAction" locked="true">/permission/protected/manage/modify/tenants</parameter>
-        </operation>
-        <operation name="deactivateTenant">
-            <parameter name="superTenantService" locked="true">true</parameter>
-            <parameter name="AuthorizationAction" locked="true">/permission/protected/manage/modify/tenants</parameter>
-        </operation>
-        <operation name="deleteTenant">
-            <parameter name="superTenantService" locked="true">true</parameter>
-            <parameter name="AuthorizationAction" locked="true">/permission/protected/manage/modify/tenants</parameter>
-        </operation>
-        <parameter name="adminService" locked="true">true</parameter>
-    </service>
-    
-    <service name="GAppTenantRegistrationService">
-        <transports>
-            <transport>https</transport>
-        </transports>
-        <schema schemaNamespace="http://org.apache.axis2/xsd" elementFormDefaultQualified="true"/>
-        <description>Rampart protected service that is used to setup Google Apps domain</description>
-        <parameter name="ServiceClass">org.wso2.carbon.tenant.mgt.services.GAppTenantRegistrationService</parameter>
-        <parameter name="adminService" locked="true">false</parameter>
-
-        <module ref="rampart"/>
-
-        <wsp:Policy wsu:Id="SigOnly"
-                    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
-                    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
-            <wsp:ExactlyOne>
-                <wsp:All>
-                    <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
-                        <wsp:Policy>
-                            <sp:InitiatorToken>
-                                <wsp:Policy>
-                                    <sp:X509Token
-                                            sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
-                                        <wsp:Policy>
-                                            <sp:RequireThumbprintReference/>
-                                            <sp:WssX509V3Token10/>
-                                        </wsp:Policy>
-                                    </sp:X509Token>
-                                </wsp:Policy>
-                            </sp:InitiatorToken>
-                            <sp:RecipientToken>
-                                <wsp:Policy>
-                                    <sp:X509Token
-                                            sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
-                                        <wsp:Policy>
-                                            <sp:RequireThumbprintReference/>
-                                            <sp:WssX509V3Token10/>
-                                        </wsp:Policy>
-                                    </sp:X509Token>
-                                </wsp:Policy>
-                            </sp:RecipientToken>
-                            <sp:AlgorithmSuite>
-                                <wsp:Policy>
-                                    <sp:Basic256/>
-                                </wsp:Policy>
-                            </sp:AlgorithmSuite>
-                            <sp:Layout>
-                                <wsp:Policy>
-                                    <sp:Strict/>
-                                </wsp:Policy>
-                            </sp:Layout>
-                            <sp:IncludeTimestamp/>
-                            <sp:OnlySignEntireHeadersAndBody/>
-                        </wsp:Policy>
-                    </sp:AsymmetricBinding>
-                    <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
-                        <wsp:Policy>
-                            <sp:MustSupportRefKeyIdentifier/>
-                            <sp:MustSupportRefIssuerSerial/>
-                        </wsp:Policy>
-                    </sp:Wss10>
-                    <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
-                        <sp:Body/>
-                    </sp:SignedParts>
-                </wsp:All>
-            </wsp:ExactlyOne>
-        </wsp:Policy>
-    </service>
-    <parameter name="hiddenService" locked="true">true</parameter>
-</serviceGroup>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/pom.xml b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/pom.xml
deleted file mode 100644
index 67221c7..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/pom.xml
+++ /dev/null
@@ -1,123 +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.wso2.carbon</groupId>
-        <artifactId>tenant-mgt-parent</artifactId>
-        <version>2.1.0</version>
-<relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.wso2.carbon.register.ui</artifactId>
-	<version>2.1.0</version>
-    <packaging>bundle</packaging>
-    <name>WSO2 Stratos - Self Registration For New Tenant - User Interface</name>
-
-    <build>
-		<plugins>
-            <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>
-                        <Export-Package>
-                            org.wso2.carbon.register.ui.*,
-                        </Export-Package>
-                        <Import-Package>
-                        	org.wso2.carbon.tenant.register.stub.*; version="${carbon.platform.package.import.version.range}"
-                            javax.servlet;version="${imp.pkg.version.javax.servlet}",
-                            javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
-                            !javax.xml.namespace,
-                            javax.xml.namespace; version=0.0.0,                            
-                            org.apache.lucene.*,
-                            org.wso2.carbon.captcha.mgt.*,
-                            *;resolution:=optional
-                        </Import-Package>
-                        <Carbon-Component>UIBundle</Carbon-Component>
-                    </instructions>
-                </configuration>
-            </plugin>
-
-        </plugins>
-    </build>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.common.ui</artifactId>
-        </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>
-            <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>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.ui</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.stratos.common</artifactId>
-            <version>2.1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.tenant.register.stub</artifactId>
-        </dependency>
-         <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.stratos.common.stub</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.json.wso2</groupId>
-          <artifactId>json</artifactId>
-        </dependency>
-        <dependency>
-           <groupId>org.wso2.carbon</groupId>
-           <artifactId>org.wso2.carbon.captcha.mgt</artifactId>
-            <version>${wso2carbon.version}</version>
-        </dependency>
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/java/org/wso2/carbon/register/ui/clients/PackageInfoServiceClient.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/java/org/wso2/carbon/register/ui/clients/PackageInfoServiceClient.java b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/java/org/wso2/carbon/register/ui/clients/PackageInfoServiceClient.java
deleted file mode 100644
index 8fc3195..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/java/org/wso2/carbon/register/ui/clients/PackageInfoServiceClient.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.wso2.carbon.register.ui.clients;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.stratos.common.packages.stub.PackageInfoServiceStub;
-import org.wso2.carbon.stratos.common.packages.stub.PackageInfo;
-
-/**
- * PackageInfoService client
- */
-public class PackageInfoServiceClient {
-
-    private static Log log = LogFactory.getLog(PackageInfoServiceClient.class);
-
-    private PackageInfoServiceStub stub;
-    private String epr;
-
-    public PackageInfoServiceClient(
-            String cookie, String backendServerURL, ConfigurationContext configContext)
-            throws Exception {
-
-        epr = backendServerURL + "PackageInfoService";
-
-        try {
-            stub = new PackageInfoServiceStub(configContext, epr);
-
-            ServiceClient client = stub._getServiceClient();
-            Options option = client.getOptions();
-            option.setManageSession(true);
-            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
-
-        } catch (AxisFault axisFault) {
-            String msg = "Failed to initiate PackageInfoService client. " + axisFault.getMessage();
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-    public PackageInfo[] getBillingPackages() throws Exception {
-
-        try {
-            return stub.getPackageInfos();
-        } catch (Exception e) {
-            String msg = "Failed to get package information: " + e.getMessage();
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }
-    }
-
-    public JSONArray getBillingPackagesJsonArray() throws Exception {
-
-        try {
-            PackageInfo[] packageInfoArray = stub.getPackageInfos();
-            JSONArray jsonPackageInfoArray = new JSONArray();
-            for (PackageInfo packageInfo : packageInfoArray) {
-                JSONObject packageInfoObj = new JSONObject();
-                packageInfoObj.put("name", packageInfo.getName());
-                //TODO https://wso2.org/jira/browse/STRATOS-1819
-                packageInfoObj.put("subscriptionCharge", packageInfo.getSubscriptionCharge());
-                jsonPackageInfoArray.put(packageInfoObj);
-            }
-            return jsonPackageInfoArray;
-        } catch (Exception e) {
-            String msg = "Failed to get package information: " + e.getMessage();
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/java/org/wso2/carbon/register/ui/clients/TenantSelfRegistrationClient.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/java/org/wso2/carbon/register/ui/clients/TenantSelfRegistrationClient.java b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/java/org/wso2/carbon/register/ui/clients/TenantSelfRegistrationClient.java
deleted file mode 100644
index 7eb58e4..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/java/org/wso2/carbon/register/ui/clients/TenantSelfRegistrationClient.java
+++ /dev/null
@@ -1,107 +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.wso2.carbon.register.ui.clients;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.CarbonConstants;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.tenant.register.stub.TenantMgtServiceStub;
-import org.wso2.carbon.tenant.register.stub.beans.xsd.CaptchaInfoBean;
-import org.wso2.carbon.tenant.register.stub.beans.xsd.TenantInfoBean;
-import org.wso2.carbon.ui.CarbonUIUtil;
-import org.wso2.carbon.utils.ServerConstants;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.http.HttpSession;
-
-/**
- * Tenant Self Registration Client class
- */
-public class TenantSelfRegistrationClient {
-     private static final Log log = LogFactory.getLog(TenantSelfRegistrationClient.class);
-
-    private TenantMgtServiceStub stub;
-    private String epr;
-
-    public TenantSelfRegistrationClient(
-            String cookie, String backendServerURL, ConfigurationContext configContext)
-            throws RegistryException {
-
-        epr = backendServerURL + "TenantMgtService";
-
-        try {
-            stub = new TenantMgtServiceStub(configContext, epr);
-
-            ServiceClient client = stub._getServiceClient();
-            Options option = client.getOptions();
-            option.setManageSession(true);
-            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
-
-        } catch (AxisFault axisFault) {
-            String msg = "Failed to initiate AddServices service client. " + axisFault.getMessage();
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-    public TenantSelfRegistrationClient(ServletConfig config, HttpSession session)
-            throws RegistryException {
-
-        String cookie = (String)session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-        String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
-        ConfigurationContext configContext = (ConfigurationContext) config.
-                getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
-        epr = backendServerURL + "TenantMgtService";
-
-        try {
-            stub = new TenantMgtServiceStub(configContext, epr);
-
-            ServiceClient client = stub._getServiceClient();
-            Options option = client.getOptions();
-            option.setManageSession(true);
-            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
-
-        } catch (AxisFault axisFault) {
-            String msg = "Failed to initiate Add Services service client. " + axisFault.getMessage();
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-    public String registerTenant(TenantInfoBean tenantInfoBean,
-                                 CaptchaInfoBean captchaInfoBean) throws Exception {
-        return stub.registerTenant(tenantInfoBean, captchaInfoBean);
-     }
-
-    public boolean checkDomainAvailability(String domainName) throws Exception {
-        return stub.checkDomainAvailability(domainName);
-    }
-
-    public String validateOrSuggestDomain(String domainName, String successKey) throws Exception {
-        return stub.validateOrSuggestDomain(domainName, successKey);
-    }
-
-    public CaptchaInfoBean generateRandomCaptcha() throws Exception {
-        return stub.generateRandomCaptcha();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/java/org/wso2/carbon/register/ui/utils/TenantConfigUtil.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/java/org/wso2/carbon/register/ui/utils/TenantConfigUtil.java b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/java/org/wso2/carbon/register/ui/utils/TenantConfigUtil.java
deleted file mode 100644
index fc08c7b..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/java/org/wso2/carbon/register/ui/utils/TenantConfigUtil.java
+++ /dev/null
@@ -1,248 +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.wso2.carbon.register.ui.utils;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.util.Base64;
-import org.apache.axis2.AxisFault;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.register.ui.clients.TenantSelfRegistrationClient;
-import org.wso2.carbon.registry.common.ui.UIException;
-import org.wso2.carbon.tenant.register.stub.beans.xsd.CaptchaInfoBean;
-import org.wso2.carbon.tenant.register.stub.beans.xsd.TenantInfoBean;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-import java.io.StringReader;
-import java.util.Calendar;
-import java.util.Iterator;
-
-/**
- * Utility methods for tenant configuration
- */
-public class TenantConfigUtil {
-    private static final Log log = LogFactory.getLog(TenantConfigUtil.class);
-
-    /**
-     * Registers the tenant
-     *
-     * @param request HttpServletRequest
-     * @param config  ServletConfig
-     * @param session HttpSession
-     * @return String
-     * @throws UIException
-     */
-    public static String registerTenantConfigBean(HttpServletRequest request,
-                                                  ServletConfig config, HttpSession session) throws UIException {
-        TenantInfoBean tenantInfoBean = new TenantInfoBean();
-        CaptchaInfoBean captchaInfoBean = new CaptchaInfoBean();
-
-        try {
-            // filling tenant info.
-            tenantInfoBean.setFirstname(request.getParameter("admin-firstname"));
-            tenantInfoBean.setLastname(request.getParameter("admin-lastname"));
-            tenantInfoBean.setAdmin(request.getParameter("admin"));
-            tenantInfoBean.setAdminPassword(request.getParameter("admin-password"));
-            tenantInfoBean.setTenantDomain(resolveDomainName(request.getParameter("domain")));
-            tenantInfoBean.setEmail(request.getParameter("admin-email"));
-            tenantInfoBean.setSuccessKey((String) session.getAttribute("validate-domain-success-key"));
-            tenantInfoBean.setUsagePlan(request.getParameter("selectedUsagePlan"));
-            tenantInfoBean.setOriginatedService(TenantConfigUtil.base64Decode((String) session.getAttribute(
-                    StratosConstants.ORIGINATED_SERVICE)));
-            tenantInfoBean.setCreatedDate(Calendar.getInstance());
-            // filling captcha info
-            captchaInfoBean.setSecretKey(request.getParameter("captcha-secret-key"));
-            captchaInfoBean.setUserAnswer(request.getParameter("captcha-user-answer"));
-
-            TenantSelfRegistrationClient selfRegistrationClient =
-                    new TenantSelfRegistrationClient(config, session);
-
-            String returnText = selfRegistrationClient.registerTenant(tenantInfoBean, captchaInfoBean);
-
-            return returnText;
-
-        } catch (Exception e) {
-            AxisFault fault = new AxisFault(e.getMessage());
-            String msg = fault.getReason() + " Failed to add tenant config. tenant-domain: " +
-                    tenantInfoBean.getTenantDomain() + ", " +
-                    "tenant-admin: " + tenantInfoBean.getAdmin() + ".";
-            log.error(msg, e);
-            // we are preserving the original message.
-            throw new UIException(e.getMessage(), e);
-        }
-    }
-
-
-    // do this before the send redirect.
-
-    public static void setSubmissionValuesForSession(HttpServletRequest request) {
-        HttpSession session = request.getSession();
-
-        session.setAttribute("submit-domain", resolveDomainName(request.getParameter("domain")));
-        session.setAttribute("submit-admin", request.getParameter("admin"));
-        session.setAttribute("submit-admin-firstname", request.getParameter("admin-firstname"));
-        session.setAttribute("submit-admin-lastname", request.getParameter("admin-lastname"));
-        session.setAttribute("submit-admin-email", request.getParameter("admin-email"));
-    }
-
-
-    /**
-     * Checks the availability of the domain
-     *
-     * @param request HttpServletRequest
-     * @param config  ServletConfig
-     * @param session HttpSession
-     * @return true, if domain is available to register
-     * @throws UIException if failed to check the availability.
-     */
-    public static boolean checkDomainAvailability(
-            HttpServletRequest request, ServletConfig config, HttpSession session)
-            throws UIException {
-        String tenantDomain = null;
-        try {
-            tenantDomain = resolveDomainName(request.getParameter("domain"));
-            TenantSelfRegistrationClient selfRegistrationClient =
-                    new TenantSelfRegistrationClient(config, session);
-            return selfRegistrationClient.checkDomainAvailability(tenantDomain);
-        } catch (Exception e) {
-            String msg = "Failed to check the domain availability:" + tenantDomain + ".";
-            log.error(msg, e);
-            throw new UIException(msg, e);
-        }
-    }
-
-    /**
-     * Validates or suggests the domain
-     *
-     * @param config  ServletConfig
-     * @param session HttpSession
-     * @return domain
-     * @throws UIException, if validating or suggesting the domain failed.
-     */
-    public static String validateOrSuggestDomain(ServletConfig config,
-                                                 HttpSession session) throws UIException {
-        String tempDomainToRegister = resolveDomainName(
-                (String) session.getAttribute("temp-domain-to-register"));
-        // here successKey can be null, in such cases services will directly go to suggest a name
-        String successKey = (String) session.getAttribute("validate-domain-success-key");
-
-        try {
-            TenantSelfRegistrationClient selfRegistrationClient =
-                    new TenantSelfRegistrationClient(config, session);
-            return selfRegistrationClient.validateOrSuggestDomain(tempDomainToRegister, successKey);
-        } catch (Exception e) {
-            String msg = "Failed to validate or suggest a domain related to :" +
-                    tempDomainToRegister + ".";
-            log.error(msg, e);
-            throw new UIException(msg, e);
-        }
-    }
-
-    /**
-     * Generates a random captcha
-     *
-     * @param config  ServletConfig
-     * @param session HttpSession
-     * @return CaptchaInfoBean
-     * @throws UIException, if generating the random captcha fails.
-     */
-    public static CaptchaInfoBean generateRandomCaptcha(ServletConfig config,
-                                                        HttpSession session) throws UIException {
-        try {
-            TenantSelfRegistrationClient selfRegistrationClient =
-                    new TenantSelfRegistrationClient(config, session);
-            return selfRegistrationClient.generateRandomCaptcha();
-        } catch (Exception e) {
-            String msg = "Error in generating the captcha image.";
-            log.error(msg, e);
-            throw new UIException(msg, e);
-        }
-    }
-
-    public static HttpServletRequest readIntermediateData(HttpServletRequest request, String data) {
-        try {
-            XMLStreamReader parser =
-                    XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(data));
-            StAXOMBuilder builder = new StAXOMBuilder(parser);
-            OMElement documentElement = builder.getDocumentElement();
-            Iterator it = documentElement.getChildElements();
-            while (it.hasNext()) {
-                OMElement element = (OMElement) it.next();
-                if ("admin".equals(element.getLocalName())) {
-                    request.setAttribute("admin", element.getText());
-                } else if ("firstname".equals(element.getText())) {
-                    request.setAttribute("firstname", element.getText());
-                } else if ("lastname".equals(element.getText())) {
-                    request.setAttribute("lastname", element.getText());
-                } else if ("email".equals(element.getLocalName())) {
-                    request.setAttribute("email", element.getText());
-                } else if ("tenantDomain".equals(element.getLocalName())) {
-                    request.setAttribute("tenantDomain", element.getText());
-                } else if ("confirmationKey".equals(element.getLocalName())) {
-                    request.setAttribute("confirmationKey", element.getText());
-                }
-            }
-        } catch (Exception e) {
-            log.error("Error parsing xml", e);
-        }
-        return request;
-    }
-
-    /**
-     * Resolves the correct domain name in the form of example.com from the user input domain name.
-     * Currently strips out "www."and white space. Can add more checks.
-     *
-     * @param domainNameUserInput the user input domain name
-     * @return the domain after removing (if entered) www. from the input.
-     */
-    public static String resolveDomainName(String domainNameUserInput) {
-        if (domainNameUserInput == null) {
-            String msg = "Provided domain name is null";
-            log.error(msg);
-            return "";
-        }
-        String domainName = domainNameUserInput.trim();
-        if (domainName.startsWith("www.")) {
-            domainName = domainName.substring(4);
-        }
-        return domainName;
-    }
-
-    /**
-     * A basic method to decode the encoded Stratos Service Name
-     *
-     * @param encodedStr Encoded Stratos Service Name
-     * @return Decoded Stratos Service name
-     */
-    private static String base64Decode(String encodedStr) {
-        String decodedStr = null;
-        // Check whether this value is null(not set) or set to "null" which is also possible.
-        if (encodedStr != null && !"null".equals(encodedStr)) {
-            decodedStr = new String(Base64.decode(encodedStr));
-        }
-        return decodedStr;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/META-INF/component.xml b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/META-INF/component.xml
deleted file mode 100644
index aa11e6b..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/META-INF/component.xml
+++ /dev/null
@@ -1,70 +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.
- -->
-<component xmlns="http://products.wso2.org/carbon">
-    <!-- sample menu configuration -->
-    <menus>
-        <menu>
-            <id>gaas_menu</id>
-            <i18n-key>gaas</i18n-key>
-            <i18n-bundle>org.wso2.carbon.register.ui.i18n.Resources</i18n-bundle>
-            <parent-menu></parent-menu>
-            <link>#</link>
-            <skip-authentication/>
-            <region>region1</region>
-            <order>2</order>
-            <style-class>home</style-class>
-        </menu>
-        <menu>
-            <id>gaas_register_org_menu</id>
-            <i18n-key>register.org.menu</i18n-key>
-            <i18n-bundle>org.wso2.carbon.register.ui.i18n.Resources</i18n-bundle>
-            <parent-menu>gaas_menu</parent-menu>
-            <link>../tenant-register/select_domain.jsp</link>
-            <region>region1</region>
-            <order>1</order>
-            <style-class>manage</style-class>
-            <icon>../tenant-register/images/signup-new-org.gif</icon>
-            <skip-authentication>
-                <skip-link>../tenant-register/self_registration_complete.jsp</skip-link>
-                <skip-link>../tenant-register/domain_availability_ajaxprocessor.jsp</skip-link>
-                <skip-link>../tenant-register/select_domain.jsp</skip-link>
-                <skip-link>../tenant-register/select_usage_plan.jsp</skip-link>
-                <skip-link>../tenant-register/success_register.jsp</skip-link>
-
-                <!-- the following files need to be placed in the validate-domain ui component,
-                 but since it has no menu, it had to be moved here -->
-                <skip-link>../validate-domain/validate_domain_not_logged_in.jsp</skip-link>
-                <skip-link>../validate-domain/validate_with_dns_ajaxprocessor.jsp</skip-link>
-                <skip-link>../validate-domain/validate_with_text_ajaxprocessor.jsp</skip-link>
-                <skip-link>../validate-domain/submit_validate_domain_ajaxprocessor.jsp</skip-link>
-
-                <!-- account-mgt stuff -->
-                <skip-link>../account-mgt/update_verifier.jsp</skip-link>
-                <skip-link>../email-verification/validator_ajaxprocessor.jsp</skip-link>
-                <skip-link>../email-verification/invalid_email.jsp</skip-link>
-                <skip-link>../account-mgt/update_verifier_redirector_ajaxprocessor.jsp</skip-link>
-
-                <!--payment stuff -->
-                <skip-link>../payment/registration_payment.jsp</skip-link>
-                <skip-link>../payment/registration_payment_completed.jsp</skip-link>
-            </skip-authentication>
-            <require-not-logged-in>true</require-not-logged-in>
-        </menu>
-    </menus>
-
-</component>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/org/wso2/carbon/register/ui/i18n/JSResources.properties
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/org/wso2/carbon/register/ui/i18n/JSResources.properties b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/org/wso2/carbon/register/ui/i18n/JSResources.properties
deleted file mode 100644
index c49c4b0..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/org/wso2/carbon/register/ui/i18n/JSResources.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-password.mismatched=Passwords do not match.
-email.mismatched=The emails are mismatching.
-current.password.should.provided=You should provide the current password in order to change the password.
-password.length=Your password must be at least 6 characters long. Try again.
-domain.available=Domain is available to register.
-domain.unavailable=Sorry!. The Domain is already registered. Please choose a different domain.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/org/wso2/carbon/register/ui/i18n/Resources.properties
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/org/wso2/carbon/register/ui/i18n/Resources.properties b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/org/wso2/carbon/register/ui/i18n/Resources.properties
deleted file mode 100644
index b757c4f..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/org/wso2/carbon/register/ui/i18n/Resources.properties
+++ /dev/null
@@ -1,62 +0,0 @@
-submit.tenant=Submit Tenant
-domain=Tenant Domain
-domain.information=Domain Information
-terms.of.use=Terms of Use
-contact.details=Contact Details
-admin.username=Admin Username
-username=Username
-username.or.domain=Username/Domain
-current.admin.password=Current Admin Password
-new.admin.password=New Admin Password
-new.admin.password.repeat=New Admin Password (Repeat)
-admin.password=Admin Password
-admin.password.repeat=Admin Password (Repeat)
-govern.add_tenants.menu=Add New Tenant
-govern.view_tenants.menu=View Tenants
-overview=Overview
-tenants.list=Tenants List
-company.organization=Company/Organization
-admin.contact=Admin Contact
-edit=Edit
-multitenancy=Multitenancy
-added.successfully=You have successfully added a new tenant with domain:
-updated.successfully=You have successfully updated the tenant with domain:
-update.added.tenant=Update the just added/updated tenant
-update.tenant=Update Tenant
-add.new.tenant=Add a new tenant
-register.new.organization=Sign up your organization
-view.all.tenants=View all tenants
-tenant.admin=Tenant Admin
-tenant.description=Tenant Description
-admin.fullname=Full Name
-admin.firstname=First Name
-admin.lastname=Last Name
-admin.address=Address
-admin.email=Email
-admin.email.repeat=Email (Repeat)
-admin.telephone=Telephone
-admin.im=IM
-admin.url=URL
-self.registration=Registry Tenant
-gaas=Sign up
-register.org.menu=Sign up new organization
-gaas.register.a.new.tenant=Register A New Tenant
-active=Active
-theme.management=Theme Management
-word.verification=Word Verification
-captcha.message=Type the characters you see in the picture below.
-select.domain.menu=Sign up new organization
-select.domain.title=Select a domain for your organization
-password.reset=Password Reset
-password.reset.failed=Password Reset Attempt Failed
-verified.request.successfully=You have successfully verified your Password reset request.\nPls reset your password below.
-request.verification.failed=Password Reset Verification Failed. \nPls make sure you have clicked the correct link to reset your domain's admin password.
-accept.eula=I have read and accepted the terms in the license agreement above.
-usage.plan.information= Usage Plan Information
-select.usage.plan.for.tenant=Select Usage Plan For Tenant
-demo.package.price=$0 per month
-select.package.message=According to the selected plan, resources will be allocated for you. You can upgrade or downgrade your plan later according to your requirements. If you need more information on plans, click 'Pricing Info'.
-required.msg=All fields marked with an asterisk (<span class="required">*</span>) are required. 
-billing.currency=$
-redirect.to.paypal.msg1=You will be redirected to PayPal to make a registration payment of
-redirect.to.paypal.msg2=Do you wish to proceed?  
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/web/tenant-register/css/tenant-register.css
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/web/tenant-register/css/tenant-register.css b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/web/tenant-register/css/tenant-register.css
deleted file mode 100644
index 47d279b..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/web/tenant-register/css/tenant-register.css
+++ /dev/null
@@ -1,78 +0,0 @@
-body {
-	color:#111111;
-	font-size:0.75em;
-	font-size-adjust:none;
-	font-style:normal;
-	font-variant:normal;
-	font-weight:normal;
-	line-height:1.25em;
-	background-image: url(../images/body-bg.gif);
-	background-position: left top;
-	background-repeat: repeat-x;
-	margin: 0px;
-	padding: 0px;
-}
-
-div.clear {
-	clear:both;
-}
-p { }
-
-td { }
-
-a:link { }
-
-a:visited { }
-
-a:hover { }
-
-a:active { }
-
-div.features {
-	background-image: url(../images/features-bg.gif);
-	background-position: 39px 30px;
-	background-repeat: no-repeat;
-}
-div.feature {
-	float: left;
-	width: 221px;
-	margin-left: 39px;
-	margin-top: 30px;
-	padding: 20px;
-	text-align: left;
-}
-div.feature img {
-	float: left;
-	margin-right: 10px;
-	width: 64px;
-}
-div.feature h2 {
-	margin-top: 0px;
-	margin-bottom: 7px;
-	color: #0499CC;
-	font-size: 155%;
-	line-height: 110%;
-	font-weight: normal;
-	
-}
-div.feature p {
-	margin-top: 0px;
-	padding-top: 0px;
-}
-td.page-header-help a{
-    position:absolute;
-    right:20px;
-}
-div#middle div#workArea {
-    padding:0px;
-}
-.registration_help{
-    color:#555;
-    line-height:25px;
-}
-.toggle_container ,h2.trigger {
-    box-shadow: none;
-}
-.leftCol-med{
-    width:180px;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/web/tenant-register/docs/aboutUsagePlans.html
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/web/tenant-register/docs/aboutUsagePlans.html b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/web/tenant-register/docs/aboutUsagePlans.html
deleted file mode 100644
index 791b867..0000000
--- a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/web/tenant-register/docs/aboutUsagePlans.html
+++ /dev/null
@@ -1,104 +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.
- -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-  <title>Select Usage Plan For Tenant - User Guide</title>
-  <link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all" />
-</head>
-
-<body>
-
-
- <h1>Select Usage Plan For Tenant</h1>
-
-
- <h2> <b> Usage Plans(Subscriptions)</b></h2>
-
-<p>
-    According to the usage plan that you selected you will get different volume of service and registry
-    bandwidths other services that available for tenants.By selecting right usage plan that suits
-    your requirements you can get maximum profit
-</p>
-
-
-<h2><b>Multitenancy Free</b></h2>
-<p>
-  This is the free usage plan.You will get limited amount of resources.This package is
-  best suite for evaluation and tests.
-</p>
- <h2><b>Multitenancy Small</b></h2>
-<p>
-   This package is best suite for small business.
-</p>
-<h2><b>Multitenancy Medium</b></h2>
-<p>
-   This usage plan suites for medium scale business.You will get average amount of resources
-    with this package.
-</p>
-<h2><b>Multitenancy Large</b></h2>
-<p>
-   This is the premium usage plan.You will get maximum resources form this plan.
-   This is best suite to large scale business.
-</p>
-
-<p>
-
-   Usage Plan summery
-<table border="1">
-<tr>
-<td>Usage Plan Name</td>
-<td>Number Of Users</td>
-<td>Registry Bandwidth (Mb) </td>
-<td>Service BandWidth (Mb) </td>
-<td>Cost Per Month ($)</td>
-</tr>
-<tr>
-<td>Multitenancy Free</td>
-<td>5</td>
-<td>10</td>
-<td>10</td>
-<td>10</td>
-</tr>
-<tr>
-<td>Multitenancy Small</td>
-<td>10</td>
-<td>25</td>
-<td>25</td>
-<td>25</td>
-</tr>
-<tr>
-<td>Multitenancy Medium</td>
-<td>20</td>
-<td>100</td>
-<td>100</td>
-<td>100</td>
-</tr>
-<tr>
-<td>Multitenancy Large</td>
-<td>50</td>
-<td>200</td>
-<td>200</td>
-<td>200</td>
-</tr>
-</table> 
-<div><strong>Figure1: Usage Plan Summery Table</strong></div>
-</p>
-</body>
-
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0d61aa98/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/web/tenant-register/docs/images/add-org.png
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/web/tenant-register/docs/images/add-org.png b/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/web/tenant-register/docs/images/add-org.png
deleted file mode 100644
index 3d97bab..0000000
Binary files a/components/stratos/tenant-mgt/org.wso2.carbon.tenant.registration.ui/2.1.0/src/main/resources/web/tenant-register/docs/images/add-org.png and /dev/null differ