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 08:36:59 UTC

[3/3] git commit: committing refactored tenant activity component

committing refactored tenant activity component


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/f5c66c37
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/f5c66c37
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/f5c66c37

Branch: refs/heads/master
Commit: f5c66c37f10446d04b623ed9a2dd4d89f99343f7
Parents: c4eb9c3
Author: Isuru <is...@wso2.com>
Authored: Wed Jul 10 12:04:29 2013 +0530
Committer: Isuru <is...@wso2.com>
Committed: Wed Jul 10 12:04:29 2013 +0530

----------------------------------------------------------------------
 components/pom.xml                              |   4 +
 .../ui/clients/TenantActivityServiceClient.java | 155 -----------------
 .../TenantActivityUIServiceComponent.java       |  57 ------
 .../ui/utils/ManagerConfigurations.java         | 148 ----------------
 .../activity/ui/utils/TenantMonitorUtil.java    | 143 ---------------
 .../src/main/resources/META-INF/component.xml   |  35 ----
 .../activity/ui/i18n/JSResources.properties     |   1 -
 .../activity/ui/i18n/Resources.properties       |  11 --
 .../web/tenant-activity/css/tenant-usage.css    |  28 ---
 .../tenant-activity/docs/images/view-usage.png  | Bin 44786 -> 0 bytes
 .../find-tenant-ajaxprocessor.jsp               |  59 -------
 .../web/tenant-activity/find-tenant.jsp         | 110 ------------
 .../tenant-activity/get-data-ajaxprocessor.jsp  |  66 -------
 .../images/instance-usage-report.gif            | Bin 849 -> 0 bytes
 .../web/tenant-activity/images/search.gif       | Bin 191 -> 0 bytes
 .../images/tenant-usage-report.gif              | Bin 1008 -> 0 bytes
 .../images/user-usage-report.gif                | Bin 1033 -> 0 bytes
 .../web/tenant-activity/show-active-tenants.jsp | 129 --------------
 .../web/tenant-activity/tenant-activity.jsp     | 174 -------------------
 .../activity/beans/PaginatedTenantDataBean.java |  52 ------
 .../tenant/activity/beans/TenantDataBean.java   |  98 -----------
 .../GetActiveTenantsInMemberRequest.java        |  59 -------
 .../GetActiveTenantsInMemberResponse.java       |  54 ------
 .../TenantActivityServiceComponent.java         |  99 -----------
 .../services/TenantActivityService.java         |  83 ---------
 .../activity/util/TenantActivityUtil.java       |  79 ---------
 .../wso2/carbon/tenant/activity/util/Util.java  |  85 ---------
 .../src/main/resources/META-INF/component.xml   |  37 ----
 .../src/main/resources/META-INF/services.xml    |  42 -----
 components/stratos/tenant-activity/pom.xml      |  41 -----
 .../pom.xml                                     | 142 +++++++++++++++
 .../ui/clients/TenantActivityServiceClient.java | 155 +++++++++++++++++
 .../TenantActivityUIServiceComponent.java       |  55 ++++++
 .../ui/utils/ManagerConfigurations.java         | 147 ++++++++++++++++
 .../activity/ui/utils/TenantMonitorUtil.java    | 143 +++++++++++++++
 .../src/main/resources/META-INF/component.xml   |  35 ++++
 .../activity/ui/i18n/JSResources.properties     |   1 +
 .../activity/ui/i18n/Resources.properties       |  11 ++
 .../web/tenant-activity/css/tenant-usage.css    |  28 +++
 .../tenant-activity/docs/images/view-usage.png  | Bin 0 -> 44786 bytes
 .../web/tenant-activity/docs/userguide.html     |  76 ++++++++
 .../find-tenant-ajaxprocessor.jsp               |  59 +++++++
 .../web/tenant-activity/find-tenant.jsp         | 110 ++++++++++++
 .../tenant-activity/get-data-ajaxprocessor.jsp  |  66 +++++++
 .../images/instance-usage-report.gif            | Bin 0 -> 849 bytes
 .../web/tenant-activity/images/search.gif       | Bin 0 -> 191 bytes
 .../images/tenant-usage-report.gif              | Bin 0 -> 1008 bytes
 .../images/user-usage-report.gif                | Bin 0 -> 1033 bytes
 .../web/tenant-activity/show-active-tenants.jsp | 129 ++++++++++++++
 .../web/tenant-activity/tenant-activity.jsp     | 174 +++++++++++++++++++
 .../org.apache.stratos.tenant.activity/pom.xml  | 145 ++++++++++++++++
 .../activity/beans/PaginatedTenantDataBean.java |  52 ++++++
 .../tenant/activity/beans/TenantDataBean.java   |  97 +++++++++++
 .../GetActiveTenantsInMemberRequest.java        |  59 +++++++
 .../GetActiveTenantsInMemberResponse.java       |  54 ++++++
 .../TenantActivityServiceComponent.java         |  96 ++++++++++
 .../services/TenantActivityService.java         |  83 +++++++++
 .../activity/util/TenantActivityUtil.java       |  79 +++++++++
 .../stratos/tenant/activity/util/Util.java      |  82 +++++++++
 .../src/main/resources/META-INF/component.xml   |  37 ++++
 .../src/main/resources/META-INF/services.xml    |  42 +++++
 components/tenant-activity/pom.xml              |  42 +++++
 62 files changed, 2203 insertions(+), 1845 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/pom.xml
----------------------------------------------------------------------
diff --git a/components/pom.xml b/components/pom.xml
index b92dd5d..c3cf70f 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -64,6 +64,8 @@
 		<module>org.apache.stratos.common/2.1.2</module>
 		<module>org.apache.stratos.tenant.dispatcher/2.1.0</module>
 		<module>org.apache.stratos.keystore.mgt/2.1.0</module>
+		<module>org.apache.stratos.email.sender</module>
+                <module>tenant-activity</module>
 	    </modules>
 	    
 	    <build>
@@ -249,6 +251,8 @@
         <google.guice.wso2.version>3.0.wso2v1</google.guice.wso2.version>
 	<commons-httpclient.version>3.0.1</commons-httpclient.version>
 	<json.wso2.version>2.0.0.wso2v1</json.wso2.version>
+	<orbit.version.axis2>1.6.1.wso2v5</orbit.version.axis2>
+	<orbit.version.axiom>1.2.11.wso2v3</orbit.version.axiom>
         <!--eclipse.osgi.version>3.5.0.v20090520</eclipse.osgi.version>
         <eclipse.osgi.services.version>3.2.0.v20090520-1800</eclipse.osgi.services.version>
         <equinox.commons.logging.version>1.0.4.v200706111724</equinox.commons.logging.version>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/clients/TenantActivityServiceClient.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/clients/TenantActivityServiceClient.java b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/clients/TenantActivityServiceClient.java
