You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2013/07/11 07:18:05 UTC

[14/27] aplying 0001-Refactor-usage-module-to-apache-stratos.patch

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/DailyCartridgeStatsSummarizerHelper.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/DailyCartridgeStatsSummarizerHelper.java b/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/DailyCartridgeStatsSummarizerHelper.java
deleted file mode 100644
index 1daf872..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/DailyCartridgeStatsSummarizerHelper.java
+++ /dev/null
@@ -1,57 +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.usage.summary.helper;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.analytics.hive.extension.AbstractHiveAnalyzer;
-import org.wso2.carbon.usage.summary.helper.util.DataAccessObject;
-
-import java.sql.Timestamp;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Helper class to set the hour range for the next daily summarization cycle in the hive config.
- * This is important to select the data slice corresponding the current daily summarization cycle
- * from the usage hourly tables.
- */
-public class DailyCartridgeStatsSummarizerHelper extends AbstractHiveAnalyzer {
-
-    private static Log log = LogFactory.getLog(HourlySummarizerHelper.class);
-
-    public void execute() {
-        log.info("Running custom analyzer for Stratos cartridge stats daily summarization.");
-        try {
-            String lastDailyTimestampStr = DataAccessObject.getInstance().getAndUpdateLastCartridgeStatsDailyTimestamp();
-            Long lastDailyTimestampSecs = Timestamp.valueOf(lastDailyTimestampStr).getTime() / 1000;
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
-            String currentTsStr = formatter.format(new Date().getTime());
-            Long currentTsSecs = Timestamp.valueOf(currentTsStr).getTime() / 1000;
-
-            log.info("Running daily cartridge stats analytics from " + lastDailyTimestampStr + " to " + currentTsStr);
-            setProperty("last_daily_ts", lastDailyTimestampSecs.toString());
-            setProperty("current_daily_ts", currentTsSecs.toString());
-        } catch (Exception e) {
-            log.error("An error occurred while setting date range for daily cartridge stats analysis. ", e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/DailyServiceStatsSummarizerHelper.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/DailyServiceStatsSummarizerHelper.java b/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/DailyServiceStatsSummarizerHelper.java
deleted file mode 100644
index d3152c1..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/DailyServiceStatsSummarizerHelper.java
+++ /dev/null
@@ -1,57 +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.usage.summary.helper;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.analytics.hive.extension.AbstractHiveAnalyzer;
-import org.wso2.carbon.usage.summary.helper.util.DataAccessObject;
-
-import java.sql.Timestamp;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Helper class to set the hour range for the next daily summarization cycle in the hive config.
- * This is important to select the data slice corresponding the current daily summarization cycle
- * from the usage hourly tables.
- */
-public class DailyServiceStatsSummarizerHelper extends AbstractHiveAnalyzer {
-
-    private static Log log = LogFactory.getLog(HourlySummarizerHelper.class);
-
-    public void execute() {
-        log.info("Running custom analyzer for Stratos service stats daily summarization.");
-        try {
-            String lastDailyTimestampStr = DataAccessObject.getInstance().getAndUpdateLastServiceStatsDailyTimestamp();
-            Long lastDailyTimestampSecs = Timestamp.valueOf(lastDailyTimestampStr).getTime() / 1000;
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
-            String currentTsStr = formatter.format(new Date().getTime());
-            Long currentTsSecs = Timestamp.valueOf(currentTsStr).getTime() / 1000;
-
-            log.info("Running daily service stats analytics from " + lastDailyTimestampStr + " to " + currentTsStr);
-            setProperty("last_daily_ts", lastDailyTimestampSecs.toString());
-            setProperty("current_daily_ts", currentTsSecs.toString());
-        } catch (Exception e) {
-            log.error("An error occurred while setting date range for daily service stats analysis. ", e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/DailySummarizerHelper.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/DailySummarizerHelper.java b/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/DailySummarizerHelper.java
deleted file mode 100644
index a80670c..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/DailySummarizerHelper.java
+++ /dev/null
@@ -1,57 +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.usage.summary.helper;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.analytics.hive.extension.AbstractHiveAnalyzer;
-import org.wso2.carbon.usage.summary.helper.util.DataAccessObject;
-
-import java.sql.Timestamp;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Helper class to set the hour range for the next daily summarization cycle in the hive config.
- * This is important to select the data slice corresponding the current daily summarization cycle
- * from the usage hourly tables.
- */
-public class DailySummarizerHelper extends AbstractHiveAnalyzer {
-
-    private static Log log = LogFactory.getLog(HourlySummarizerHelper.class);
-
-    public void execute() {
-        log.info("Running custom analyzer for Stratos usage daily summarization.");
-        try {
-            String lastDailyTimestampStr = DataAccessObject.getInstance().getAndUpdateLastUsageDailyTimestamp();
-            Long lastDailyTimestampSecs = Timestamp.valueOf(lastDailyTimestampStr).getTime() / 1000;
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
-            String currentTsStr = formatter.format(new Date().getTime());
-            Long currentTsSecs = Timestamp.valueOf(currentTsStr).getTime() / 1000;
-
-            log.info("Running daily usage analytics from " + lastDailyTimestampStr + " to " + currentTsStr);
-            setProperty("last_daily_ts", lastDailyTimestampSecs.toString());
-            setProperty("current_daily_ts", currentTsSecs.toString());
-        } catch (Exception e) {
-            log.error("An error occurred while setting date range for daily usage analysis. ", e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/HourlyCartridgeStatsSummarizerHelper.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/HourlyCartridgeStatsSummarizerHelper.java b/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/HourlyCartridgeStatsSummarizerHelper.java
deleted file mode 100644
index f4da660..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/HourlyCartridgeStatsSummarizerHelper.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.usage.summary.helper;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.analytics.hive.extension.AbstractHiveAnalyzer;
-import org.wso2.carbon.usage.summary.helper.util.DataAccessObject;
-
-import java.sql.Timestamp;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Helper class to set the timestamp of the last hourly summarization cycle in hive config.
- * This is needed to excluded the already summarized usage stats in the current summarization cycle.
- */
-public class HourlyCartridgeStatsSummarizerHelper extends AbstractHiveAnalyzer {
-
-    private static Log log = LogFactory.getLog(HourlyCartridgeStatsSummarizerHelper.class);
-
-    public void execute() {
-        log.info("Running custom analyzer for Stratos cartridge stats hourly summarization.");
-        try {
-            String lastHourlyTimestampStr = DataAccessObject.getInstance().getAndUpdateLastCartridgeStatsHourlyTimestamp();
-            Long lastHourlyTimestamp = Timestamp.valueOf(lastHourlyTimestampStr).getTime();
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:00");
-            String currentTsStr = formatter.format(new Date().getTime());
-
-            log.info("Running hourly cartridge stats analytics from " + lastHourlyTimestampStr + " to " + currentTsStr);
-            setProperty("last_hourly_ts", lastHourlyTimestamp.toString());
-        } catch (Exception e) {
-            log.error("An error occurred while setting hour range for hourly cartridge stats analysis. ", e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/HourlyServiceStatsSummarizerHelper.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/HourlyServiceStatsSummarizerHelper.java b/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/HourlyServiceStatsSummarizerHelper.java
deleted file mode 100644
index f1b44cc..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/HourlyServiceStatsSummarizerHelper.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.usage.summary.helper;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.analytics.hive.extension.AbstractHiveAnalyzer;
-import org.wso2.carbon.usage.summary.helper.util.DataAccessObject;
-
-import java.sql.Timestamp;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Helper class to set the timestamp of the last hourly summarization cycle in hive config.
- * This is needed to excluded the already summarized usage stats in the current summarization cycle.
- */
-public class HourlyServiceStatsSummarizerHelper extends AbstractHiveAnalyzer {
-
-    private static Log log = LogFactory.getLog(HourlyServiceStatsSummarizerHelper.class);
-
-    public void execute() {
-        log.info("Running custom analyzer for Stratos service stats hourly summarization.");
-        try {
-            String lastHourlyTimestampStr = DataAccessObject.getInstance().getAndUpdateLastServiceStatsHourlyTimestamp();
-            Long lastHourlyTimestamp = Timestamp.valueOf(lastHourlyTimestampStr).getTime();
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:00");
-            String currentTsStr = formatter.format(new Date().getTime());
-
-            log.info("Running hourly service stats analytics from " + lastHourlyTimestampStr + " to " + currentTsStr);
-            setProperty("last_hourly_ts", lastHourlyTimestamp.toString());
-        } catch (Exception e) {
-            log.error("An error occurred while setting hour range for hourly service stats analysis. ", e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/HourlySummarizerHelper.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/HourlySummarizerHelper.java b/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/HourlySummarizerHelper.java
deleted file mode 100644
index bafe96b..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/HourlySummarizerHelper.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.usage.summary.helper;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.analytics.hive.extension.AbstractHiveAnalyzer;
-import org.wso2.carbon.usage.summary.helper.util.DataAccessObject;
-
-import java.sql.Timestamp;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Helper class to set the timestamp of the last hourly summarization cycle in hive config.
- * This is needed to excluded the already summarized usage stats in the current summarization cycle.
- */
-public class HourlySummarizerHelper extends AbstractHiveAnalyzer {
-
-    private static Log log = LogFactory.getLog(HourlySummarizerHelper.class);
-
-    public void execute() {
-        log.info("Running custom analyzer for Stratos usage hourly summarization.");
-        try {
-            String lastHourlyTimestampStr = DataAccessObject.getInstance().getAndUpdateLastUsageHourlyTimestamp();
-            Long lastHourlyTimestamp = Timestamp.valueOf(lastHourlyTimestampStr).getTime();
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:00");
-            String currentTsStr = formatter.format(new Date().getTime());
-
-            log.info("Running hourly usage analytics from " + lastHourlyTimestampStr + " to " + currentTsStr);
-            setProperty("last_hourly_ts", lastHourlyTimestamp.toString());
-        } catch (Exception e) {
-            log.error("An error occurred while setting hour range for hourly usage analysis. ", e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/MonthlyCartridgeStatsSummarizerHelper.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/MonthlyCartridgeStatsSummarizerHelper.java b/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/MonthlyCartridgeStatsSummarizerHelper.java
deleted file mode 100644
index 3619ad8..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/MonthlyCartridgeStatsSummarizerHelper.java
+++ /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.
-*/
-
-package org.wso2.carbon.usage.summary.helper;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.analytics.hive.extension.AbstractHiveAnalyzer;
-import org.wso2.carbon.usage.summary.helper.util.DataAccessObject;
-
-import java.sql.Timestamp;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Helper class to set the date range for the next monthly summarization cycle in the hive config.
- * This is important to select the data slice corresponding the current monthly summarization cycle
- * from the usage hourly tables.
- */
-public class MonthlyCartridgeStatsSummarizerHelper extends AbstractHiveAnalyzer {
-
-    private static Log log = LogFactory.getLog(HourlySummarizerHelper.class);
-
-    public void execute() {
-        log.info("Running custom analyzer for Stratos cartridge stats monthly summarization.");
-        try {
-            String lastMonthlyTimestampStr = DataAccessObject.getInstance().getAndUpdateLastCartridgeStatsMonthlyTimestamp();
-            Long lastMonthlyTimestampSecs = Timestamp.valueOf(lastMonthlyTimestampStr).getTime() / 1000;
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
-            String currentTsStr = formatter.format(new Date().getTime());
-            Long currentTsSecs = Timestamp.valueOf(currentTsStr).getTime() / 1000;
-
-            log.info("Running monthly cartridge stats analytics from " + lastMonthlyTimestampStr + " to " + currentTsStr);
-            setProperty("last_monthly_ts", lastMonthlyTimestampSecs.toString());
-            setProperty("current_monthly_ts", currentTsSecs.toString());
-        } catch (Exception e) {
-            log.error("An error occurred while setting month range for monthly cartridge stats analytics. ", e);
-        }
-
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/MonthlyServiceStatsSummarizerHelper.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/MonthlyServiceStatsSummarizerHelper.java b/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/MonthlyServiceStatsSummarizerHelper.java
deleted file mode 100644
index dec01ea..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/MonthlyServiceStatsSummarizerHelper.java
+++ /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.
-*/
-
-package org.wso2.carbon.usage.summary.helper;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.analytics.hive.extension.AbstractHiveAnalyzer;
-import org.wso2.carbon.usage.summary.helper.util.DataAccessObject;
-
-import java.sql.Timestamp;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Helper class to set the date range for the next monthly summarization cycle in the hive config.
- * This is important to select the data slice corresponding the current monthly summarization cycle
- * from the usage hourly tables.
- */
-public class MonthlyServiceStatsSummarizerHelper extends AbstractHiveAnalyzer {
-
-    private static Log log = LogFactory.getLog(HourlySummarizerHelper.class);
-
-    public void execute() {
-        log.info("Running custom analyzer for Stratos service stats monthly summarization.");
-        try {
-            String lastMonthlyTimestampStr = DataAccessObject.getInstance().getAndUpdateLastUsageMonthlyTimestamp();
-            Long lastMonthlyTimestampSecs = Timestamp.valueOf(lastMonthlyTimestampStr).getTime() / 1000;
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
-            String currentTsStr = formatter.format(new Date().getTime());
-            Long currentTsSecs = Timestamp.valueOf(currentTsStr).getTime() / 1000;
-
-            log.info("Running monthly service stats analytics from " + lastMonthlyTimestampStr + " to " + currentTsStr);
-            setProperty("last_monthly_ts", lastMonthlyTimestampSecs.toString());
-            setProperty("current_monthly_ts", currentTsSecs.toString());
-        } catch (Exception e) {
-            log.error("An error occurred while setting month range for monthly service stats analytics. ", e);
-        }
-
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/MonthlySummarizerHelper.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/MonthlySummarizerHelper.java b/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/MonthlySummarizerHelper.java
deleted file mode 100644
index ce32eba..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/MonthlySummarizerHelper.java
+++ /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.
-*/
-
-package org.wso2.carbon.usage.summary.helper;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.analytics.hive.extension.AbstractHiveAnalyzer;
-import org.wso2.carbon.usage.summary.helper.util.DataAccessObject;
-
-import java.sql.Timestamp;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Helper class to set the date range for the next monthly summarization cycle in the hive config.
- * This is important to select the data slice corresponding the current monthly summarization cycle
- * from the usage hourly tables.
- */
-public class MonthlySummarizerHelper extends AbstractHiveAnalyzer {
-
-    private static Log log = LogFactory.getLog(HourlySummarizerHelper.class);
-
-    public void execute() {
-        log.info("Running custom analyzer for Stratos usage monthly summarization.");
-        try {
-            String lastMonthlyTimestampStr = DataAccessObject.getInstance().getAndUpdateLastServiceStatsMonthlyTimestamp();
-            Long lastMonthlyTimestampSecs = Timestamp.valueOf(lastMonthlyTimestampStr).getTime() / 1000;
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
-            String currentTsStr = formatter.format(new Date().getTime());
-            Long currentTsSecs = Timestamp.valueOf(currentTsStr).getTime() / 1000;
-
-            log.info("Running monthly service stats analytics from " + lastMonthlyTimestampStr + " to " + currentTsStr);
-            setProperty("last_monthly_ts", lastMonthlyTimestampSecs.toString());
-            setProperty("current_monthly_ts", currentTsSecs.toString());
-        } catch (Exception e) {
-            log.error("An error occurred while setting month range for monthly service stats analysis. ", e);
-        }
-
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/internal/UsageSummaryHelperServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/internal/UsageSummaryHelperServiceComponent.java b/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/internal/UsageSummaryHelperServiceComponent.java
deleted file mode 100644
index 9f36639..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/internal/UsageSummaryHelperServiceComponent.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.usage.summary.helper.internal;
-
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.osgi.service.component.ComponentContext;
-import org.wso2.carbon.analytics.hive.service.HiveExecutorService;
-import org.wso2.carbon.ndatasource.core.DataSourceService;
-import org.wso2.carbon.usage.summary.helper.util.DataHolder;
-
-import javax.sql.DataSource;
-
-/**
- *
- * @scr.component name="org.wso2.carbon.usage.summary" immediate="true"
- * @scr.reference name="hive.executor.service"
- * interface="org.wso2.carbon.analytics.hive.service.HiveExecutorService" cardinality="1..1"
- * policy="dynamic" bind="setHiveExecutorService" unbind="unsetHiveExecutorService"
- * @scr.reference name="datasources.service"
- * interface="org.wso2.carbon.ndatasource.core.DataSourceService"
- * cardinality="1..1" policy="dynamic"
- * bind="setDataSourceService" unbind="unsetDataSourceService"
- */
-public class UsageSummaryHelperServiceComponent {
-    
-    private static Log log = LogFactory.getLog(UsageSummaryHelperServiceComponent.class);
-
-    protected void activate(ComponentContext context){
-
-        log.info("Stratos usage summary helper bundle started");
-        /*try{
-
-        }catch (Throwable t){
-            log.error("Error occurred while activating the usage summary helper bundle..", t);
-        }*/
-    }
-
-    protected void deactivate(){
-        log.debug("Usage summary helper bundle was deactivated..");
-    }
-
-    protected void setHiveExecutorService(HiveExecutorService executorService){
-        //DataHolder.setExecutorService(executorService);
-    }
-
-    protected void unsetHiveExecutorService(HiveExecutorService executorService){
-        //DataHolder.setExecutorService(null);
-    }
-    
-    protected void setDataSourceService(DataSourceService dataSourceService){
-        DataHolder.setDataSourceService(dataSourceService);
-        try {
-            DataHolder.setDataSource((DataSource)dataSourceService.getDataSource(DataHolder.BILLING_DATA_SOURCE_NAME).getDSObject());
-            log.info("Data source set to data holder");
-        } catch (Exception e) {
-            log.error("Error occurred while retrieving the data source: " + DataHolder.BILLING_DATA_SOURCE_NAME, e); //To change body of catch statement use File | Settings | File Templates.
-        }
-    }
-
-    protected void unsetDataSourceService(DataSourceService dataSourceService){
-        DataHolder.setDataSourceService(null);
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/util/DataAccessObject.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/util/DataAccessObject.java b/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/util/DataAccessObject.java
deleted file mode 100644
index 41a474c..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/util/DataAccessObject.java
+++ /dev/null
@@ -1,399 +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.usage.summary.helper.util;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.sql.DataSource;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Timestamp;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Helper class to retrieve relevant timestamps from relational database tables.
- */
-public class DataAccessObject {
-
-    private static Log log = LogFactory.getLog(DataAccessObject.class);
-
-    private static DataSource dataSource = null;
-
-    private static DataAccessObject usageDataAccessObj = null;
-
-    private DataAccessObject() {
-    }
-
-    public static DataAccessObject getInstance() throws Exception {
-        if (usageDataAccessObj == null) {
-            usageDataAccessObj = new DataAccessObject();
-        }
-
-        if (usageDataAccessObj.dataSource == null) {
-            if (DataHolder.getDataSource() != null) {
-                try {
-                    dataSource = DataHolder.getDataSource();
-                    //dataSource = (DataSource) DataHolder.getDataSourceService().
-                    //       getDataSource(DataHolder.BILLING_DATA_SOURCE_NAME).getDSObject();
-                } catch (Exception e) {
-                    log.error("Error occurred while obtaining " + DataHolder.BILLING_DATA_SOURCE_NAME +
-                              " datasource from data source service.", e);
-                    throw new Exception(e);
-                }
-            } else {
-                log.error("Cannot obtain data source " + DataHolder.BILLING_DATA_SOURCE_NAME +
-                          ". Datasource service is null");
-                throw new Exception("Datasource service not available");
-            }
-
-        }
-
-        return usageDataAccessObj;
-    }
-
-    public String getAndUpdateLastUsageHourlyTimestamp() throws SQLException {
-
-        Timestamp lastSummaryTs = null;
-        Connection connection = null;
-
-        try {
-            connection = dataSource.getConnection();
-            String sql = "SELECT TIMESTMP FROM USAGE_LAST_HOURLY_TS WHERE ID='LatestTS'";
-            PreparedStatement ps = connection.prepareStatement(sql);
-            ResultSet resultSet = ps.executeQuery();
-            if (resultSet.next()) {
-                lastSummaryTs = resultSet.getTimestamp("TIMESTMP");
-            } else {
-                lastSummaryTs = new Timestamp(0);
-            }
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:00");
-            Timestamp currentTs = Timestamp.valueOf(formatter.format(new Date()));
-
-            String currentSql = "INSERT INTO USAGE_LAST_HOURLY_TS (ID, TIMESTMP) VALUES('LatestTS',?) ON DUPLICATE KEY UPDATE TIMESTMP=?";
-            PreparedStatement ps1 = connection.prepareStatement(currentSql);
-            ps1.setTimestamp(1, currentTs);
-            ps1.setTimestamp(2, currentTs);
-            ps1.execute();
-
-        } catch (SQLException e) {
-            log.error("Error occurred while trying to get and update the last hourly timestamp. ", e);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-
-        return lastSummaryTs.toString();
-    }
-
-    public String getAndUpdateLastUsageDailyTimestamp() throws SQLException {
-
-        Timestamp lastSummaryTs = null;
-        Connection connection = null;
-
-        try {
-            connection = dataSource.getConnection();
-            String sql = "SELECT TIMESTMP FROM USAGE_LAST_DAILY_TS WHERE ID='LatestTS'";
-            PreparedStatement ps = connection.prepareStatement(sql);
-            ResultSet resultSet = ps.executeQuery();
-            if (resultSet.next()) {
-                lastSummaryTs = resultSet.getTimestamp("TIMESTMP");
-            } else {
-                lastSummaryTs = new Timestamp(0);
-            }
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
-            Timestamp currentTs = Timestamp.valueOf(formatter.format(new Date()));
-
-            String currentSql = "INSERT INTO USAGE_LAST_DAILY_TS (ID, TIMESTMP) VALUES('LatestTS',?) ON DUPLICATE KEY UPDATE TIMESTMP=?";
-            PreparedStatement ps1 = connection.prepareStatement(currentSql);
-            ps1.setTimestamp(1, currentTs);
-            ps1.setTimestamp(2, currentTs);
-            ps1.execute();
-
-        } catch (SQLException e) {
-            log.error("Error occurred while trying to get and update the last daily timestamp. ", e);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-
-        return lastSummaryTs.toString();
-    }
-
-    public String getAndUpdateLastUsageMonthlyTimestamp() throws SQLException {
-
-        Timestamp lastSummaryTs = null;
-        Connection connection = null;
-
-        try {
-            connection = dataSource.getConnection();
-            String sql = "SELECT TIMESTMP FROM USAGE_LAST_MONTHLY_TS WHERE ID='LatestTS'";
-            PreparedStatement ps = connection.prepareStatement(sql);
-            ResultSet resultSet = ps.executeQuery();
-            if (resultSet.next()) {
-                lastSummaryTs = resultSet.getTimestamp("TIMESTMP");
-            } else {
-                lastSummaryTs = new Timestamp(0);
-            }
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
-            Timestamp currentTs = Timestamp.valueOf(formatter.format(new Date()));
-
-            String currentSql = "INSERT INTO USAGE_LAST_MONTHLY_TS (ID, TIMESTMP) VALUES('LatestTS',?) ON DUPLICATE KEY UPDATE TIMESTMP=?";
-            PreparedStatement ps1 = connection.prepareStatement(currentSql);
-            ps1.setTimestamp(1, currentTs);
-            ps1.setTimestamp(2, currentTs);
-            ps1.execute();
-
-        } catch (SQLException e) {
-            log.error("Error occurred while trying to get and update the last monthly timestamp. ", e);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-
-        return lastSummaryTs.toString();
-    }
-
-    public String getAndUpdateLastServiceStatsHourlyTimestamp() throws SQLException {
-
-        Timestamp lastSummaryTs = null;
-        Connection connection = null;
-
-        try {
-            connection = dataSource.getConnection();
-            String sql = "SELECT TIMESTMP FROM SERVICE_STATS_LAST_HOURLY_TS WHERE ID='LatestTS'";
-            PreparedStatement ps = connection.prepareStatement(sql);
-            ResultSet resultSet = ps.executeQuery();
-            if (resultSet.next()) {
-                lastSummaryTs = resultSet.getTimestamp("TIMESTMP");
-            } else {
-                lastSummaryTs = new Timestamp(0);
-            }
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:00");
-            Timestamp currentTs = Timestamp.valueOf(formatter.format(new Date()));
-
-            String currentSql = "INSERT INTO SERVICE_STATS_LAST_HOURLY_TS (ID, TIMESTMP) VALUES('LatestTS',?) ON DUPLICATE KEY UPDATE TIMESTMP=?";
-            PreparedStatement ps1 = connection.prepareStatement(currentSql);
-            ps1.setTimestamp(1, currentTs);
-            ps1.setTimestamp(2, currentTs);
-            ps1.execute();
-
-        } catch (SQLException e) {
-            log.error("Error occurred while trying to get and update the last hourly timestamp. ", e);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-
-        return lastSummaryTs.toString();
-    }
-
-    public String getAndUpdateLastServiceStatsDailyTimestamp() throws SQLException {
-
-        Timestamp lastSummaryTs = null;
-        Connection connection = null;
-
-        try {
-            connection = dataSource.getConnection();
-            String sql = "SELECT TIMESTMP FROM SERVICE_STATS_LAST_DAILY_TS WHERE ID='LatestTS'";
-            PreparedStatement ps = connection.prepareStatement(sql);
-            ResultSet resultSet = ps.executeQuery();
-            if (resultSet.next()) {
-                lastSummaryTs = resultSet.getTimestamp("TIMESTMP");
-            } else {
-                lastSummaryTs = new Timestamp(0);
-            }
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
-            Timestamp currentTs = Timestamp.valueOf(formatter.format(new Date()));
-
-            String currentSql = "INSERT INTO SERVICE_STATS_LAST_DAILY_TS (ID, TIMESTMP) VALUES('LatestTS',?) ON DUPLICATE KEY UPDATE TIMESTMP=?";
-            PreparedStatement ps1 = connection.prepareStatement(currentSql);
-            ps1.setTimestamp(1, currentTs);
-            ps1.setTimestamp(2, currentTs);
-            ps1.execute();
-
-        } catch (SQLException e) {
-            log.error("Error occurred while trying to get and update the last daily timestamp. ", e);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-
-        return lastSummaryTs.toString();
-    }
-
-    public String getAndUpdateLastServiceStatsMonthlyTimestamp() throws SQLException {
-
-        Timestamp lastSummaryTs = null;
-        Connection connection = null;
-
-        try {
-            connection = dataSource.getConnection();
-            String sql = "SELECT TIMESTMP FROM SERVICE_STATS_LAST_MONTHLY_TS WHERE ID='LatestTS'";
-            PreparedStatement ps = connection.prepareStatement(sql);
-            ResultSet resultSet = ps.executeQuery();
-            if (resultSet.next()) {
-                lastSummaryTs = resultSet.getTimestamp("TIMESTMP");
-            } else {
-                lastSummaryTs = new Timestamp(0);
-            }
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
-            Timestamp currentTs = Timestamp.valueOf(formatter.format(new Date()));
-
-            String currentSql = "INSERT INTO SERVICE_STATS_LAST_MONTHLY_TS (ID, TIMESTMP) VALUES('LatestTS',?) ON DUPLICATE KEY UPDATE TIMESTMP=?";
-            PreparedStatement ps1 = connection.prepareStatement(currentSql);
-            ps1.setTimestamp(1, currentTs);
-            ps1.setTimestamp(2, currentTs);
-            ps1.execute();
-
-        } catch (SQLException e) {
-            log.error("Error occurred while trying to get and update the last monthly timestamp. ", e);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-
-        return lastSummaryTs.toString();
-    }
-
-    public String getAndUpdateLastCartridgeStatsHourlyTimestamp() throws SQLException {
-
-        Timestamp lastSummaryTs = null;
-        Connection connection = null;
-
-        try {
-            connection = dataSource.getConnection();
-            String sql = "SELECT TIMESTMP FROM CARTRIDGE_STATS_LAST_HOURLY_TS WHERE ID='LatestTS'";
-            PreparedStatement ps = connection.prepareStatement(sql);
-            ResultSet resultSet = ps.executeQuery();
-            if (resultSet.next()) {
-                lastSummaryTs = resultSet.getTimestamp("TIMESTMP");
-            } else {
-                lastSummaryTs = new Timestamp(0);
-            }
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:00");
-            Timestamp currentTs = Timestamp.valueOf(formatter.format(new Date()));
-
-            String currentSql = "INSERT INTO CARTRIDGE_STATS_LAST_HOURLY_TS (ID, TIMESTMP) VALUES('LatestTS',?) ON DUPLICATE KEY UPDATE TIMESTMP=?";
-            PreparedStatement ps1 = connection.prepareStatement(currentSql);
-            ps1.setTimestamp(1, currentTs);
-            ps1.setTimestamp(2, currentTs);
-            ps1.execute();
-
-        } catch (SQLException e) {
-            log.error("Error occurred while trying to get and update the last hourly timestamp for cartridge stats. ", e);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-
-        return lastSummaryTs.toString();
-    }
-
-    public String getAndUpdateLastCartridgeStatsDailyTimestamp() throws SQLException {
-
-        Timestamp lastSummaryTs = null;
-        Connection connection = null;
-
-        try {
-            connection = dataSource.getConnection();
-            String sql = "SELECT TIMESTMP FROM CARTRIDGE_STATS_LAST_DAILY_TS WHERE ID='LatestTS'";
-            PreparedStatement ps = connection.prepareStatement(sql);
-            ResultSet resultSet = ps.executeQuery();
-            if (resultSet.next()) {
-                lastSummaryTs = resultSet.getTimestamp("TIMESTMP");
-            } else {
-                lastSummaryTs = new Timestamp(0);
-            }
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
-            Timestamp currentTs = Timestamp.valueOf(formatter.format(new Date()));
-
-            String currentSql = "INSERT INTO CARTRIDGE_STATS_LAST_DAILY_TS (ID, TIMESTMP) VALUES('LatestTS',?) ON DUPLICATE KEY UPDATE TIMESTMP=?";
-            PreparedStatement ps1 = connection.prepareStatement(currentSql);
-            ps1.setTimestamp(1, currentTs);
-            ps1.setTimestamp(2, currentTs);
-            ps1.execute();
-
-        } catch (SQLException e) {
-            log.error("Error occurred while trying to get and update the last daily timestamp for cartridge stats. ", e);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-
-        return lastSummaryTs.toString();
-    }
-
-    public String getAndUpdateLastCartridgeStatsMonthlyTimestamp() throws SQLException {
-
-        Timestamp lastSummaryTs = null;
-        Connection connection = null;
-
-        try {
-            connection = dataSource.getConnection();
-            String sql = "SELECT TIMESTMP FROM CARTRIDGE_STATS_LAST_MONTHLY_TS WHERE ID='LatestTS'";
-            PreparedStatement ps = connection.prepareStatement(sql);
-            ResultSet resultSet = ps.executeQuery();
-            if (resultSet.next()) {
-                lastSummaryTs = resultSet.getTimestamp("TIMESTMP");
-            } else {
-                lastSummaryTs = new Timestamp(0);
-            }
-
-            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
-            Timestamp currentTs = Timestamp.valueOf(formatter.format(new Date()));
-
-            String currentSql = "INSERT INTO CARTRIDGE_STATS_LAST_MONTHLY_TS (ID, TIMESTMP) VALUES('LatestTS',?) ON DUPLICATE KEY UPDATE TIMESTMP=?";
-            PreparedStatement ps1 = connection.prepareStatement(currentSql);
-            ps1.setTimestamp(1, currentTs);
-            ps1.setTimestamp(2, currentTs);
-            ps1.execute();
-
-        } catch (SQLException e) {
-            log.error("Error occurred while trying to get and update the last monthly timestamp for cartridge stats. ", e);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-
-        return lastSummaryTs.toString();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/util/DataHolder.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/util/DataHolder.java b/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/util/DataHolder.java
deleted file mode 100644
index edc2064..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.summary.helper/2.1.3/src/main/java/org/wso2/carbon/usage/summary/helper/util/DataHolder.java
+++ /dev/null
@@ -1,50 +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.usage.summary.helper.util;
-
-import org.wso2.carbon.ndatasource.core.DataSourceService;
-
-import javax.sql.DataSource;
-
-public class DataHolder {
-
-    private static DataSourceService dataSourceService;
-
-    private static DataSource dataSource;
-
-    public static final String BILLING_DATA_SOURCE_NAME = "WSO2BillingDS";
-    //public static final String BILLING_DATA_SOURCE_NAME = "WSO2USAGE_DS";
-
-
-    public static DataSource getDataSource() {
-        return dataSource;
-    }
-
-    public static void setDataSource(DataSource dataSource) {
-        DataHolder.dataSource = dataSource;
-    }
-
-    public static DataSourceService getDataSourceService() {
-        return dataSourceService;
-    }
-
-    public static void setDataSourceService(DataSourceService dataSourceService) {
-        DataHolder.dataSourceService = dataSourceService;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/pom.xml b/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/pom.xml
deleted file mode 100644
index e448fb1..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/pom.xml
+++ /dev/null
@@ -1,130 +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>usage-parent</artifactId>
-        <version>2.1.0</version>
-<relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.wso2.carbon.usage.ui</artifactId>
-    <version>2.1.0</version>
-    <packaging>bundle</packaging>
-    <name>WSO2 Stratos - Usage - User Interface</name>
-
-    <build>
-
-        <plugins>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.5</source>
-                    <target>1.5</target>
-                </configuration>
-            </plugin>
-
-
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-                        <Bundle-Name>${project.artifactId}</Bundle-Name>
-                        <Export-Package>
-                            org.wso2.carbon.usage.ui.*,
-                        </Export-Package>
-                        <Import-Package>
-			    org.wso2.carbon.usage.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.*,
-                            *;resolution:=optional
-                        </Import-Package>
-                        <Carbon-Component>UIBundle</Carbon-Component>
-                    </instructions>
-                </configuration>
-            </plugin>
-
-        </plugins>
-    </build>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>
-	    <dependency>
-            <groupId>commons-codec.wso2</groupId>
-            <artifactId>commons-codec</artifactId>
-        </dependency>
-        <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>
-        </dependency>
-	<dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.usage.stub</artifactId>
-		<version>4.1.0</version>
-        </dependency>
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/clients/UsageServiceClient.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/clients/UsageServiceClient.java b/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/clients/UsageServiceClient.java
deleted file mode 100644
index 64ee922..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/clients/UsageServiceClient.java
+++ /dev/null
@@ -1,115 +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.usage.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.ui.CarbonUIUtil;
-import org.wso2.carbon.usage.stub.beans.xsd.InstanceUsageStatics;
-import org.wso2.carbon.usage.stub.beans.xsd.PaginatedInstanceUsage;
-import org.wso2.carbon.usage.stub.beans.xsd.PaginatedTenantUsageInfo;
-import org.wso2.carbon.usage.stub.beans.xsd.TenantUsage;
-import org.wso2.carbon.usage.stub.services.UsageServiceStub;
-import org.wso2.carbon.utils.ServerConstants;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.http.HttpSession;
-
-public class UsageServiceClient {
-    private static final Log log = LogFactory.getLog(UsageServiceClient.class);
-
-    private UsageServiceStub stub;
-    private String epr;
-
-    public UsageServiceClient(
-            String cookie, String backendServerURL, ConfigurationContext configContext)
-            throws RegistryException {
-
-        epr = backendServerURL + "UsageService";
-
-        try {
-            stub = new UsageServiceStub(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 UsageService service client. " + axisFault.getMessage();
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-    public UsageServiceClient(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 + "UsageService";
-
-        try {
-            stub = new UsageServiceStub(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 UsageService service client. " + axisFault.getMessage();
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-    public TenantUsage retrieveCurrentTenantUsage(String yearMonth) throws Exception {
-        return stub.retrieveCurrentTenantUsage(yearMonth);
-    }
-
-    public TenantUsage[] retrieveTenantUsages(String yearMonth) throws Exception {
-        return stub.retrieveTenantUsages(yearMonth);
-    }
-
-    public PaginatedTenantUsageInfo retrievePaginatedTenantUsages(String yearMonth, int pageNumber,
-                                                                  int entriesPerPage) throws Exception {
-        return stub.retrievePaginatedTenantUsages(yearMonth, pageNumber, entriesPerPage);
-    }
-
-    public TenantUsage retrieveTenantUsage(String yearMonth, int tenantId) throws Exception {
-        return stub.retrieveTenantUsage(yearMonth, tenantId);
-    }
-
-    public InstanceUsageStatics[] retrieveInstanceUsage() throws Exception{
-            return stub.retrieveInstanceUsage();
-    }
-
-    public PaginatedInstanceUsage retrievePaginatedInstanceUsage (
-            String yearMonth, int pageNumber, int numbersPerPage) throws Exception {
-            return stub.retrievePaginatedInstanceUsage(yearMonth, pageNumber, numbersPerPage);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/report/AllTenantUsageData.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/report/AllTenantUsageData.java b/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/report/AllTenantUsageData.java
deleted file mode 100755
index 38ff46b..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/report/AllTenantUsageData.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package org.wso2.carbon.usage.ui.report;
-
-/**
- * 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.
- */
-public class AllTenantUsageData {
-
-	public AllTenantUsageData() {
-	}
-
-	String yearMonth;
-	
-	String tenantName;
-	
-	String numberOfUsers;
-	
-	String currentDataStorage;
-	
-	String regBandwidth;
-	
-	String svcBandwidth;
-	
-	String svcTotalRequest;
-
-	public String getYearMonth() {
-		return yearMonth;
-	}
-
-	public void setYearMonth(String yearMonth) {
-		this.yearMonth = yearMonth;
-	}
-
-	public String getTenantName() {
-		return tenantName;
-	}
-
-	public void setTenantName(String tenantName) {
-		this.tenantName = tenantName;
-	}
-
-	public String getNumberOfUsers() {
-		return numberOfUsers;
-	}
-
-	public void setNumberOfUsers(String numberOfUsers) {
-		this.numberOfUsers = numberOfUsers;
-	}
-
-	public String getCurrentDataStorage() {
-		return currentDataStorage;
-	}
-
-	public void setCurrentDataStorage(String currentDataStorage) {
-		this.currentDataStorage = currentDataStorage;
-	}
-
-	public String getRegBandwidth() {
-		return regBandwidth;
-	}
-
-	public void setRegBandwidth(String regBandwidth) {
-		this.regBandwidth = regBandwidth;
-	}
-
-	public String getSvcBandwidth() {
-		return svcBandwidth;
-	}
-
-	public void setSvcBandwidth(String svcBandwidth) {
-		this.svcBandwidth = svcBandwidth;
-	}
-
-	public String getSvcTotalRequest() {
-		return svcTotalRequest;
-	}
-
-	public void setSvcTotalRequest(String svcTotalRequest) {
-		this.svcTotalRequest = svcTotalRequest;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/report/AllTenantUsageReport.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/report/AllTenantUsageReport.java b/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/report/AllTenantUsageReport.java
deleted file mode 100644
index 00d03b3..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/report/AllTenantUsageReport.java
+++ /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.
-*/
-
-package org.wso2.carbon.usage.ui.report;
-
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.usage.stub.beans.xsd.PaginatedTenantUsageInfo;
-import org.wso2.carbon.usage.stub.beans.xsd.TenantUsage;
-import org.wso2.carbon.usage.ui.utils.UsageUtil;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * this class is used to generate reports of all tenant usages
- */
-public class AllTenantUsageReport {
-
-    private TenantUsage[] tenantUsages;
-    private String yearMonth;
-
-    /**
-     * @param config
-     * @param session
-     * @param request
-     * @throws Exception
-     */
-    private static final Log log = LogFactory.getLog(AllTenantUsageReport.class);
-
-    public AllTenantUsageReport(ServletConfig config, HttpSession session, HttpServletRequest request)
-            throws Exception {
-    	tenantUsages = UsageUtil.retrieveTenantUsages(request, config, session);
-     
- 
-        yearMonth = (String) request.getSession().getAttribute("year-month");
-    }
-
-    public List<AllTenantUsageData> getUsageReportData() {
-
-        List<AllTenantUsageData> reportData = new ArrayList<AllTenantUsageData>();   // all the strings need to be passed to
-        //  generate the report are added to this list
-
-        if (yearMonth == null) {
-            //  get the current year month
-            yearMonth = UsageUtil.getCurrentYearMonth();
-        }
-        String currentYearMonth = UsageUtil.getCurrentYearMonth();
-
-        //  add all the usage data to the list
-        try {
-            for (TenantUsage usage : tenantUsages) {
-                AllTenantUsageData usageData = new AllTenantUsageData();
-                usageData.setYearMonth(yearMonth);
-                String currentDataStorage = UsageUtil.getTotalDataStorage(usage);
-                String regBandwidth = UsageUtil.getTotalBandwidth(usage.getTotalRegistryBandwidth());
-                String svcBandwidth = UsageUtil.getTotalBandwidth(usage.getTotalServiceBandwidth());
-                long svcTotalRequest = usage.getTotalRequestStatistics().getRequestCount();
-                int numberOfUsers = usage.getNumberOfUsers();
-
-                //  String username = (String) request.getSession().getAttribute("logged-user");
-                String tenantName = usage.getDomain();
-                int tenantId = usage.getTenantId();
-                String fullReportLink = "any_tenant_usage.jsp?tenant-id=" + tenantId + "&year-month=" + yearMonth;
-
-                usageData.setTenantName(tenantName);
-                if (yearMonth.equals(currentYearMonth)) {
-                    usageData.setNumberOfUsers(Integer.toString(numberOfUsers));
-                    usageData.setCurrentDataStorage(currentDataStorage);
-                }
-                // if the yearMonth is not current, number of users coloumn and storage usage coloumn are empty
-                else {
-                    usageData.setNumberOfUsers("-");
-                    usageData.setCurrentDataStorage("-");
-                }
-                usageData.setRegBandwidth(regBandwidth);
-                usageData.setSvcBandwidth(svcBandwidth);
-                usageData.setSvcTotalRequest(Long.toString(svcTotalRequest));
-                reportData.add(usageData);
-            }
-        }
-        catch (Exception e) {
-            String msg = "Error while retrieving tenant usages for month : " + yearMonth;
-            log.error(msg, e);
-        }
-        return reportData;         // return as an array
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/df3475cc/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/report/UsageReport.java
----------------------------------------------------------------------
diff --git a/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/report/UsageReport.java b/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/report/UsageReport.java
deleted file mode 100644
index 6c0ad50..0000000
--- a/components/stratos/usage/org.wso2.carbon.usage.ui/2.1.0/src/main/java/org/wso2/carbon/usage/ui/report/UsageReport.java
+++ /dev/null
@@ -1,194 +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.usage.ui.report;
-
-import org.wso2.carbon.usage.stub.beans.xsd.BandwidthStatistics;
-import org.wso2.carbon.usage.stub.beans.xsd.RequestStatistics;
-import org.wso2.carbon.usage.stub.beans.xsd.TenantUsage;
-import org.wso2.carbon.usage.ui.utils.UsageUtil;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This class is used to generate tenant usage report
- */
-public class UsageReport {
-    private TenantUsage usage;
-    private String yearMonth;
-
-    public UsageReport(ServletConfig config, HttpSession session, HttpServletRequest request)
-            throws Exception {
-        usage = UsageUtil.retrieveCurrentTenantUsage(request, config, session);
-        yearMonth = (String) request.getSession().getAttribute("year-month");
-
-    }
-
-
-    public List<String> getUsageReportData() {
-
-        int numberOfUsers = usage.getNumberOfUsers();
-        if (yearMonth == null) {
-
-            yearMonth = UsageUtil.getCurrentYearMonth();
-        }
-
-        String tenantName = usage.getDomain();
-        String currentYearMonth = UsageUtil.getCurrentYearMonth();
-        List<String> reportData = new ArrayList<String>();
-        reportData.add("Basic Tenant Details");
-        reportData.add("");
-        reportData.add("Duration");
-        reportData.add("Tenant Name");
-        reportData.add("Number of users");
-        reportData.add("Basic Tenant Details");
-        reportData.add("");
-        reportData.add(yearMonth);
-        reportData.add(tenantName);
-        reportData.add(String.valueOf(numberOfUsers));
-
-
-        if (currentYearMonth.equals(yearMonth)) {
-            reportData.add("Storage Usage");
-            reportData.add("Data Storage");
-            reportData.add("Current Data Storage");
-            reportData.add("Historical Data Storage");
-            reportData.add("Total Data Storage");
-            String totalDataStorage = UsageUtil.getTotalDataStorage(usage);
-            String currentDataStorage = UsageUtil.getCurrentDataStorage(usage);
-            String historyDataStorage = UsageUtil.getHistoryDataStorage(usage);
-            reportData.add("Storage Usage");
-            reportData.add("Registry Content");
-            reportData.add(totalDataStorage);
-            reportData.add(currentDataStorage);
-            reportData.add(historyDataStorage);
-        }
-
-        String totRegInBandwidth = UsageUtil.getIncomingBandwidth(usage.getTotalRegistryBandwidth());
-        String totRegOutBandwidth = UsageUtil.getOutgoingBandwidth(usage.getTotalRegistryBandwidth());
-        String totRegBandwidth = UsageUtil.getTotalBandwidth(usage.getTotalRegistryBandwidth());
-        reportData.add("Registry Bandwidth Usage");
-        reportData.add("Server Name");
-        reportData.add("Incoming Bandwidth");
-        reportData.add("Outgoing Bandwidth");
-        reportData.add("Total Bandwidth");
-        BandwidthStatistics[] regBWStats = usage.getRegistryBandwidthStatistics();
-        if (regBWStats != null) {
-            for (BandwidthStatistics stat : regBWStats) {
-                String regInBandwidth = UsageUtil.getIncomingBandwidth(stat);
-                String regOutBandwidth = UsageUtil.getOutgoingBandwidth(stat);
-                String regBandwidth = UsageUtil.getTotalBandwidth(stat);
-                reportData.add("Server Name****");
-                reportData.add(regInBandwidth);
-                reportData.add(regOutBandwidth);
-                reportData.add(regBandwidth);
-
-            }
-        }
-        reportData.add("Registry Bandwidth Usage");
-        reportData.add("All Server Total");
-        reportData.add(totRegInBandwidth);
-        reportData.add(totRegOutBandwidth);
-        reportData.add(totRegBandwidth);
-
-        String totSvcInBandwidth = UsageUtil.getIncomingBandwidth(usage.getTotalServiceBandwidth());
-        String totSvcOutBandwidth = UsageUtil.getOutgoingBandwidth(usage.getTotalServiceBandwidth());
-        String totSvcBandwidth = UsageUtil.getTotalBandwidth(usage.getTotalServiceBandwidth());
-        reportData.add("Service Bandwidth Usage");
-        reportData.add("Server Name");
-        reportData.add("Incoming Bandwidth");
-        reportData.add("Outgoing Bandwidth");
-        reportData.add("Total Bandwidth");
-        BandwidthStatistics[] svcBWStats = usage.getServiceBandwidthStatistics();
-        if (svcBWStats != null) {
-            for (BandwidthStatistics stat : svcBWStats) {
-                String svcInBandwidth = UsageUtil.getIncomingBandwidth(stat);
-                String svcOutBandwidth = UsageUtil.getOutgoingBandwidth(stat);
-                String svcBandwidth = UsageUtil.getTotalBandwidth(stat);
-                reportData.add("Server Name****");
-                reportData.add(svcInBandwidth);
-                reportData.add(svcOutBandwidth);
-                reportData.add(svcBandwidth);
-
-            }
-        }
-        reportData.add("Service Bandwidth Usage");
-        reportData.add("All Server Total");
-        reportData.add(totSvcInBandwidth);
-        reportData.add(totSvcOutBandwidth);
-        reportData.add(totSvcBandwidth);
-
-        String totWebappInBandwidth = UsageUtil.getIncomingBandwidth(usage.getTotalWebappBandwidth());
-        String totWebappOutBandwidth = UsageUtil.getOutgoingBandwidth(usage.getTotalWebappBandwidth());
-        String totWebappBandwidth = UsageUtil.getTotalBandwidth(usage.getTotalWebappBandwidth());
-        BandwidthStatistics[] webappBWStats = usage.getWebappBandwidthStatistics();
-        reportData.add("Webapp Bandwidth Usage");
-        reportData.add("Server Name");
-        reportData.add("Incoming Bandwidth");
-        reportData.add("Outgoing Bandwidth");
-        reportData.add("Total Bandwidth");
-        if (webappBWStats != null) {
-            for (BandwidthStatistics stat : webappBWStats) {
-                String webappInBandwidth = UsageUtil.getIncomingBandwidth(stat);
-                String webappOutBandwidth = UsageUtil.getOutgoingBandwidth(stat);
-                String webappBandwidth = UsageUtil.getTotalBandwidth(stat);
-                reportData.add("Server Name****");
-                reportData.add(webappInBandwidth);
-                reportData.add(webappOutBandwidth);
-                reportData.add(webappBandwidth);
-            }
-        }
-        reportData.add("Webapp Bandwidth Usage");
-        reportData.add("All Server Total");
-        reportData.add(totWebappInBandwidth);
-        reportData.add(totWebappOutBandwidth);
-        reportData.add(totWebappBandwidth);
-
-
-        long totSvcReqCount = usage.getTotalRequestStatistics().getRequestCount();
-        long totSvcRespCount = usage.getTotalRequestStatistics().getResponseCount();
-        long totSvcFaultCount = usage.getTotalRequestStatistics().getFaultCount();
-        RequestStatistics[] svcStats = usage.getRequestStatistics();
-        reportData.add("Service Usage Statistic");
-        reportData.add("Server Name");
-        reportData.add("Request Count");
-        reportData.add("Response Count");
-        reportData.add("Fault Count");
-        if (svcStats != null && svcStats.length>0 && svcStats[0]!=null) {
-            for (RequestStatistics stat : svcStats) {
-                long svcReqCount = stat.getRequestCount();
-                long svcResCount = stat.getResponseCount();
-                long svcFaultCount = stat.getFaultCount();
-                reportData.add("Server Name****");
-                reportData.add(String.valueOf(svcReqCount));
-                reportData.add(String.valueOf(svcResCount));
-                reportData.add(String.valueOf(svcFaultCount));
-            }
-        }
-        reportData.add("Service Usage Statistic");
-        reportData.add("All Server Total");
-        reportData.add(String.valueOf(totSvcReqCount));
-        reportData.add(String.valueOf(totSvcRespCount));
-        reportData.add(String.valueOf(totSvcFaultCount));
-
-        return reportData;
-    }
-}