deleted file mode 100644
index 994b5bc..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/clients/TenantActivityServiceClient.java
+++ /dev/null
@@ -1,155 +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.activity.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.authenticator.proxy.AuthenticationAdminClient;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.tenant.activity.stub.TenantActivityServiceExceptionException;
-import org.wso2.carbon.tenant.activity.stub.beans.xsd.*;
-import org.wso2.carbon.tenant.activity.ui.internal.TenantActivityUIServiceComponent;
-import org.wso2.carbon.ui.CarbonUIUtil;
-import org.wso2.carbon.user.core.UserStoreException;
-import org.wso2.carbon.utils.ServerConstants;
-import org.wso2.carbon.tenant.activity.stub.TenantActivityServiceStub;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.http.HttpSession;
-import java.rmi.RemoteException;
-
-public class TenantActivityServiceClient {
-    private static final Log log = LogFactory.getLog(TenantActivityServiceClient.class);
-
-    private TenantActivityServiceStub stub;
-    private String epr;
-
-
-    public TenantActivityServiceClient(
-            String cookie, String backendServerURL, ConfigurationContext configContext)
-            throws RegistryException {
-
-        epr = backendServerURL + "TenantMonitorService";
-
-        try {
-            stub = new TenantActivityServiceStub(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 TenantMonitorService service client. " + axisFault.getMessage();
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-    public TenantActivityServiceClient(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 + "TenantActivityService";
-
-        try {
-            stub = new TenantActivityServiceStub(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 TenantMonitorService service client. " + axisFault.getMessage();
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-    public TenantActivityServiceClient(String url, ServletConfig config, HttpSession session)
-            throws Exception {
-        //String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-        ConfigurationContext configContext = (ConfigurationContext) config.
-                getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
-        try {
-            String cookie = login(url + "/services/", 
-                    TenantActivityUIServiceComponent.stratosConfiguration.getAdminUserName(),
-                    TenantActivityUIServiceComponent.stratosConfiguration.getAdminPassword(), 
-                    configContext);
-            epr = url + "/services/TenantActivityService";
-            stub = new TenantActivityServiceStub(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 TenantMonitorService service client. ";
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-
-    public int getActiveTenantCount() throws TenantActivityServiceExceptionException, RemoteException {
-        int count = stub.getActiveTenantCount();
-        return count;
-    }
-
-    /*public String[] getActiveTenantList() throws TenantActivityServiceExceptionException, RemoteException {
-        return stub.getActiveTenantList();
-    } */
-
-    public PaginatedTenantDataBean getPaginatedActiveTenantList(int pageNumber) throws TenantActivityServiceExceptionException, RemoteException {
-        return stub.retrievePaginatedActiveTenants(pageNumber);
-    }
-
-    /*  public TenantDataBean[] getAllActiveTenantList() throws TenantActivityServiceExceptionException, RemoteException {
-        return stub.getAllActiveTenantList();
-    }*/
-
-    public boolean isTenantActiveInService(String domainName) throws TenantActivityServiceExceptionException, RemoteException {
-        return stub.isActiveTenantOnService(domainName);
-    }
-    
-    private String login(String serverUrl, String userName, 
-                               String password, ConfigurationContext confContext) throws UserStoreException {
-        String sessionCookie = null;
-        try {
-            AuthenticationAdminClient client =
-                    new AuthenticationAdminClient(confContext, serverUrl, null, null, false);
-            //TODO : get the correct IP
-            boolean isLogin = client.login(userName, password, "127.0.0.1");
-            if (isLogin) {
-                sessionCookie = client.getAdminCookie();
-            }
-        } catch (Exception e) {
-            throw new UserStoreException("Error in login to the server server: " + serverUrl +
-                                         "username: " + userName + ".", e);
-        }
-        return sessionCookie;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/internal/TenantActivityUIServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/internal/TenantActivityUIServiceComponent.java b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/internal/TenantActivityUIServiceComponent.java
deleted file mode 100644
index 0b3f2fd..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/internal/TenantActivityUIServiceComponent.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.wso2.carbon.tenant.activity.ui.internal;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.osgi.service.component.ComponentContext;
-import org.wso2.carbon.stratos.common.util.StratosConfiguration;
-import org.wso2.carbon.utils.ConfigurationContextService;
-
-/**
- * @scr.component name="org.wso2.carbon.tenant.activity.ui" immediate="true"
- * @scr.reference name="config.context.service"
- * interface="org.wso2.carbon.utils.ConfigurationContextService"
- * cardinality="1..1" policy="dynamic"  bind="setConfigurationContextService"
- * unbind="unsetConfigurationContextService"
- * @scr.reference name="stratos.config.service"
- * interface="org.wso2.carbon.stratos.common.util.StratosConfiguration" cardinality="1..1"
- * policy="dynamic" bind="setStratosConfigurationService" unbind="unsetStratosConfigurationService"
- */
-public class TenantActivityUIServiceComponent {
-    private static Log log = LogFactory.getLog(TenantActivityUIServiceComponent.class);
-    public static ConfigurationContextService contextService;
-    public static StratosConfiguration stratosConfiguration;
-
-    protected void activate(ComponentContext context) {
-        try {
-            if (log.isDebugEnabled()) {
-                log.error("******* Tenant Activity UI bundle is activated ******* ");
-            }
-        } catch (Throwable e) {
-            log.error("******* Error in activating Tenant Activity UI bundle ******* ", e);
-        }
-    }
-
-    protected void deactivate(ComponentContext context) {
-        if (log.isDebugEnabled()) {
-            log.debug("******* Tenant Activity UI bundle is deactivated ******* ");
-        }
-    }
-
-    protected void setStratosConfigurationService(StratosConfiguration stratosConfigService) {
-        TenantActivityUIServiceComponent.stratosConfiguration = stratosConfigService;
-    }
-
-    protected void unsetStratosConfigurationService(StratosConfiguration ccService) {
-        TenantActivityUIServiceComponent.stratosConfiguration = null;
-    }
-
-    protected void setConfigurationContextService(ConfigurationContextService contextService) {
-        TenantActivityUIServiceComponent.contextService = contextService;
-    }
-
-    protected void unsetConfigurationContextService(ConfigurationContextService contextService) {
-        TenantActivityUIServiceComponent.contextService = null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/utils/ManagerConfigurations.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/utils/ManagerConfigurations.java b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/utils/ManagerConfigurations.java
deleted file mode 100644
index 94da109..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/utils/ManagerConfigurations.java
+++ /dev/null
@@ -1,148 +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.activity.ui.utils;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.stratos.common.util.CommonUtil;
-import org.wso2.carbon.registry.core.RegistryConstants;
-import org.wso2.carbon.utils.CarbonUtils;
-
-import javax.xml.namespace.QName;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-
-public class ManagerConfigurations {
-
-    private static final String CONFIG_FILE = "throttling-agent-config.xml";
-
-    private static final String MANAGER_SERVICE_URL_PARAM_NAME = "managerServiceUrl";
-    private static final String USERNAME_PARAM_NAME = "userName";
-    private static final String PASSWORD_PARAM_NAME = "password";
-
-
-    private String managerServerUrl;
-    private String userName;
-    private String password;
-
-    private final static Log log = LogFactory.getLog(ManagerConfigurations.class);
-
-    private static final String CONFIG_NS =
-            "http://wso2.com/carbon/multitenancy/throttling/agent/config";
-    private static final String PARAMTERS_ELEMENT_NAME = "parameters";
-    private static final String PARAMTER_ELEMENT_NAME = "parameter";
-    private static final String PARAMTER_NAME_ATTR_NAME = "name";
-    private Map<String, String> parameters = new HashMap<String, String>();
-
-
-
-
-    public String getConfigFileName() throws Exception {
-
-        String configFileName = CarbonUtils.getCarbonConfigDirPath() +
-                File.separator + StratosConstants.MULTITENANCY_CONFIG_FOLDER +
-                File.separator + CONFIG_FILE;
-
-        return configFileName;
-
-    }
-
-
-    public ManagerConfigurations() throws Exception {
-
-        String throttlingAgentConfigFile = this.getConfigFileName();
-        try {
-            OMElement meteringConfig =
-                    CommonUtil.buildOMElement(new FileInputStream(throttlingAgentConfigFile));
-            deSerialize(meteringConfig);
-            Map<String, String> throttlingAgentParams = getParameters();
-            this.setUserName(throttlingAgentParams.get(USERNAME_PARAM_NAME));
-            this.setPassword(throttlingAgentParams.get(PASSWORD_PARAM_NAME));
-            this.setManagerServerUrl(throttlingAgentParams.get(MANAGER_SERVICE_URL_PARAM_NAME));
-        } catch (FileNotFoundException e) {
-            String msg = "Unable to find the file: " + throttlingAgentConfigFile + ".";
-            log.error(msg, e);
-        }
-    }
-
-    public void deSerialize(OMElement throttlingConfigEle) throws Exception {
-        Iterator meteringConfigChildIt = throttlingConfigEle.getChildElements();
-        while (meteringConfigChildIt.hasNext()) {
-            Object meteringConfigChild = meteringConfigChildIt.next();
-            if (!(meteringConfigChild instanceof OMElement)) {
-                continue;
-            }
-            OMElement meteringConfigChildEle = (OMElement) meteringConfigChild;
-            if (new QName(CONFIG_NS, PARAMTERS_ELEMENT_NAME, "").equals(meteringConfigChildEle
-                    .getQName())) {
-                Iterator parametersChildIt = meteringConfigChildEle.getChildElements();
-                while (parametersChildIt.hasNext()) {
-                    Object taskConfigChild = parametersChildIt.next();
-                    if (!(taskConfigChild instanceof OMElement)) {
-                        continue;
-                    }
-                    OMElement parameterChildEle = (OMElement) taskConfigChild;
-                    if (!new QName(CONFIG_NS, PARAMTER_ELEMENT_NAME, "").equals(parameterChildEle
-                            .getQName())) {
-                        continue;
-                    }
-                    String parameterName =
-                            parameterChildEle.getAttributeValue(new QName(PARAMTER_NAME_ATTR_NAME));
-                    String parameterValue = parameterChildEle.getText();
-                    parameters.put(parameterName, parameterValue);
-                }
-            }
-        }
-    }
-
-    public Map<String, String> getParameters() {
-        return parameters;
-    }
-
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public String getManagerServerUrl() {
-        return managerServerUrl;
-    }
-
-    public void setManagerServerUrl(String managerServerUrl) {
-        this.managerServerUrl = managerServerUrl;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/utils/TenantMonitorUtil.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/utils/TenantMonitorUtil.java b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/utils/TenantMonitorUtil.java
deleted file mode 100644
index ef566fd..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/ui/utils/TenantMonitorUtil.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- *  Copyright (c) 2005-2008, 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.activity.ui.utils;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.stratos.common.config.CloudServiceConfig;
-import org.wso2.carbon.stratos.common.config.CloudServiceConfigParser;
-import org.wso2.carbon.stratos.common.config.CloudServicesDescConfig;
-
-import java.util.*;
-
-import org.wso2.carbon.tenant.activity.stub.beans.xsd.PaginatedTenantDataBean;
-import org.wso2.carbon.tenant.activity.stub.beans.xsd.TenantDataBean;
-
-public class TenantMonitorUtil {
-    private static final Log log = LogFactory.getLog(TenantMonitorUtil.class);
-
-    public static Map<String, String[]> tenantList = new HashMap<String, String[]>();
-    public static Map<String, TenantDataBean[]> tenantDataList = new HashMap<String, TenantDataBean[]>();
-
-
-    private static ManagerConfigurations managerConfig = null;
-
-
-    public static ManagerConfigurations getManagerConfig() {
-        return managerConfig;
-    }
-
-    public static void setManagerConfig(ManagerConfigurations managerConfig) {
-        TenantMonitorUtil.managerConfig = managerConfig;
-    }
-
-  /*  public static Map<String, Integer> getActiveTenantCount(ServletConfig config, HttpSession session) throws Exception {
-        Map<String, Integer> map = new HashMap<String, Integer>();
-        try {
-            CloudServicesDescConfig cloudServicesDescConfig = CloudServiceConfigParser.loadCloudServicesConfiguration();
-
-            Map<String, CloudServiceConfig> cloudServicesConfigs = cloudServicesDescConfig.getCloudServiceConfigs();
-            for (String serviceName : cloudServicesConfigs.keySet()) {
-                String backEndURL = cloudServicesConfigs.get(serviceName).getLink();
-                System.out.println(backEndURL);
-                if (backEndURL == null) {
-                    try {
-                        TenantActivityServiceClient client = new TenantActivityServiceClient(config, session);
-                        map.put(serviceName, client.getActiveTenantCount());
-                        for (String nn : client.getActiveTenantList()) {
-                            System.out.println(nn);
-                        }
-                    } catch (Exception e) {
-                        log.error("Failed to get active tenants for manager service");
-                    }
-
-                } else {
-                    try {
-                        TenantActivityServiceClient client = new TenantActivityServiceClient(backEndURL, config, session);
-                        map.put(serviceName, client.getActiveTenantCount());
-                    } catch (Exception e) {
-                        log.error("failed to get Active tenants for" + serviceName + e.toString());
-                    }
-                }
-
-            }
-        } catch (Exception e) {
-            log.error("Error while retrieving cloud desc configuration");
-
-        }
-        return map;
-    }*/
-
-    public static Map<String, CloudServiceConfig> getCloudServiceConfigMap() {
-        try {
-            CloudServicesDescConfig cloudServicesDescConfig = CloudServiceConfigParser.loadCloudServicesConfiguration();
-            return cloudServicesDescConfig.getCloudServiceConfigs();
-        } catch (Exception e) {
-            log.error("Error while getting service names " + e.toString());
-        }
-        return null;
-    }
-
-    public static PaginatedTenantDataBean getPaginatedTenantData(int pageNumber, String serviceName) {
-        int entriesPerPage = 15;
-        List<TenantDataBean> tenantListOnService = Arrays.asList(tenantDataList.get(serviceName));
-        List<TenantDataBean> tenantUsages = new ArrayList<TenantDataBean>();
-        int i = 0;
-        int numberOfPages = 0;
-        for (TenantDataBean tenant : tenantListOnService) {
-            if (i % entriesPerPage == 0) {
-                numberOfPages++;
-            }
-            if (numberOfPages == pageNumber) {
-                tenantUsages.add(tenant);
-            }
-            i++;
-
-        }
-        PaginatedTenantDataBean paginatedTenantInfo = new PaginatedTenantDataBean();
-        paginatedTenantInfo.setTenantInfoBeans(
-                tenantUsages.toArray(new TenantDataBean[tenantUsages.size()]));
-        paginatedTenantInfo.setNumberOfPages(numberOfPages);
-        return paginatedTenantInfo;
-    }
-
-    public static boolean isTenantActiveOnService(String serviceName, String domain) {
-        boolean status = false;
-        for (TenantDataBean tenantBean : tenantDataList.get(serviceName)) {
-            if (tenantBean.getDomain().equalsIgnoreCase(domain)) {
-                status = true;
-            }
-        }
-        return status;
-    }
-
-    public static Map<String, String> getAdminParameters() {
-        Map<String, String> adminParameters = new HashMap<String, String>();
-        if (managerConfig == null) {
-            try {
-                managerConfig = new ManagerConfigurations();
-            } catch (Exception e) {
-                log.error("Failed to get administrator credentials" + e.toString());
-            }
-        }
-        adminParameters.put("userName", managerConfig.getUserName());
-        adminParameters.put("password", managerConfig.getPassword());
-        return adminParameters;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/META-INF/component.xml b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/META-INF/component.xml
deleted file mode 100644
index a163b36..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/META-INF/component.xml
+++ /dev/null
@@ -1,35 +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>all_tenant_monitor_menu</id>
-            <i18n-key>Tenant Activity Monitor</i18n-key>
-            <i18n-bundle>org.wso2.carbon.tenant.activity.ui.i18n.Resources</i18n-bundle>
-            <parent-menu>monitor_menu</parent-menu>
-            <link>../tenant-activity/tenant-activity.jsp</link>
-            <region>region4</region>
-            <order>50</order>
-            <style-class>manage</style-class>
-            <icon>../tenant-activity/images/tenant-usage-report.gif</icon>
-            <require-permission>/permission/protected/monitor/userUsage</require-permission>
-            <require-super-tenant>true</require-super-tenant>
-        </menu>
-    </menus>
-</component>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/org/wso2/carbon/tenant/activity/ui/i18n/JSResources.properties
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/org/wso2/carbon/tenant/activity/ui/i18n/JSResources.properties b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/org/wso2/carbon/tenant/activity/ui/i18n/JSResources.properties
deleted file mode 100644
index f038b96..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/org/wso2/carbon/tenant/activity/ui/i18n/JSResources.properties
+++ /dev/null
@@ -1 +0,0 @@
-session.timed.out=Session timed out. Please login again
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/org/wso2/carbon/tenant/activity/ui/i18n/Resources.properties
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/org/wso2/carbon/tenant/activity/ui/i18n/Resources.properties b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/org/wso2/carbon/tenant/activity/ui/i18n/Resources.properties
deleted file mode 100644
index 85081f9..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/org/wso2/carbon/tenant/activity/ui/i18n/Resources.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-service.name=Service Name
-active.user.count=Active User Count
-active.tenants.services= Active Tenants on Services
-view.list=View List
-active.tenant.count=Active Tenant Count
-active.tenants.on= Active Tenants on
-tenant.domain= Tenant Domain
-active.status=State
-enter.tenant.domain=Enter Tenant Domain
-tenant.status=Tenant State
-tenant.state.on.services.for.tenant= Tenant State on Services For Tenant Domain

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/css/tenant-usage.css
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/css/tenant-usage.css b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/css/tenant-usage.css
deleted file mode 100644
index 5c85728..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/css/tenant-usage.css
+++ /dev/null
@@ -1,28 +0,0 @@
-.disableLink {
-    color: #aaaaaa;
-}
-
-.pageLinks {
-    background: #FFFFFF none repeat scroll 0%;
-    border: 1px solid #DDDDDD;
-    padding: 2px 3px;
-    text-decoration: none;
-    margin: 0px;
-    margin-left: 2px;
-    margin-right: 2px;
-}
-
-.pageLinks-selected {
-    background: #e8e9ae none repeat scroll 0%;
-    border: 1px solid #DDDDDD;
-    padding: 2px 3px;
-    text-decoration: none;
-    margin: 0px;
-    margin-left: 2px;
-    margin-right: 2px;
-}
-
-a {
-    color: #386698;
-    cursor: pointer;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/docs/images/view-usage.png
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/docs/images/view-usage.png b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/docs/images/view-usage.png
deleted file mode 100644
index 3d036c0..0000000
Binary files a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/docs/images/view-usage.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/find-tenant-ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/find-tenant-ajaxprocessor.jsp b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/find-tenant-ajaxprocessor.jsp
deleted file mode 100644
index 0c9a988..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/find-tenant-ajaxprocessor.jsp
+++ /dev/null
@@ -1,59 +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.
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ page import="org.json.JSONObject" %>
-<%@ page import="org.wso2.carbon.billing.mgt.stub.beans.xsd.Invoice" %>
-<%@ page import="org.wso2.carbon.billing.mgt.stub.beans.xsd.Payment" %>
-<%@ page import="org.wso2.carbon.billing.mgt.ui.utils.BillingUtil" %>
-<%@ page import="java.util.Date" %>
-<%@ page import="org.wso2.carbon.tenant.activity.ui.clients.TenantActivityServiceClient" %>
-<%@ page import="java.io.Console" %>
-<%@ page import="javax.rmi.CORBA.Util" %>
-<%@ page import="org.wso2.carbon.tenant.activity.ui.utils.TenantMonitorUtil" %>
-<%@ page import="org.wso2.carbon.tenant.activity.stub.beans.xsd.PaginatedTenantDataBean" %>
-
-<%
-    String serverUrl = request.getParameter("backEndUrl");
-    String serviceName = request.getParameter("serviceName");
-    String domainName = request.getParameter("domainName");
-
-    boolean state = false;
-    if (serverUrl == null || "null".equals(serverUrl.trim())) {
-        try {
-            TenantActivityServiceClient client = new TenantActivityServiceClient(config, session);
-            state = client.isTenantActiveInService(domainName);
-        } catch (Exception e) {
-        }
-
-    } else {
-        try {
-            TenantActivityServiceClient client = new TenantActivityServiceClient(serverUrl, config, session);
-            state = client.isTenantActiveInService(domainName);
-        } catch (Exception e) {
-        }
-    }
-
-    try {
-        JSONObject obj = new JSONObject();
-        obj.put("isActive", state);
-        obj.put("service", serviceName);
-        out.write(obj.toString());
-    } catch (Exception e) {
-        e.printStackTrace();
-    }
-%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/find-tenant.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/find-tenant.jsp b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/find-tenant.jsp
deleted file mode 100644
index 919c62c..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/find-tenant.jsp
+++ /dev/null
@@ -1,110 +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.
--->
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<%@ taglib prefix="carbon" uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" %>
-<%@ page import="org.wso2.carbon.tenant.activity.ui.utils.TenantMonitorUtil" %>
-<%@ page import="org.wso2.carbon.stratos.common.config.CloudServiceConfig" %>
-<%@ page import="java.util.Map" %>
-<jsp:include page="../registry_common/registry_common-i18n-ajaxprocessor.jsp"/>
-<script type="text/javascript" src="../registry_common/js/registry_validation.js"></script>
-<script type="text/javascript" src="../registry_common/js/registry_common.js"></script>
-<script type="text/javascript" src="../ajax/js/prototype.js"></script>
-<script type="text/javascript" src="js/tenant_config.js"></script>
-
-<carbon:jsi18n
-        resourceBundle="org.wso2.carbon.tenant.activity.ui.i18n.JSResources"
-        request="<%=request%>"/>
-
-<fmt:bundle basename="org.wso2.carbon.tenant.activity.ui.i18n.Resources">
-    <carbon:breadcrumb
-            label="govern.view_tenants.menu"
-            resourceBundle="org.wso2.carbon.tenant.activity.ui.i18n.Resources"
-            topPage="true"
-            request="<%=request%>"/>
-    <%
-        String domainNameStr = request.getParameter("domain");
-    %>
-    <div id="middle">
-        <h2><fmt:message key="tenant.state.on.services.for.tenant"/> "<%=domainNameStr%>"</h2>
-
-        <div id="workArea">
-            <table id="activeStateTable" cellpadding="0" cellspacing="0" border="0" style="width:100%"
-                   class="styledLeft">
-                <thead>
-                <tr>
-                    <th style="padding-left:5px;text-align:left;width:40%"><fmt:message key="service.name"/></th>
-                    <th style="padding-left:5px;text-align:left;"><fmt:message key="tenant.status"/></th>
-                </tr>
-                </thead>
-            </table>
-        </div>
-    </div>
-</fmt:bundle>
-<%
-    String domainName = request.getParameter("domain");
-    Map<String, CloudServiceConfig> cloudServicesConfigs = TenantMonitorUtil.getCloudServiceConfigMap();
-%>
-
-<script type="text/javascript">
-
-    function getStats() {
-        var serviceArray = new Array();
-    <%
-    for(String serviceName : cloudServicesConfigs.keySet()){
-    %>
-        var serviceObj = new Object();
-        serviceObj.backEndUrl = '<%=cloudServicesConfigs.get(serviceName).getLink()%>';
-        serviceObj.serviceName = '<%=serviceName%>';
-        serviceObj.domainName = '<%=domainName%>';
-        serviceArray.push(serviceObj);
-    <% }
-    %>
-
-        for (var i = 0; i < serviceArray.length; i++) {
-
-            jQuery.ajax({
-                type: 'GET',
-                url: 'find-tenant-ajaxprocessor.jsp',
-                data: 'backEndUrl=' + serviceArray[i].backEndUrl + '&serviceName=' + serviceArray[i].serviceName + '&domainName=' + serviceArray[i].domainName,
-                dataType: 'json',
-                async: true,
-                success: function(msg) {
-                    var resp = msg;
-                    var active = 'Active';
-                    var inActive = 'Inactive';
-                    if (resp.isActive === true) {
-                        document.getElementById('activeStateTable').innerHTML += '<tr><td>' + resp.service + '</td><td>' + active + '</td></tr>';
-                    }
-                    else {
-                        document.getElementById('activeStateTable').innerHTML += '<tr><td>' + resp.service + '</td><td>' + inActive + '</td></tr>';
-                    }
-                },
-                error:function () {
-                    CARBON.showErrorDialog('Could not connect to server');
-                    //document.getElementById('serviceStatTable').innerHTML += '<tr><td>' + eresp.servic + '</td><td>' + resp.count + '</td></tr>';
-                    document.getElementById('activeStateTable').innerHTML += 'Not Available';
-                }
-            });
-        }
-    }
-</script>
-
-<body onload="getStats();">
-<div>
-</div>
-</body>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/get-data-ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/get-data-ajaxprocessor.jsp b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/get-data-ajaxprocessor.jsp
deleted file mode 100644
index 15f558b..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/get-data-ajaxprocessor.jsp
+++ /dev/null
@@ -1,66 +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.
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ page import="org.json.JSONObject" %>
-<%@ page import="org.wso2.carbon.billing.mgt.stub.beans.xsd.Invoice" %>
-<%@ page import="org.wso2.carbon.billing.mgt.stub.beans.xsd.Payment" %>
-<%@ page import="org.wso2.carbon.billing.mgt.ui.utils.BillingUtil" %>
-<%@ page import="java.util.Date" %>
-<%@ page import="org.wso2.carbon.tenant.activity.ui.clients.TenantActivityServiceClient" %>
-<%@ page import="java.io.Console" %>
-<%@ page import="javax.rmi.CORBA.Util" %>
-<%@ page import="org.wso2.carbon.tenant.activity.ui.utils.TenantMonitorUtil" %>
-<%@ page import="org.wso2.carbon.tenant.activity.stub.beans.xsd.PaginatedTenantDataBean" %>
-
-<%
-    String serverUrl = request.getParameter("backEndUrl");
-    String serviceName = request.getParameter("serviceName");
-
-
-    int count = 0;
-    if (serverUrl == null || "null".equals(serverUrl.trim())) {
-        try {
-            TenantActivityServiceClient client = new TenantActivityServiceClient(config, session);
-           // TenantMonitorUtil.tenantDataList.put(serviceName, client.getAllActiveTenantList());
-           count=client.getActiveTenantCount();
-        } catch (Exception e) {
-        }
-
-    } else {
-        try {
-            TenantActivityServiceClient client = new TenantActivityServiceClient(serverUrl, config, session);
-           // count = client.getAllActiveTenantList().length;
-           count=client.getActiveTenantCount();
-            if (count > 0) {
-               // TenantMonitorUtil.tenantDataList.put(serviceName, client.getAllActiveTenantList());
-            } else {
-                TenantMonitorUtil.tenantDataList.put(serviceName, null);
-            }
-        } catch (Exception e) {
-        }
-    }
-
-    try {
-        JSONObject obj = new JSONObject();
-        obj.put("count", count);
-        obj.put("service", serviceName);
-        out.write(obj.toString());
-    } catch (Exception e) {
-        e.printStackTrace();
-    }
-%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/instance-usage-report.gif
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/instance-usage-report.gif b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/instance-usage-report.gif
deleted file mode 100644
index 4a1ae6a..0000000
Binary files a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/instance-usage-report.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/search.gif
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/search.gif b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/search.gif
deleted file mode 100644
index cfe76b5..0000000
Binary files a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/search.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/tenant-usage-report.gif
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/tenant-usage-report.gif b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/tenant-usage-report.gif
deleted file mode 100644
index a9b04e2..0000000
Binary files a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/tenant-usage-report.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/user-usage-report.gif
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/user-usage-report.gif b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/user-usage-report.gif
deleted file mode 100644
index 9070c35..0000000
Binary files a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/images/user-usage-report.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/show-active-tenants.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/show-active-tenants.jsp b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/show-active-tenants.jsp
deleted file mode 100644
index 4590272..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/show-active-tenants.jsp
+++ /dev/null
@@ -1,129 +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.
--->
-<%@ page import="java.util.List" %>
-<%@ page import="org.wso2.carbon.tenant.activity.ui.clients.TenantActivityServiceClient" %>
-<%@ page import="org.wso2.carbon.tenant.activity.ui.utils.TenantMonitorUtil" %>
-<%@ page import="java.util.Map" %>
-<%@ page import="org.wso2.carbon.tenant.reg.agent.client.util.Util" %>
-<%@ page import="org.wso2.carbon.stratos.common.config.CloudServiceConfig" %>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
-<%@ page import="org.apache.axis2.context.ConfigurationContext" %>
-<%@ page import="org.wso2.carbon.CarbonConstants" %>
-<%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
-<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>
-<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
-<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
-<%@ page import="java.text.SimpleDateFormat" %>
-<%@ page import="java.util.Calendar" %>
-<%@ page import="java.util.Date" %>
-<%@ page import="org.wso2.carbon.tenant.activity.stub.TenantActivityServiceStub" %>
-<%@ page import="org.wso2.carbon.tenant.activity.stub.beans.xsd.TenantDataBean" %>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
-<jsp:include page="../registry_common/registry_common-i18n-ajaxprocessor.jsp"/>
-<script type="text/javascript" src="../registry_common/js/registry_validation.js"></script>
-<script type="text/javascript" src="../registry_common/js/registry_common.js"></script>
-<script type="text/javascript" src="../ajax/js/prototype.js"></script>
-<script type="text/javascript" src="js/tenant_config.js"></script>
-
-<carbon:jsi18n
-        resourceBundle="org.wso2.carbon.tenant.activity.ui.i18n.JSResources"
-        request="<%=request%>"/>
-
-<fmt:bundle basename="org.wso2.carbon.tenant.activity.ui.i18n.Resources">
-    <carbon:breadcrumb
-            label="govern.view_tenants.menu"
-            resourceBundle="org.wso2.carbon.tenant.activity.ui.i18n.Resources"
-            topPage="true"
-            request="<%=request%>"/>
-    <%
-        String serviceNameStr = request.getParameter("serviceName");
-    %>
-
-    <div id="middle">
-        <h2><fmt:message key="active.tenants.on"/> <%=serviceNameStr%>
-        </h2>
-
-        <div id="workArea">
-            <table id="serviceStatTable1" cellpadding="0" cellspacing="0" border="0" style="width:100%"
-                   class="styledLeft">
-                <thead>
-                <tr>
-                    <th style="padding-left:5px;text-align:left;width:30%"><fmt:message key="tenant.domain"/></th>
-                    <th style="padding-left:5px;text-align:left;"><fmt:message
-                            key="active.status"/></th>
-                </tr>
-                </thead>
-                <tbody>
-                <%
-                    String pageNumberStr = request.getParameter("pageNumber");
-                    if (pageNumberStr == null) {
-                        pageNumberStr = "0";
-
-                    }
-                    int pageNumber = 1;
-                    try {
-                        pageNumber = Integer.parseInt(pageNumberStr);
-                    } catch (NumberFormatException ignored) {
-                        // page number format exception
-                    }
-                    int numberOfPages = 1;
-                    try {
-                        String backEndUrl = TenantMonitorUtil.getCloudServiceConfigMap().get(request.getParameter("serviceName")).getLink();
-                        TenantActivityServiceClient client;
-                        if (backEndUrl == null || "null".equals(backEndUrl.trim())) {
-                            client = new TenantActivityServiceClient(config, session);
-                        } else {
-                            client = new TenantActivityServiceClient(backEndUrl, config, session);
-                        }
-                        for (TenantDataBean bean : client.getPaginatedActiveTenantList(pageNumber).getTenantInfoBeans()) {
-                %>
-                <tr>
-                    <td><%=bean.getDomain()%>
-                    </td>
-                    <td>Active</td>
-                </tr>
-                <%
-                    }
-                } catch (Exception e) {
-                %>
-                <tr>
-                    <td>No Data Available for this Service</td>
-                </tr>
-                <% }
-                    String reDirectPage = "show-active-tenants.jsp?serviceName=" + serviceNameStr + "&";
-                %>
-                <carbon:paginator pageNumber="<%=pageNumber%>" numberOfPages="<%=numberOfPages%>"
-                                  page="<%=reDirectPage%>" pageNumberParameterName="pageNumber"/>
-                </tbody>
-            </table>
-            <input type='hidden' name='serviceName' id="serviceName"/>
-        </div>
-    </div>
-</fmt:bundle>
-
-<script type="text/javascript">
-
-    function getStats() {
-        console.log("In the getStat() function");
-
-    }
-    function showTenants(serviceNameKey) {
-    }
-</script>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/tenant-activity.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/tenant-activity.jsp b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/tenant-activity.jsp
deleted file mode 100644
index 457aa84..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity.ui/2.1.0/src/main/resources/web/tenant-activity/tenant-activity.jsp
+++ /dev/null
@@ -1,174 +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.
--->
-<%@ page import="java.util.List" %>
-<%@ page import="org.wso2.carbon.tenant.activity.ui.clients.TenantActivityServiceClient" %>
-<%@ page import="org.wso2.carbon.tenant.activity.ui.utils.TenantMonitorUtil" %>
-<%@ page import="java.util.Map" %>
-<%@ page import="org.wso2.carbon.stratos.common.config.CloudServiceConfig" %>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
-
-
-<%@ page import="org.apache.axis2.context.ConfigurationContext" %>
-<%@ page import="org.wso2.carbon.CarbonConstants" %>
-<%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
-<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>
-<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
-<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
-<%@ page import="java.text.SimpleDateFormat" %>
-<%@ page import="java.util.Calendar" %>
-<%@ page import="java.util.Date" %>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
-<jsp:include page="../registry_common/registry_common-i18n-ajaxprocessor.jsp"/>
-<script type="text/javascript" src="../registry_common/js/registry_validation.js"></script>
-<script type="text/javascript" src="../registry_common/js/registry_common.js"></script>
-<script type="text/javascript" src="../ajax/js/prototype.js"></script>
-<script type="text/javascript" src="js/tenant_config.js"></script>
-
-<carbon:jsi18n
-        resourceBundle="org.wso2.carbon.tenant.activity.ui.i18n.JSResources"
-        request="<%=request%>"/>
-
-<fmt:bundle basename="org.wso2.carbon.tenant.activity.ui.i18n.Resources">
-    <carbon:breadcrumb
-            label="govern.view_tenants.menu"
-            resourceBundle="org.wso2.carbon.tenant.activity.ui.i18n.Resources"
-            topPage="true"
-            request="<%=request%>"/>
-
-
-    <div id="middle">
-        <div id="top">
-            <h2><fmt:message key="active.tenants.services"/></h2>
-
-            <form id="findTenantForm" action="find-tenant.jsp" method="post">
-                <table class="normal-nopadding" cellspacing="0">
-                    <tbody>
-                    <tr style="border:0; !important">
-                        <td style="border:0; !important">
-                            <nobr>
-                                &nbsp;&nbsp;&nbsp;
-                                Enter Tenant Domain
-                                <input type="text" name="domain" id="domain" value="">&nbsp;
-                            </nobr>
-                        </td>
-                        <td style="border:0; !important">
-                            <a class="icon-link" href="#" style="background-image: url(images/search.gif);"
-                               onclick="domainSelected();" alt="Search"></a>
-                        </td>
-                    </tr>
-                    </tbody>
-                </table>
-            </form>
-        </div>
-
-        <div id="workArea">
-            <table id="serviceStatTable1" cellpadding="0" cellspacing="0" border="0" style="width:100%"
-                   class="styledLeft">
-                <thead>
-                <tr>
-                    <th style="padding-left:5px;text-align:left;width:40%"><fmt:message key="service.name"/></th>
-                    <th style="padding-left:5px;text-align:left;width:150px"><fmt:message
-                            key="active.tenant.count"/></th>
-                    <th style="padding-left:5px;text-align:left;"><fmt:message key="view.list"/></th>
-                </tr>
-                </thead>
-            </table>
-        </div>
-    </div>
-</fmt:bundle>
-
-<%
-    Map<String, CloudServiceConfig> cloudServicesConfigs = TenantMonitorUtil.getCloudServiceConfigMap();
-%>
-
-
-<script type="text/javascript">
-
-    function getStats() {
-        console.log("In the getStat() function");
-        var serviceArray = new Array();
-
-    <%
-    for(String serviceName : cloudServicesConfigs.keySet()){
-
-    %>
-
-        var serviceObj = new Object();
-        serviceObj.backEndUrl = '<%=cloudServicesConfigs.get(serviceName).getLink()%>';
-        serviceObj.serviceName = '<%=serviceName%>';
-        serviceArray.push(serviceObj);
-
-    <% }
-    %>
-
-        for (var i = 0; i < serviceArray.length; i++) {
-
-            jQuery.ajax({
-                type: 'GET',
-                url: 'get-data-ajaxprocessor.jsp',
-                data: 'backEndUrl=' + serviceArray[i].backEndUrl + '&serviceName=' + serviceArray[i].serviceName,
-                dataType: 'json',
-                async: true,
-                success: function(msg) {
-                    var resp = msg;
-                    var view = 'View';
-                    if (resp.count > 0) {
-                        document.getElementById('serviceStatTable1').innerHTML += '<tr><td><a href="javascript:showTenants(\'' + resp.service + '\');">' + resp.service + '</a></td><td>' + resp.count + '</td><td><a href="javascript:showTenants(\'' + resp.service + '\');">' + view + '</a></td></tr>';
-                    }
-                    else {
-                        document.getElementById('serviceStatTable1').innerHTML += '<tr><td>' + resp.service + '</td><td>' + resp.count + '</td><td>-</td></tr>';
-                    }
-                },
-                error:function () {
-                    CARBON.showErrorDialog('Could not connect to server');
-                    //document.getElementById('serviceStatTable').innerHTML += '<tr><td>' + eresp.servic + '</td><td>' + resp.count + '</td></tr>';
-                    document.getElementById('serviceStatTable').innerHTML += 'Not Available';
-                }
-            });
-
-        }
-    }
-    function showTenants(serviceNameKey) {
-        document.getElementById("serviceName").value = serviceNameKey;
-        document.myform.submit();
-    }
-
-    function domainSelected() {
-        var findDomainForm = document.getElementById('findTenantForm');
-        var domain = document.getElementById("domain").getValue();
-        if(domain.length > 3){
-            findDomainForm.submit();
-        }
-        else{
-          CARBON.showErrorDialog('Enter valid domain name');
-        }
-
-    }
-
-</script>
-
-<body onload="getStats();">
-<div>
-    <table id="serviceStatTable"></table>
-    <form name="myform" method="post" action="show-active-tenants.jsp">
-        <input type='hidden' name='serviceName' id="serviceName"/>
-    </form>
-</div>
-</body>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/beans/PaginatedTenantDataBean.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/beans/PaginatedTenantDataBean.java b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/beans/PaginatedTenantDataBean.java
deleted file mode 100644
index cfff936..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/beans/PaginatedTenantDataBean.java
+++ /dev/null
@@ -1,52 +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.activity.beans;
-
-import org.wso2.carbon.utils.Pageable;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * Bean for paginated tenant information
- */
-public class PaginatedTenantDataBean implements Pageable, Serializable {
-    private TenantDataBean[] tenantInfoBeans;
-    private int numberOfPages;
-
-    public TenantDataBean[] getTenantInfoBeans() {
-        return tenantInfoBeans;
-    }
-
-    public void setTenantInfoBeans(TenantDataBean[] tenantInfoBeans) {
-        this.tenantInfoBeans = tenantInfoBeans;
-    }
-
-    public int getNumberOfPages() {
-        return numberOfPages;
-    }
-
-    public void setNumberOfPages(int numberOfPages) {
-        this.numberOfPages = numberOfPages;
-    }
-
-    public <T> void set(List<T> items) {
-        this.tenantInfoBeans = items.toArray(new TenantDataBean[items.size()]);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/beans/TenantDataBean.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/beans/TenantDataBean.java b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/beans/TenantDataBean.java
deleted file mode 100644
index abdd228..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/beans/TenantDataBean.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.wso2.carbon.tenant.activity.beans;
-/*
- *  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.
- *
- */
-
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * Represents a Tenant
- */
-@SuppressWarnings("unused")
-public class TenantDataBean implements Serializable {
-
-    /**
-     * The tenant Id
-     */
-    private int id;
-
-    /**
-     * The domain name of the tenant
-     */
-    private String domain;
-
-    /**
-     * The admin user name of the tenant
-     */
-    private String adminName;
-
-    /**
-     * The email address of the tenant
-     */
-    private String email;
-
-    /**
-     * Indicates whether this tenant is active or not
-     */
-    private boolean active;
-
-
-    public String getEmail() {
-        return email;
-    }
-
-    public void setEmail(String email) {
-        this.email = email;
-    }
-
-    public int getId() {
-        return id;
-    }
-
-    public void setId(int id) {
-        this.id = id;
-    }
-
-    public String getAdminName() {
-        return adminName;
-    }
-
-    public void setAdminName(String adminName) {
-        this.adminName = adminName;
-    }
-
-    public String getDomain() {
-        return domain;
-    }
-
-    public void setDomain(String domain) {
-        this.domain = domain;
-    }
-
-    public boolean isActive() {
-        return active;
-    }
-
-    public void setActive(boolean active) {
-        this.active = active;
-    }
-
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/commands/GetActiveTenantsInMemberRequest.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/commands/GetActiveTenantsInMemberRequest.java b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/commands/GetActiveTenantsInMemberRequest.java
deleted file mode 100644
index bf9b880..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/commands/GetActiveTenantsInMemberRequest.java
+++ /dev/null
@@ -1,59 +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.wso2.carbon.tenant.activity.commands;
-
-import org.apache.axis2.clustering.ClusteringCommand;
-import org.apache.axis2.clustering.ClusteringMessage;
-import org.apache.axis2.clustering.ClusteringFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils;
-import org.wso2.carbon.tenant.activity.beans.TenantDataBean;
-import org.wso2.carbon.user.api.Tenant;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This Cluster message is used to get active tenants in each node then
- * send response as other cluster command which holds active tenants
- */
-public class GetActiveTenantsInMemberRequest extends ClusteringMessage {
-    private static final Log log = LogFactory.getLog(GetActiveTenantsInMemberRequest.class);
-    private List<TenantDataBean> tenants = new ArrayList<TenantDataBean>();
-
-    public void execute(ConfigurationContext configurationContext) throws ClusteringFault {
-        try {
-            for (Tenant tenant : TenantAxisUtils.getActiveTenants(configurationContext)) {
-                TenantDataBean tb = new TenantDataBean();
-                tb.setDomain(tenant.getDomain());
-                tenants.add(tb);
-            }
-        } catch (Exception e) {
-            String msg = "Cannot get Active tenants";
-            log.error(msg, e);
-            throw new ClusteringFault(msg, e);
-        }
-    }
-
-    public ClusteringCommand getResponse() {
-        return new GetActiveTenantsInMemberResponse(tenants);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/commands/GetActiveTenantsInMemberResponse.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/commands/GetActiveTenantsInMemberResponse.java b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/commands/GetActiveTenantsInMemberResponse.java
deleted file mode 100644
index 8e4f411..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/commands/GetActiveTenantsInMemberResponse.java
+++ /dev/null
@@ -1,54 +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.activity.commands;
-
-import org.apache.axis2.clustering.ClusteringCommand;
-import org.apache.axis2.clustering.ClusteringFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.wso2.carbon.tenant.activity.beans.TenantDataBean;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * This clustering command is used send active tenants list if we send clustering message
- * GetActiveTenantsInMemberRequest then as a response we can get GetActiveTenantsInMemberResponse
- * which holds active tenants list
- */
-public class GetActiveTenantsInMemberResponse extends ClusteringCommand {
-
-    private List<TenantDataBean> tenants = new ArrayList<TenantDataBean>();
-
-    public GetActiveTenantsInMemberResponse(List<TenantDataBean> tenantList) {
-        tenants = tenantList;
-    }
-
-    public void addTenant(TenantDataBean tenant) {
-        tenants.add(tenant);
-    }
-
-    public List<TenantDataBean> getTenants() {
-        return Collections.unmodifiableList(tenants);
-    }
-
-    @Override
-    public void execute(ConfigurationContext configurationContext) throws ClusteringFault {
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/internal/TenantActivityServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/internal/TenantActivityServiceComponent.java b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/internal/TenantActivityServiceComponent.java
deleted file mode 100644
index 19f18bc..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/internal/TenantActivityServiceComponent.java
+++ /dev/null
@@ -1,99 +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.activity.internal;
-
-import org.wso2.carbon.stratos.common.util.*;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.transport.local.LocalTransportReceiver;
-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.tenant.activity.util.Util;
-import org.wso2.carbon.tenant.activity.util.Util;
-import org.wso2.carbon.user.core.service.RealmService;
-import org.wso2.carbon.utils.ConfigurationContextService;
-
-import java.lang.System;
-import java.lang.Throwable;
-
-/**
- * @scr.component name="org.wso2.carbon.tenant.activity" 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"
- * @scr.reference name="config.context.service"
- * interface="org.wso2.carbon.utils.ConfigurationContextService" cardinality="1..1"
- * policy="dynamic" bind="setConfigurationContextService" unbind="unsetConfigurationContextService"
- */
-public class TenantActivityServiceComponent {
-    private static Log log = LogFactory.getLog(TenantActivityServiceComponent.class);
-
-
-    protected void activate(ComponentContext context) {
-        try {
-            Util.registerRetrieverServices(context.getBundleContext());
-            if(log.isDebugEnabled()){
-                log.debug("******* Tenant Activity bundle is activated ******* ");
-            }
-        } catch (Throwable e) {
-            log.error("******* Error in activating Tenant Activity bundle ******* ", e);
-        }
-    }
-
-    protected void deactivate(ComponentContext context) {
-        if (log.isDebugEnabled()) {
-            log.debug("******* Tenant Activity is deactivated ******* ");
-        }
-    }
-
-    protected void setRegistryService(RegistryService registryService) {
-        Util.setRegistryService(registryService);
-    }
-
-    protected void unsetRegistryService(RegistryService registryService) {
-        Util.setRegistryService(null);
-    }
-
-    protected void setRealmService(RealmService realmService) {
-        Util.setRealmService(realmService);
-    }
-
-    protected void unsetRealmService(RealmService realmService) {
-        Util.setRealmService(null);
-    }
-
-    protected void setConfigurationContextService(ConfigurationContextService ccService) {
-        ConfigurationContext serverCtx = ccService.getServerConfigContext();
-        AxisConfiguration serverConfig = serverCtx.getAxisConfiguration();
-        LocalTransportReceiver.CONFIG_CONTEXT = new ConfigurationContext(serverConfig);
-        LocalTransportReceiver.CONFIG_CONTEXT.setServicePath("services");
-        LocalTransportReceiver.CONFIG_CONTEXT.setContextRoot("local:/");
-
-        Util.setConfigurationContextService(ccService);
-    }
-
-    protected void unsetConfigurationContextService(ConfigurationContextService ccService) {
-        Util.setConfigurationContextService(null);
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f5c66c37/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/services/TenantActivityService.java
----------------------------------------------------------------------
diff --git a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/services/TenantActivityService.java b/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/services/TenantActivityService.java
deleted file mode 100644
index 0fa57b1..0000000
--- a/components/stratos/tenant-activity/org.wso2.carbon.tenant.activity/2.1.0/src/main/java/org/wso2/carbon/tenant/activity/services/TenantActivityService.java
+++ /dev/null
@@ -1,83 +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.activity.services;
-
-import org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils;
-import org.wso2.carbon.core.AbstractAdmin;
-import org.wso2.carbon.tenant.activity.beans.PaginatedTenantDataBean;
-import org.wso2.carbon.tenant.activity.beans.TenantDataBean;
-import org.wso2.carbon.tenant.activity.util.TenantActivityUtil;
-import org.wso2.carbon.tenant.activity.util.Util;
-import org.wso2.carbon.user.api.Tenant;
-import org.wso2.carbon.utils.DataPaginator;
-
-import java.util.*;
-
-/**
- * This service use to get active tenants related data.If its single node
- */
-public class TenantActivityService extends AbstractAdmin {
-    List<String> list = new ArrayList<String>();
-
-    public int getActiveTenantCount() throws Exception {
-        return getAllActiveTenantList().size();
-    }
-
-    /**
-     *
-     * @return Active tenants list on service cluster
-     * @throws Exception  when error in retrieving active tenants list
-     */
-    private List<TenantDataBean> getAllActiveTenantList() throws Exception {
-       // ClusterMgtUtil cm = new ClusterMgtUtil();
-        List<TenantDataBean> list = new ArrayList<TenantDataBean>();
-        //This will add current node active tenants list to tenant list
-        for (Tenant tenant : TenantAxisUtils.getActiveTenants(Util.getConfigurationContextService().getServerConfigContext())) {
-            TenantDataBean tb = new TenantDataBean();
-            tb.setDomain(tenant.getDomain());
-            list.add(tb);
-        }
-        //if there are multiple nodes in clusters get active tenants from there as well
-        for (TenantDataBean tenantDataBean : TenantActivityUtil.getActiveTenantsInCluster()) {
-            if (TenantActivityUtil.indexOfTenantInList(list, tenantDataBean) < 0) {
-                list.add(tenantDataBean);
-            }
-
-        }
-        return list;
-    }
-
-    public PaginatedTenantDataBean retrievePaginatedActiveTenants(int pageNumber) throws Exception {
-        List<TenantDataBean> tenantList = getAllActiveTenantList();
-        // Pagination
-        PaginatedTenantDataBean paginatedTenantInfoBean = new PaginatedTenantDataBean();
-        DataPaginator.doPaging(pageNumber, tenantList, paginatedTenantInfoBean);
-        return paginatedTenantInfoBean;
-    }
-
-    public boolean isActiveTenantOnService(String domainName) throws Exception {
-        boolean state = false;
-        for (TenantDataBean tenant : getAllActiveTenantList()) {
-            if (tenant.getDomain().equalsIgnoreCase(domainName)) {
-                return true;
-            }
-        }
-        return state;
-    }
-}
\ No newline at end of file