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/12 09:52:54 UTC

[01/18] applying 0001-Refactor-throttling-module.patch

Updated Branches:
  refs/heads/master f261dc212 -> d3514c6be


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/throttling.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/throttling.jsp b/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/throttling.jsp
deleted file mode 100644
index 1493a59..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/throttling.jsp
+++ /dev/null
@@ -1,103 +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="org.wso2.carbon.CarbonConstants"%>
-<%@ page
-	import="org.wso2.carbon.throttling.ui.clients.ThrottlingRuleEditorClient"%>
-<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
-<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar"
-	prefix="carbon"%>
-
-<carbon:jsi18n
-	resourceBundle="org.wso2.carbon.throttling.ui.i18n.JSResources"
-	request="<%=request%>" />
-
-
-
-<fmt:bundle basename="org.wso2.carbon.throttling.ui.i18n.Resources">
-	<carbon:breadcrumb label="tenant.menu"
-		resourceBundle="org.wso2.carbon.throttling.ui.i18n.Resources"
-		topPage="true" request="<%=request%>" />
-	<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/register_config.js"></script>
-	<%
-	String error = request.getParameter("error");
-	if ("true".equals(error)) {
-%>
-    <script type="text/javascript">
-        jQuery(document).ready(function() {
-            CARBON.showErrorDialog('Error in updating the rules. ' +
-                    'Please make sure the syntax of the rules are correct.');
-        });
-    </script>
-
-<%	    
-	} else if("false".equals(error)) {
-	    %>
-	    <script type="text/javascript">
-	        jQuery(document).ready(function() {
-	            CARBON.showInfoDialog('The rules are updated successfully.');
-	        });
-	    </script>
-
-	<%	 	    
-	}
-	%>
-	<%
-	    String ruleContent;
-	        try {
-	            ThrottlingRuleEditorClient client =
-	                    new ThrottlingRuleEditorClient(config, session);
-	            ruleContent = client.retrieveThrottlingRules();
-	        } catch (Exception e) {
-	            String error1 = e.getMessage();
-	            request.setAttribute(CarbonUIMessage.ID, new CarbonUIMessage(error1, error1, null));
-	 %>
-                <jsp:include page="../admin/error.jsp"/>
-     <%
-	    return;
-	        }
-	%>
-
-	<div id="middle">
-
-	<h2><fmt:message key="throttling.rules" /></h2>
-
-	<div id="workArea">
-
-	<form id="throttlingForm" action="throttling_ajaxprocessor.jsp" method="post">
-
-	<div>
-	<textarea rows="25" cols="110" name="content" id="content"><%=ruleContent%></textarea>
-	</div>
-
-	<div>
-	<input type="submit" value="Update"/>
-	</div>
-	</form>
-	</div>
-	</div>
-</fmt:bundle>
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/throttling_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/throttling_ajaxprocessor.jsp b/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/throttling_ajaxprocessor.jsp
deleted file mode 100644
index bf29d41..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/throttling_ajaxprocessor.jsp
+++ /dev/null
@@ -1,29 +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="org.wso2.carbon.throttling.ui.clients.ThrottlingRuleEditorClient" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%
-try {
-	ThrottlingRuleEditorClient client = new ThrottlingRuleEditorClient(config, session);
-	client.updateThrottlingRules(request.getParameter("content"));
-} catch (Exception e) {
-	response.sendRedirect("../mt-throttling/throttling.jsp?error=true");
-    return;
-}
-response.sendRedirect("../mt-throttling/throttling.jsp?error=false");
-%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/pom.xml b/components/stratos/throttling/pom.xml
deleted file mode 100644
index 0df25ab..0000000
--- a/components/stratos/throttling/pom.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (c) 2009-2010, 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>stratos-components</artifactId>
-        <version>2.1.0</version>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>throttling-parent</artifactId>
-    <packaging>pom</packaging>
-    <name>WSO2 Stratos - Throttling Parent Module</name>
-    <description>WSO2 Stratos Throttling Parent Module</description>
-    <url>http://wso2.org</url>
-
-    <modules>
-        <module>org.wso2.carbon.throttling.agent/2.1.0</module>
-        <module>org.wso2.carbon.throttling.manager/2.1.0</module>
-        <module>org.wso2.carbon.throttling.ui/2.1.0</module>
-    </modules>
-
-</project>
-


[18/18] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos

Posted by la...@apache.org.
	Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos


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

Branch: refs/heads/master
Commit: d3514c6be37577305844d3c16b1468e08da4ba63
Parents: 767082e f261dc2
Author: Lakmal Warusawithana <la...@wso2.com>
Authored: Fri Jul 12 13:22:20 2013 +0530
Committer: Lakmal Warusawithana <la...@wso2.com>
Committed: Fri Jul 12 13:22:20 2013 +0530

----------------------------------------------------------------------
 .../org.apache.stratos.account.mgt.ui/pom.xml   |  97 +++
 .../mgt/ui/clients/AccountMgtClient.java        | 178 ++++++
 .../mgt/ui/clients/EmailValidationClient.java   |  97 +++
 .../ui/clients/PackageInfoServiceClient.java    |  99 +++
 .../account/mgt/ui/clients/UsagePlanClient.java | 106 ++++
 .../stratos/account/mgt/ui/utils/Util.java      | 119 ++++
 .../src/main/resources/AccountMgtService.wsdl   | 628 +++++++++++++++++++
 .../main/resources/EmailValidationService.wsdl  |  95 +++
 .../src/main/resources/META-INF/component.xml   |  36 ++
 .../account/mgt/ui/i18n/JSResources.properties  |   5 +
 .../account/mgt/ui/i18n/Resources.properties    |  24 +
 .../resources/web/account-mgt/account_mgt.jsp   | 527 ++++++++++++++++
 .../web/account-mgt/css/account_mgt.css         |  15 +
 .../web/account-mgt/css/update_profile.css      |  29 +
 .../deactivate_account_ajaxprocessor.jsp        |  39 ++
 .../web/account-mgt/docs/aboutUsagePlans.html   | 104 +++
 .../web/account-mgt/docs/images/account-mgt.png | Bin 0 -> 39610 bytes
 .../web/account-mgt/docs/userguide.html         |  44 ++
 .../get_package_info_ajaxprocessor.jsp          |  39 ++
 .../web/account-mgt/images/account-mgt-icon.gif | Bin 0 -> 1041 bytes
 .../web/account-mgt/images/ajax-loader.gif      | Bin 0 -> 673 bytes
 .../resources/web/account-mgt/images/right.gif  | Bin 0 -> 924 bytes
 .../resources/web/account-mgt/images/wrong.gif  | Bin 0 -> 976 bytes
 .../account-mgt/init_payment_ajaxprocessor.jsp  |  99 +++
 .../resources/web/account-mgt/js/account_mgt.js | 214 +++++++
 .../update_contact_ajaxprocessor.jsp            |  35 ++
 .../account-mgt/update_profile_processor.jsp    |  62 ++
 .../web/account-mgt/update_verifier.jsp         |  56 ++
 ...update_verifier_redirector_ajaxprocessor.jsp |  30 +
 .../validate_domain_ajaxprocessor.jsp           |  29 +
 .../validation_success_ajaxprocessor.jsp        |  49 ++
 .../org.apache.stratos.account.mgt/pom.xml      |  93 +++
 .../account/mgt/beans/AccountInfoBean.java      |  40 ++
 .../internal/AccountMgtServiceComponent.java    | 140 +++++
 .../account/mgt/services/AccountMgtService.java | 417 ++++++++++++
 .../mgt/services/EmailValidationService.java    | 156 +++++
 .../apache/stratos/account/mgt/util/Util.java   | 174 +++++
 .../src/main/resources/META-INF/component.xml   |  29 +
 .../src/main/resources/META-INF/services.xml    |  80 +++
 components/pom.xml                              |   1 +
 .../2.1.0/pom.xml                               |  89 ---
 .../mgt/ui/clients/AccountMgtClient.java        | 176 ------
 .../mgt/ui/clients/EmailValidationClient.java   |  95 ---
 .../ui/clients/PackageInfoServiceClient.java    |  97 ---
 .../account/mgt/ui/clients/UsagePlanClient.java | 104 ---
 .../wso2/carbon/account/mgt/ui/utils/Util.java  | 117 ----
 .../src/main/resources/AccountMgtService.wsdl   | 628 -------------------
 .../main/resources/EmailValidationService.wsdl  |  95 ---
 .../src/main/resources/META-INF/component.xml   |  35 --
 .../account/mgt/ui/i18n/JSResources.properties  |   5 -
 .../account/mgt/ui/i18n/Resources.properties    |  24 -
 .../resources/web/account-mgt/account_mgt.jsp   | 526 ----------------
 .../web/account-mgt/css/account_mgt.css         |  15 -
 .../web/account-mgt/css/update_profile.css      |  29 -
 .../deactivate_account_ajaxprocessor.jsp        |  38 --
 .../web/account-mgt/docs/aboutUsagePlans.html   | 104 ---
 .../web/account-mgt/docs/images/account-mgt.png | Bin 39610 -> 0 bytes
 .../web/account-mgt/docs/userguide.html         |  44 --
 .../get_package_info_ajaxprocessor.jsp          |  39 --
 .../web/account-mgt/images/account-mgt-icon.gif | Bin 1041 -> 0 bytes
 .../web/account-mgt/images/ajax-loader.gif      | Bin 673 -> 0 bytes
 .../resources/web/account-mgt/images/right.gif  | Bin 924 -> 0 bytes
 .../resources/web/account-mgt/images/wrong.gif  | Bin 976 -> 0 bytes
 .../account-mgt/init_payment_ajaxprocessor.jsp  |  99 ---
 .../resources/web/account-mgt/js/account_mgt.js | 214 -------
 .../update_contact_ajaxprocessor.jsp            |  35 --
 .../account-mgt/update_profile_processor.jsp    |  62 --
 .../web/account-mgt/update_verifier.jsp         |  56 --
 ...update_verifier_redirector_ajaxprocessor.jsp |  30 -
 .../validate_domain_ajaxprocessor.jsp           |  29 -
 .../validation_success_ajaxprocessor.jsp        |  49 --
 .../2.1.0/pom.xml                               |  87 ---
 .../account/mgt/beans/AccountInfoBean.java      |  40 --
 .../internal/AccountMgtServiceComponent.java    | 139 ----
 .../account/mgt/services/AccountMgtService.java | 416 ------------
 .../mgt/services/EmailValidationService.java    | 153 -----
 .../apache/stratos/account/mgt/util/Util.java   | 173 -----
 .../src/main/resources/META-INF/component.xml   |  29 -
 .../src/main/resources/META-INF/services.xml    |  80 ---
 79 files changed, 3985 insertions(+), 3951 deletions(-)
----------------------------------------------------------------------



[09/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/throttling.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/throttling.jsp b/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/throttling.jsp
new file mode 100644
index 0000000..e2360b9
--- /dev/null
+++ b/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/throttling.jsp
@@ -0,0 +1,104 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<%@ page import="org.wso2.carbon.CarbonConstants"%>
+<%@ page
+	import="org.apache.stratos.throttling.ui.clients.ThrottlingRuleEditorClient"%>
+<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar"
+	prefix="carbon"%>
+
+<carbon:jsi18n
+	resourceBundle="org.apache.stratos.throttling.ui.i18n.JSResources"
+	request="<%=request%>" />
+
+
+
+<fmt:bundle basename="org.apache.stratos.throttling.ui.i18n.Resources">
+	<carbon:breadcrumb label="tenant.menu"
+		resourceBundle="org.apache.stratos.throttling.ui.i18n.Resources"
+		topPage="true" request="<%=request%>" />
+	<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/register_config.js"></script>
+	<%
+	String error = request.getParameter("error");
+	if ("true".equals(error)) {
+%>
+    <script type="text/javascript">
+        jQuery(document).ready(function() {
+            CARBON.showErrorDialog('Error in updating the rules. ' +
+                    'Please make sure the syntax of the rules are correct.');
+        });
+    </script>
+
+<%	    
+	} else if("false".equals(error)) {
+	    %>
+	    <script type="text/javascript">
+	        jQuery(document).ready(function() {
+	            CARBON.showInfoDialog('The rules are updated successfully.');
+	        });
+	    </script>
+
+	<%	 	    
+	}
+	%>
+	<%
+	    String ruleContent;
+	        try {
+	            ThrottlingRuleEditorClient client =
+	                    new ThrottlingRuleEditorClient(config, session);
+	            ruleContent = client.retrieveThrottlingRules();
+	        } catch (Exception e) {
+	            String error1 = e.getMessage();
+	            request.setAttribute(CarbonUIMessage.ID, new CarbonUIMessage(error1, error1, null));
+	 %>
+                <jsp:include page="../admin/error.jsp"/>
+     <%
+	    return;
+	        }
+	%>
+
+	<div id="middle">
+
+	<h2><fmt:message key="throttling.rules" /></h2>
+
+	<div id="workArea">
+
+	<form id="throttlingForm" action="throttling_ajaxprocessor.jsp" method="post">
+
+	<div>
+	<textarea rows="25" cols="110" name="content" id="content"><%=ruleContent%></textarea>
+	</div>
+
+	<div>
+	<input type="submit" value="Update"/>
+	</div>
+	</form>
+	</div>
+	</div>
+</fmt:bundle>
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/throttling_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/throttling_ajaxprocessor.jsp b/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/throttling_ajaxprocessor.jsp
new file mode 100644
index 0000000..8f4e533
--- /dev/null
+++ b/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/throttling_ajaxprocessor.jsp
@@ -0,0 +1,30 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<%@ page import="org.apache.stratos.throttling.ui.clients.ThrottlingRuleEditorClient" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+try {
+	ThrottlingRuleEditorClient client = new ThrottlingRuleEditorClient(config, session);
+	client.updateThrottlingRules(request.getParameter("content"));
+} catch (Exception e) {
+	response.sendRedirect("../mt-throttling/throttling.jsp?error=true");
+    return;
+}
+response.sendRedirect("../mt-throttling/throttling.jsp?error=false");
+%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/pom.xml b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/pom.xml
deleted file mode 100644
index 86ecd04..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/pom.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-<!--
-# Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-  -->
-<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>throttling-parent</artifactId>
-        <version>2.1.0</version>
-	<relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.wso2.carbon.throttling.agent</artifactId>
-    <version>2.1.0</version>
-    <packaging>bundle</packaging>
-    <name>WSO2 Stratos - Throttling Agent</name>
-
-    <build>
-
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-                        <Bundle-Name>${project.artifactId}</Bundle-Name>
-                        <Axis2Module>${project.artifactId}-${project.version}</Axis2Module>
-                        <ListenerManager-RequiredServices>
-                            org.wso2.carbon.throttling.agent.ThrottlingAgent
-                        </ListenerManager-RequiredServices>
-                        <Export-Package>
-                            org.wso2.carbon.throttling.agent.client,
-                            org.wso2.carbon.throttling.agent.*,
-                        </Export-Package>
-                        <Private-Package>
-                            !org.wso2.carbon.throttling.agent.client,
-                            org.wso2.carbon.throttling.agent.*,
-                        </Private-Package>
-                        <Import-Package>
-                            org.wso2.carbon.throttling.agent.stub.*;
-                            version="${carbon.platform.package.import.version.range}",
-                            org.wso2.carbon.stratos.common.*,
-                            org.wso2.carbon.server.*,
-                            org.wso2.carbon.registry.core.*;version=1.0.1,
-                            org.wso2.carbon.registry.resource.*,
-                            !javax.xml.namespace,
-                            javax.xml.namespace; version=0.0.0,
-                            javax.servlet;version="${imp.pkg.version.javax.servlet}",
-                            javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
-                            org.apache.axiom.*; version="${axiom.osgi.version.range}",
-                            *;resolution:=optional
-                        </Import-Package>
-                        <DynamicImport-Package>*</DynamicImport-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.apache.axis2.wso2</groupId>
-            <artifactId>axis2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.utils</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.core</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.extensions</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.resource</artifactId>
-            <version>${carbon.platform.version}</version>
-        </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.throttling.agent.stub</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.server</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.tomcat.ext</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/ThrottlingAgent.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/ThrottlingAgent.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/ThrottlingAgent.java
deleted file mode 100644
index 7f2fbe3..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/ThrottlingAgent.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Copyright (c) 2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.wso2.carbon.throttling.agent;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.osgi.framework.BundleContext;
-import org.osgi.util.tracker.ServiceTracker;
-import org.wso2.carbon.base.ServerConfiguration;
-import org.wso2.carbon.context.CarbonContext;
-import org.wso2.carbon.context.RegistryType;
-import org.wso2.carbon.registry.core.RegistryConstants;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.config.RegistryContext;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.registry.core.service.RegistryService;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.stratos.common.util.MeteringAccessValidationUtils;
-import org.wso2.carbon.stratos.common.util.StratosConfiguration;
-import org.wso2.carbon.throttling.agent.cache.TenantThrottlingInfo;
-import org.wso2.carbon.throttling.agent.cache.ThrottlingActionInfo;
-import org.wso2.carbon.throttling.agent.cache.ThrottlingInfoCache;
-import org.wso2.carbon.throttling.agent.cache.ThrottlingInfoCacheUpdaterTask;
-import org.wso2.carbon.throttling.agent.client.MultitenancyThrottlingServiceClient;
-import org.wso2.carbon.throttling.agent.client.ThrottlingRuleInvoker;
-import org.wso2.carbon.throttling.agent.conf.ThrottlingAgentConfiguration;
-import org.wso2.carbon.throttling.agent.listeners.PerRegistryRequestListener;
-import org.wso2.carbon.throttling.agent.listeners.PerUserAddListener;
-import org.wso2.carbon.user.core.listener.UserStoreManagerListener;
-import org.wso2.carbon.user.core.service.RealmService;
-import org.wso2.carbon.utils.CarbonUtils;
-import org.wso2.carbon.utils.ConfigurationContextService;
-
-import java.io.File;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-
-public class ThrottlingAgent {
-    private static final Log log = LogFactory.getLog(ThrottlingAgent.class);
-
-    private static final String CONFIG_FILE = "throttling-agent-config.xml";
-    private static final String MANAGER_SERVER_URL_PARAM_NAME = "managerServiceUrl";
-    private static final String USERNAME_PARAM_NAME = "userName";
-    private static final String PASSWORD_PARAM_NAME = "password";
-
-    private ThrottlingAgentConfiguration configuration;
-
-    private RegistryService registryService;
-
-    private RealmService realmService;
-
-    private ConfigurationContextService configurationContextService;
-
-    private ThrottlingInfoCache throttlingInfoCache;
-
-    private ServiceTracker throttlingRuleInvokerTracker = null;
-
-    private ScheduledExecutorService scheduler;
-
-    private BundleContext bundleContext;
-    private StratosConfiguration stratosConfiguration=null;
-
-    public StratosConfiguration getStratosConfiguration() {
-        return stratosConfiguration;
-    }
-
-    public void setStratosConfiguration(StratosConfiguration stratosConfiguration) {
-        this.stratosConfiguration = stratosConfiguration;
-    }
-
-    public ThrottlingAgent(BundleContext bundleContext) throws Exception {
-        this.scheduler = Executors.newScheduledThreadPool(1, new ThrottlingAgentThreadFactory());
-        this.throttlingInfoCache = new ThrottlingInfoCache();
-        this.bundleContext = bundleContext;
-    }
-
-    public void init() throws RegistryException {
-
-        if("true".equals(ServerConfiguration.getInstance().getFirstProperty("EnableMetering"))){
-
-            UserRegistry superTenantGovernanceRegistry = registryService.getGovernanceSystemRegistry();
-
-            scheduler.scheduleAtFixedRate(
-                    new ThrottlingInfoCacheUpdaterTask(throttlingInfoCache, superTenantGovernanceRegistry), 2, 15,
-                    TimeUnit.MINUTES);
-
-            PerRegistryRequestListener.registerPerRegistryRequestListener(RegistryContext.getBaseInstance());
-            if (bundleContext != null) {
-                bundleContext.registerService(UserStoreManagerListener.class.getName(),
-                        new PerUserAddListener(), null);
-            }
-
-        }
-        throttlingRuleInvokerTracker = new ServiceTracker(bundleContext, ThrottlingRuleInvoker.class.getName(),
-                null);
-        throttlingRuleInvokerTracker.open();
-    }
-
-    public ThrottlingInfoCache getThrottlingInfoCache() {
-        return throttlingInfoCache;
-    }
-
-    public void setRegistryService(RegistryService registryService) {
-        this.registryService = registryService;
-    }
-
-    public RegistryService getRegistryService(){
-        return this.registryService;
-    }
-
-    public void setRealmService(RealmService realmService) {
-        this.realmService = realmService;
-    }
-
-    public RealmService getRealmService() {
-        return realmService;
-    }
-
-    public void setConfigurationContextService(ConfigurationContextService configurationContextService) {
-        this.configurationContextService = configurationContextService;
-    }
-
-    public ConfigurationContextService getConfigurationContextService() {
-        return configurationContextService;
-    }
-
-    public void updateThrottlingCacheForTenant() throws Exception {
-        // TODO: Need to refactor this and updater task
-
-        int tenantId = CarbonContext.getCurrentContext().getTenantId();
-
-        String tenantValidationInfoResourcePath =
-                StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
-                        RegistryConstants.PATH_SEPARATOR + tenantId;
-        try {
-            if (registryService.getGovernanceSystemRegistry().resourceExists(tenantValidationInfoResourcePath)) {
-                Resource tenantValidationInfoResource =
-                        registryService.getGovernanceSystemRegistry().get(tenantValidationInfoResourcePath);
-                Properties properties = tenantValidationInfoResource.getProperties();
-                Set<String> actions = MeteringAccessValidationUtils.getAvailableActions(properties);
-                for (String action : actions) {
-                    String blocked =
-                            tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
-                                    .generateIsBlockedPropertyKey(action));
-
-                    String blockMessage =
-                            tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
-                                    .generateErrorMsgPropertyKey(action));
-                    TenantThrottlingInfo tenantThrottlingInfo = throttlingInfoCache.getTenantThrottlingInfo(tenantId);
-                    if (tenantThrottlingInfo == null) {
-                        throttlingInfoCache.addTenant(tenantId);
-                        tenantThrottlingInfo = throttlingInfoCache.getTenantThrottlingInfo(tenantId);
-                    }
-                    tenantThrottlingInfo.updateThrottlingActionInfo(action,
-                            new ThrottlingActionInfo("true".equals(blocked), blockMessage));
-                }
-            }
-        } catch (RegistryException re) {
-            String msg =
-                    "Error while getting throttling info for tenant " + tenantId + ".";
-            log.error(msg, re);
-        }
-    }
-
-    private ThrottlingAgentConfiguration loadThrottlingConfiguration() throws Exception {
-        // it is acceptable that throttling agent file is not present, when the
-        // embedded rule invoker is in use.
-        ThrottlingAgentConfiguration throttlingAgentConfig = null;
-        String configFileName = CarbonUtils.getCarbonConfigDirPath() + File.separator +
-                StratosConstants.MULTITENANCY_CONFIG_FOLDER + File.separator + CONFIG_FILE;
-        if (new File(configFileName).exists()) {
-            throttlingAgentConfig = new ThrottlingAgentConfiguration(configFileName);
-        } else {
-            log.warn("Throttling agent config file is not present. File name: " + configFileName + ".");
-        }
-
-        return throttlingAgentConfig;
-    }
-
-    public ThrottlingRuleInvoker getThrottlingRuleInvoker() throws Exception {
-        // first check the OSGi service exists, if so return it
-        ThrottlingRuleInvoker embeddedRuleInvoker =
-                (ThrottlingRuleInvoker) throttlingRuleInvokerTracker.getService();
-        if (embeddedRuleInvoker != null) {
-            return embeddedRuleInvoker;
-        }
-
-
-        if (stratosConfiguration == null) {
-            String msg =
-                    "Neither embedded nor web service implementation of throttling rule invoker found.";
-            log.error(msg);
-            throw new Exception(msg);
-        }
-        String serverUrl = stratosConfiguration.getManagerServiceUrl();
-        String userName =stratosConfiguration.getAdminUserName() ;
-        String password = stratosConfiguration.getAdminPassword();
-
-        return new MultitenancyThrottlingServiceClient(serverUrl, userName, password);
-    }
-
-    public void executeManagerThrottlingRules(int tenantId) throws Exception {
-        ThrottlingRuleInvoker client = getThrottlingRuleInvoker();
-        client.executeThrottlingRules(tenantId);
-    }
-
-
-    class ThrottlingAgentThreadFactory implements ThreadFactory {
-        private int counter = 0;
-
-        public Thread newThread(Runnable r) {
-            return new Thread(r, "ThrottlingAgentThreadFactory-" + counter++);
-        }
-    }
-
-    public void executeThrottlingRules(int tenantId) {
-        try {
-            executeManagerThrottlingRules(tenantId);
-            updateThrottlingCacheForTenant();
-        } catch (Exception e) {
-            log.error("Error in executing throttling rules");
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/Axis2ConfigurationContextObserverImpl.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/Axis2ConfigurationContextObserverImpl.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/Axis2ConfigurationContextObserverImpl.java
deleted file mode 100644
index 7fb497b..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/Axis2ConfigurationContextObserverImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.wso2.carbon.throttling.agent.cache;
-
-import org.apache.axis2.context.ConfigurationContext;
-import org.wso2.carbon.utils.AbstractAxis2ConfigurationContextObserver;
-import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
-
-/**
- * Axis configuration context observer which add and remove lazy loaded/unloaded tenants to throttling information
- * cache.
- */
-public class Axis2ConfigurationContextObserverImpl extends AbstractAxis2ConfigurationContextObserver{
-
-    private ThrottlingInfoCache throttlingInfoCache;
-
-    public Axis2ConfigurationContextObserverImpl(ThrottlingInfoCache throttlingInfoCache){
-        this.throttlingInfoCache = throttlingInfoCache;
-    }
-
-    public void createdConfigurationContext(ConfigurationContext configContext) {
-        throttlingInfoCache.addTenant(MultitenantUtils.getTenantId(configContext));
-    }
-
-    public void terminatedConfigurationContext(ConfigurationContext configCtx) {
-        throttlingInfoCache.deleteTenant(MultitenantUtils.getTenantId(configCtx));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/TenantThrottlingInfo.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/TenantThrottlingInfo.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/TenantThrottlingInfo.java
deleted file mode 100644
index a80a2da..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/TenantThrottlingInfo.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.wso2.carbon.throttling.agent.cache;
-
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class TenantThrottlingInfo {
-    private Map<String, ThrottlingActionInfo> throttlingActionInfoMap = new HashMap<String, ThrottlingActionInfo>();
-
-    public ThrottlingActionInfo getThrottlingActionInfo(String action) {
-        if(throttlingActionInfoMap.get(action) != null){
-            return throttlingActionInfoMap.get(action);
-        }
-        return new ThrottlingActionInfo(false, "");
-    }
-
-    public ThrottlingActionInfo getThrottlingActionInfo(String[] actions) {
-        ThrottlingActionInfo actionInfo = throttlingActionInfoMap.get(StratosConstants.THROTTLING_ALL_ACTION);
-        if (actionInfo != null && actionInfo.isBlocked()) {
-            return actionInfo;
-        }
-
-        for (String action : actions) {
-            actionInfo = throttlingActionInfoMap.get(action);
-            if (actionInfo != null && actionInfo.isBlocked()) {
-                return actionInfo;
-            }
-        }
-
-        return new ThrottlingActionInfo(false, "");
-    }
-
-    public void updateThrottlingActionInfo(String action, ThrottlingActionInfo throttlingActionInfo) {
-        throttlingActionInfoMap.put(action, throttlingActionInfo);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingActionInfo.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingActionInfo.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingActionInfo.java
deleted file mode 100644
index cf229d4..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingActionInfo.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.wso2.carbon.throttling.agent.cache;
-
-public class ThrottlingActionInfo {
-    private boolean blocked = false;
-
-    private String message = "";
-
-    public ThrottlingActionInfo(boolean blocked, String message) {
-        this.blocked = blocked;
-        this.message = message;
-    }
-
-    public boolean isBlocked() {
-        return blocked;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingInfoCache.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingInfoCache.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingInfoCache.java
deleted file mode 100644
index e733fc3..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingInfoCache.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.wso2.carbon.throttling.agent.cache;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.registry.api.RegistryService;
-import org.wso2.carbon.registry.core.RegistryConstants;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.stratos.common.util.MeteringAccessValidationUtils;
-import org.wso2.carbon.throttling.agent.internal.ThrottlingAgentServiceComponent;
-
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * In memory cache which keeps throttling information for active tenants(local to a server instance). Cache is updated
- * periodically using information retrieved from registry.
- */
-public class ThrottlingInfoCache {
-
-    private static final Log log = LogFactory.getLog(ThrottlingInfoCache.class);
-
-    private Map<Integer, TenantThrottlingInfo> tenantThrottlingInfoMap =
-            new ConcurrentHashMap<Integer, TenantThrottlingInfo>();
-
-    public void addTenant(int tenantId){
-        if(!tenantThrottlingInfoMap.containsKey(tenantId)){
-            tenantThrottlingInfoMap.put(tenantId, getTenantThrottlingInfoFromRegistry(tenantId));
-        }
-    }
-
-    public void deleteTenant(int tenantId){
-        tenantThrottlingInfoMap.remove(tenantId);
-    }
-
-    public Set<Integer> getActiveTenants(){
-        return tenantThrottlingInfoMap.keySet();
-    }
-
-    public void updateThrottlingActionInfo(int tenantId, String action, ThrottlingActionInfo throttlingActionInfo){
-        // throttlingInfo could never be null if the update and lazy loading logic are correct.
-        TenantThrottlingInfo throttlingInfo = tenantThrottlingInfoMap.get(tenantId);
-        throttlingInfo.updateThrottlingActionInfo(action, throttlingActionInfo);
-    }
-
-    public ThrottlingActionInfo getThrottlingActionInfo(int tenantId, String action){
-        if(tenantThrottlingInfoMap.get(tenantId) != null){
-            return tenantThrottlingInfoMap.get(tenantId).getThrottlingActionInfo(action);
-        }
-
-        // This could happen if user has never perform this action before or throttling info cache updating task
-        // has not executed for this tenant. TODO: Check the validity
-        return null;
-    }
-
-    public TenantThrottlingInfo getTenantThrottlingInfo(int tenantId){
-        if(!tenantThrottlingInfoMap.containsKey(tenantId)){
-            tenantThrottlingInfoMap.put(tenantId, getTenantThrottlingInfoFromRegistry(tenantId));
-        }
-        return tenantThrottlingInfoMap.get(tenantId);
-    }
-
-    private TenantThrottlingInfo getTenantThrottlingInfoFromRegistry (int tenantId) {
-        log.info("Tenant throttling info is not in the cache. Hence, getting it from registry");
-        RegistryService registryService = ThrottlingAgentServiceComponent.getThrottlingAgent().
-                                            getRegistryService();
-        TenantThrottlingInfo tenantThrottlingInfo = new TenantThrottlingInfo();
-        try{
-            UserRegistry superTenantGovernanceRegistry = (UserRegistry)registryService.getGovernanceSystemRegistry();
-            String tenantValidationInfoResourcePath =
-                    StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
-                            RegistryConstants.PATH_SEPARATOR + tenantId;
-
-            if (superTenantGovernanceRegistry.resourceExists(tenantValidationInfoResourcePath)) {
-                Resource tenantValidationInfoResource =
-                        superTenantGovernanceRegistry.get(tenantValidationInfoResourcePath);
-                Properties properties = tenantValidationInfoResource.getProperties();
-                Set<String> actions = MeteringAccessValidationUtils.getAvailableActions(properties);
-                for (String action : actions) {
-                    String blocked =
-                            tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
-                                    .generateIsBlockedPropertyKey(action));
-
-                    String blockMessage =
-                            tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
-                                    .generateErrorMsgPropertyKey(action));
-
-                    tenantThrottlingInfo.updateThrottlingActionInfo(action,
-                            new ThrottlingActionInfo("true".equals(blocked), blockMessage));
-                }
-            }
-        } catch (Exception e){
-            log.error("Error occurred while obtaining governance system registry from registry service", e);
-        }
-
-        return tenantThrottlingInfo;
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingInfoCacheUpdaterTask.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingInfoCacheUpdaterTask.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingInfoCacheUpdaterTask.java
deleted file mode 100644
index a2acc5e..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingInfoCacheUpdaterTask.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.wso2.carbon.throttling.agent.cache;
-
-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.MeteringAccessValidationUtils;
-import org.wso2.carbon.registry.core.RegistryConstants;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-
-import java.util.Properties;
-import java.util.Set;
-
-public class ThrottlingInfoCacheUpdaterTask implements Runnable {
-    private static final Log log = LogFactory.getLog(ThrottlingInfoCacheUpdaterTask.class);
-
-    private ThrottlingInfoCache cache;
-    private UserRegistry governanceSystemRegistry;
-
-    public ThrottlingInfoCacheUpdaterTask(ThrottlingInfoCache cache, UserRegistry governanceSystemRegistry) {
-        this.cache = cache;
-        this.governanceSystemRegistry = governanceSystemRegistry;
-    }
-
-    public void run() {
-        log.info("Running throttling info cache updater task");
-        Set<Integer> activeTenants = cache.getActiveTenants();
-        for (Integer tenant : activeTenants) {
-            String tenantValidationInfoResourcePath =
-                    StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
-                            RegistryConstants.PATH_SEPARATOR + tenant;
-            try {
-                if (governanceSystemRegistry.resourceExists(tenantValidationInfoResourcePath)) {
-                    Resource tenantValidationInfoResource =
-                            governanceSystemRegistry.get(tenantValidationInfoResourcePath);
-                    Properties properties = tenantValidationInfoResource.getProperties();
-                    Set<String> actions = MeteringAccessValidationUtils.getAvailableActions(properties);
-                    for (String action : actions) {
-                        String blocked =
-                                tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
-                                        .generateIsBlockedPropertyKey(action));
-                        if(log.isDebugEnabled()){
-                            log.debug("Action: " + action + " blocked: " + blocked + " tenant: " + tenant);
-                        }
-
-                        String blockMessage =
-                                tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
-                                        .generateErrorMsgPropertyKey(action));
-                        TenantThrottlingInfo tenantThrottlingInfo = cache.getTenantThrottlingInfo(tenant);
-
-                        tenantThrottlingInfo.updateThrottlingActionInfo(action,
-                                new ThrottlingActionInfo("true".equals(blocked), blockMessage));
-                    }
-                }
-            } catch (RegistryException re) {
-                String msg =
-                        "Error while getting throttling info for tenant " + tenant + ".";
-                log.error(msg, re);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/client/MultitenancyThrottlingServiceClient.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/client/MultitenancyThrottlingServiceClient.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/client/MultitenancyThrottlingServiceClient.java
deleted file mode 100644
index 351f05b..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/client/MultitenancyThrottlingServiceClient.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.agent.client;
-
-import org.apache.axis2.client.Options;
-import org.apache.axis2.client.ServiceClient;
-import org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient;
-import org.wso2.carbon.throttling.agent.internal.ThrottlingAgentServiceComponent;
-import org.wso2.carbon.throttling.agent.stub.services.MultitenancyThrottlingServiceStub;
-
-public class MultitenancyThrottlingServiceClient implements ThrottlingRuleInvoker {
-    MultitenancyThrottlingServiceStub stub;
-
-    public MultitenancyThrottlingServiceClient(String serverUrl, String userName, String password)
-            throws Exception {
-        stub =
-                new MultitenancyThrottlingServiceStub(ThrottlingAgentServiceComponent.getThrottlingAgent().getConfigurationContextService()
-                        .getClientConfigContext(), serverUrl + "MultitenancyThrottlingService");
-        ServiceClient client = stub._getServiceClient();
-        Options option = client.getOptions();
-        option.setManageSession(true);
-        String cookie = login(serverUrl, userName, password);
-        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
-    }
-
-    public static String login(String serverUrl, String userName, String password) throws Exception {
-        String sessionCookie = null;
-        try {
-            AuthenticationAdminClient client =
-                    new AuthenticationAdminClient(ThrottlingAgentServiceComponent.getThrottlingAgent().getConfigurationContextService()
-                            .getClientConfigContext(), 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 Exception("Error in login to throttling manager. server: " + serverUrl +
-                    "username: " + userName + ".", e);
-        }
-        return sessionCookie;
-    }
-
-
-    public void executeThrottlingRules(int tenantId) throws Exception {
-        stub.executeThrottlingRules(tenantId);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/client/ThrottlingRuleInvoker.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/client/ThrottlingRuleInvoker.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/client/ThrottlingRuleInvoker.java
deleted file mode 100644
index a92a981..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/client/ThrottlingRuleInvoker.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.agent.client;
-
-public interface ThrottlingRuleInvoker {
-    public void executeThrottlingRules(int tenantId) throws Exception;
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/conf/ThrottlingAgentConfiguration.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/conf/ThrottlingAgentConfiguration.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/conf/ThrottlingAgentConfiguration.java
deleted file mode 100644
index 55b9a75..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/conf/ThrottlingAgentConfiguration.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.agent.conf;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.stratos.common.util.CommonUtil;
-
-public class ThrottlingAgentConfiguration {
-    private static final Log log = LogFactory.getLog(ThrottlingAgentConfiguration.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 ThrottlingAgentConfiguration(String throttlingConfigFile) throws Exception {
-        try {
-            OMElement meteringConfig =
-                    CommonUtil.buildOMElement(new FileInputStream(throttlingConfigFile));
-            deserialize(meteringConfig);
-        } catch (FileNotFoundException e) {
-            String msg = "Unable to find the file: " + throttlingConfigFile + ".";
-            log.error(msg, e);
-            throw new Exception(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;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/internal/ThrottlingAgentServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/internal/ThrottlingAgentServiceComponent.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/internal/ThrottlingAgentServiceComponent.java
deleted file mode 100644
index da918e5..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/internal/ThrottlingAgentServiceComponent.java
+++ /dev/null
@@ -1,193 +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.throttling.agent.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.framework.BundleContext;
-import org.osgi.service.component.ComponentContext;
-import org.wso2.carbon.base.ServerConfiguration;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.registry.core.service.RegistryService;
-import org.wso2.carbon.throttling.agent.ThrottlingAgent;
-import org.wso2.carbon.throttling.agent.cache.Axis2ConfigurationContextObserverImpl;
-import org.wso2.carbon.throttling.agent.cache.ThrottlingInfoCache;
-import org.wso2.carbon.throttling.agent.listeners.WebAppRequestListener;
-import org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve;
-import org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer;
-import org.wso2.carbon.user.core.service.RealmService;
-import org.wso2.carbon.utils.Axis2ConfigurationContextObserver;
-import org.wso2.carbon.utils.ConfigurationContextService;
-import org.wso2.carbon.stratos.common.util.StratosConfiguration;
-
-import java.util.ArrayList;
-
-/**
- * @scr.component name="org.wso2.carbon.throttling.agent"
- * 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"
- * @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 ThrottlingAgentServiceComponent {
-    private static Log log = LogFactory.getLog(ThrottlingAgentServiceComponent.class);
-
-    private static ThrottlingAgent throttlingAgent;
-    private static RealmService realmService;
-    private static RegistryService registryService;
-    private static ConfigurationContextService contextService;
-    private static StratosConfiguration stratosConfiguration;
-
-    protected void activate(ComponentContext context) {
-        try {
-            BundleContext bundleContext = context.getBundleContext();
-            throttlingAgent = new ThrottlingAgent(bundleContext);
-            throttlingAgent.setConfigurationContextService(contextService);
-            throttlingAgent.setRealmService(realmService);
-            throttlingAgent.setRegistryService(registryService);
-            throttlingAgent.setStratosConfiguration(stratosConfiguration);
-
-            try {
-                // Throttling agent initialization require registry service.
-                throttlingAgent.init();
-            } catch (RegistryException e) {
-                String errMessage = "Failed to initialize throttling agent.";
-                log.error(errMessage, e);
-                throw new RuntimeException(errMessage, e);
-            }
-
-            if("true".equals(ServerConfiguration.getInstance().getFirstProperty("EnableMetering"))){
-                // Register the Tomcat Valve
-                ArrayList<CarbonTomcatValve> valves = new ArrayList<CarbonTomcatValve>();
-                valves.add(new WebAppRequestListener(throttlingAgent));
-                TomcatValveContainer.addValves(valves);
-
-                registerAxis2ConfigurationContextObserver(bundleContext, throttlingAgent.getThrottlingInfoCache());
-            }else{
-                log.debug("WebAppRequestListener valve was not added because metering is disabled in the configuration");
-                log.debug("Axis2ConfigurationContextObserver was not registered because metering is disabled");
-            }
-
-            registerThrottlingAgent(bundleContext);
-
-            log.debug("Multitenancy Throttling Agent bundle is activated.");
-        } catch (Throwable e) {
-            log.error("Multitenancy Throttling Agent bundle failed activating.", e);
-        }
-
-    }
-
-    private void registerAxis2ConfigurationContextObserver(BundleContext bundleContext, ThrottlingInfoCache cache) {
-        bundleContext.registerService(Axis2ConfigurationContextObserver.class.getName(),
-                new Axis2ConfigurationContextObserverImpl(cache),
-                null);
-    }
-
-    /**
-     * Register throttling agent service that use to update throttling rules when users try to
-     * upgrade down grade usage plans
-     *
-     * @param bundleContext bundle context that need to initialize throttling agent
-     */
-    public void registerThrottlingAgent(BundleContext bundleContext) {
-        try {
-            bundleContext.registerService(ThrottlingAgent.class.getName(),
-                    throttlingAgent,
-                    null);
-        }
-        catch (Exception e) {
-
-        }
-    }
-
-    protected void deactivate(ComponentContext context) {
-        //Util.uninitializeThrottlingRuleInvokerTracker();
-        log.debug("******* Multitenancy Throttling Agent bundle is deactivated ******* ");
-    }
-
-    protected void setRegistryService(RegistryService registryService) {
-        ThrottlingAgentServiceComponent.registryService = registryService;
-    }
-
-    protected void unsetRegistryService(RegistryService registryService) {
-        ThrottlingAgentServiceComponent.registryService = null;
-        throttlingAgent.setRegistryService(null);
-    }
-
-    protected void setRealmService(RealmService realmService) {
-        ThrottlingAgentServiceComponent.realmService = realmService;
-    }
-
-    protected void unsetRealmService(RealmService realmService) {
-        ThrottlingAgentServiceComponent.realmService = null;
-        throttlingAgent.setRealmService(null);
-    }
-
-    protected void setConfigurationContextService(ConfigurationContextService contextService) {
-        ThrottlingAgentServiceComponent.contextService = contextService;
-        
-        //this module is not necessary when we have the WebAppRequestListerner.
-        //It takes care of webapps and services. But this is not working for ESb
-        //When a solution for ESB is found, this module can be engaged again
-        /*try {
-            contextService.getServerConfigContext().getAxisConfiguration().engageModule(
-                    "usagethrottling");
-        } catch (AxisFault e) {
-            log.error("Failed to engage usage throttling module", e);
-        }*/
-    }
-
-    protected void unsetConfigurationContextService(ConfigurationContextService contextService) {
-        /*try {
-            AxisConfiguration axisConfig =
-                    contextService.getServerConfigContext().getAxisConfiguration();
-            axisConfig.disengageModule(axisConfig.getModule("usagethrottling"));
-        } catch (AxisFault e) {
-            log.error("Failed to disengage usage throttling module", e);
-        }*/
-        ThrottlingAgentServiceComponent.contextService = null;
-        throttlingAgent.setConfigurationContextService(null);
-    }
-
-    public static ThrottlingAgent getThrottlingAgent() {
-        return throttlingAgent;
-    }
-
-    protected void setStratosConfigurationService(StratosConfiguration stratosConfigService) {
-        ThrottlingAgentServiceComponent.stratosConfiguration=stratosConfigService;
-    }
-
-    protected void unsetStratosConfigurationService(StratosConfiguration ccService) {
-        ThrottlingAgentServiceComponent.stratosConfiguration = null;
-        throttlingAgent.setStratosConfiguration(null);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/PerRegistryRequestListener.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/PerRegistryRequestListener.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/PerRegistryRequestListener.java
deleted file mode 100644
index f503c72..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/PerRegistryRequestListener.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.agent.listeners;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.CarbonConstants;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.config.RegistryContext;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.registry.core.jdbc.handlers.Handler;
-import org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager;
-import org.wso2.carbon.registry.core.jdbc.handlers.RequestContext;
-import org.wso2.carbon.registry.core.jdbc.handlers.filters.Filter;
-import org.wso2.carbon.registry.core.jdbc.handlers.filters.URLMatcher;
-import org.wso2.carbon.registry.core.session.CurrentSession;
-import org.wso2.carbon.throttling.agent.cache.TenantThrottlingInfo;
-import org.wso2.carbon.throttling.agent.cache.ThrottlingActionInfo;
-import org.wso2.carbon.throttling.agent.internal.ThrottlingAgentServiceComponent;
-import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
-
-public class PerRegistryRequestListener extends Handler {
-
-    private static final Log log = LogFactory.getLog(PerRegistryRequestListener.class);
-
-    @Override
-    public void put(RequestContext context) throws RegistryException {
-        validateRegistryAction(StratosConstants.THROTTLING_IN_DATA_ACTION);
-    }
-
-    @Override
-    public void importResource(RequestContext context) throws RegistryException {
-        validateRegistryAction(StratosConstants.THROTTLING_IN_DATA_ACTION);
-    }
-
-    @Override
-    public Resource get(RequestContext context) throws RegistryException {
-        validateRegistryAction(StratosConstants.THROTTLING_OUT_DATA_ACTION);
-        return null;
-    }
-
-    @Override
-    public void dump(RequestContext requestContext) throws RegistryException {
-        validateRegistryAction(StratosConstants.THROTTLING_OUT_DATA_ACTION);
-    }
-
-    @Override
-    public void restore(RequestContext requestContext) throws RegistryException {
-        validateRegistryAction(StratosConstants.THROTTLING_IN_DATA_ACTION);
-    }
-
-    private void validateRegistryAction(String action) throws RegistryException {
-        if (CurrentSession.getCallerTenantId() == MultitenantConstants.SUPER_TENANT_ID
-                || CurrentSession.getTenantId() == MultitenantConstants.SUPER_TENANT_ID) {
-            // no limitations for the super tenant
-            return;
-        }
-        if (CarbonConstants.REGISTRY_SYSTEM_USERNAME.equals(CurrentSession.getUser()) ||
-                CarbonConstants.REGISTRY_ANONNYMOUS_USERNAME.equals(CurrentSession.getUser())) {
-            // skipping tracking for anonymous and system user
-            return;
-        }
-
-        // called only once per request..
-        if (CurrentSession.getAttribute(StratosConstants.REGISTRY_ACTION_VALIDATED_SESSION_ATTR) != null) {
-            return;
-        }
-        CurrentSession.setAttribute(StratosConstants.REGISTRY_ACTION_VALIDATED_SESSION_ATTR, true);
-
-        int tenantId = CurrentSession.getTenantId();
-
-        TenantThrottlingInfo tenantThrottlingInfo =
-                ThrottlingAgentServiceComponent.getThrottlingAgent().getThrottlingInfoCache()
-                        .getTenantThrottlingInfo(tenantId);
-        if(tenantThrottlingInfo!=null){
-            ThrottlingActionInfo actionInfo = tenantThrottlingInfo.getThrottlingActionInfo(action);
-
-            if (actionInfo != null && actionInfo.isBlocked()) {
-                String blockedMsg = actionInfo.getMessage();
-                String msg =
-                        "The throttling action is blocked. message: " + blockedMsg + ", action: " +
-                                action + ".";
-                log.error(msg);
-                // we are only throwing the blocked exception, as it is a error
-                // message for the user
-                throw new RegistryException(blockedMsg);
-            }
-        }
-    }
-
-    public static void registerPerRegistryRequestListener(RegistryContext registryContext) {
-        HandlerManager handlerManager = registryContext.getHandlerManager();
-        PerRegistryRequestListener storeBandwidthHandler = new PerRegistryRequestListener();
-        URLMatcher anyUrlMatcher = new URLMatcher();
-        anyUrlMatcher.setPattern(".*");
-        String[] applyingFilters =
-                new String[] { Filter.PUT, Filter.IMPORT, Filter.GET, Filter.DUMP, Filter.RESTORE, };
-
-        handlerManager.addHandlerWithPriority(
-                applyingFilters, anyUrlMatcher, storeBandwidthHandler);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/PerUserAddListener.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/PerUserAddListener.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/PerUserAddListener.java
deleted file mode 100644
index 8533f01..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/PerUserAddListener.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.agent.listeners;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.CarbonConstants;
-import org.wso2.carbon.base.ServerConfiguration;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.throttling.agent.cache.TenantThrottlingInfo;
-import org.wso2.carbon.throttling.agent.cache.ThrottlingActionInfo;
-import org.wso2.carbon.throttling.agent.internal.ThrottlingAgentServiceComponent;
-import org.wso2.carbon.user.core.UserStoreException;
-import org.wso2.carbon.user.core.UserStoreManager;
-import org.wso2.carbon.user.core.common.AbstractUserStoreManagerListener;
-import org.wso2.carbon.user.core.listener.AuthorizationManagerListener;
-import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
-
-import java.util.Map;
-
-public class PerUserAddListener extends AbstractUserStoreManagerListener {
-    private static final Log log = LogFactory.getLog(PerUserAddListener.class);
-
-    public int getExecutionOrderId() {
-        return AuthorizationManagerListener.MULTITENANCY_USER_RESTRICTION_HANDLER;
-    }
-
-    @Override
-    public boolean addUser(String userName, Object credential, String[] roleList,
-                           Map<String, String> claims, String profileName, UserStoreManager userStoreManager)
-            throws UserStoreException {
-
-        //If this is not a cloud deployment there is no way to run the throttling rules
-        //This means the product is being used in the tenant mode
-        //Therefore we can ommit running the throttling rules
-        if("false".equals(ServerConfiguration.getInstance().getFirstProperty(CarbonConstants.IS_CLOUD_DEPLOYMENT))){
-            log.info("Omitting executing throttling rules becasue this is not a cloud deployment.");
-            return true;
-        }
-        int tenantId = userStoreManager.getTenantId();
-        if (tenantId == MultitenantConstants.SUPER_TENANT_ID) {
-            return true;
-        }
-        // running the rules invoking the remote throttling manager.
-        String[] users = userStoreManager.listUsers("*", -1);
-        if (users.length <= 1) {
-            // no filtering if the users count < 1
-            return true;
-        }
-
-        try {
-            ThrottlingAgentServiceComponent.getThrottlingAgent().executeManagerThrottlingRules(tenantId);
-            ThrottlingAgentServiceComponent.getThrottlingAgent().updateThrottlingCacheForTenant();
-        } catch (Exception e1) {
-            String msg = "Error in executing the throttling rules in manager.";
-            log.error(msg + " tenantId: " + tenantId + ".", e1);
-            throw new UserStoreException(msg, e1);
-        }
-        TenantThrottlingInfo throttlingInfo = ThrottlingAgentServiceComponent.getThrottlingAgent()
-                .getThrottlingInfoCache().getTenantThrottlingInfo(tenantId);
-        if(throttlingInfo!=null){
-            ThrottlingActionInfo actionInfo = throttlingInfo.getThrottlingActionInfo(StratosConstants.THROTTLING_ADD_USER_ACTION);
-
-            if (actionInfo!=null && actionInfo.isBlocked()) {
-                String blockedMsg = actionInfo.getMessage();
-                String msg = "The add user action is blocked. message: " + blockedMsg + ".";
-                log.error(msg);
-                // we are only throwing the blocked exception, as it is a error message for the user
-                throw new UserStoreException(blockedMsg);
-            }
-        }
-        return true;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/ServiceRequestListener.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/ServiceRequestListener.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/ServiceRequestListener.java
deleted file mode 100644
index a4248ff..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/ServiceRequestListener.java
+++ /dev/null
@@ -1,113 +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.throttling.agent.listeners;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.handlers.AbstractHandler;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.core.transports.metering.MeteredServletRequest;
-import org.wso2.carbon.throttling.agent.cache.ThrottlingActionInfo;
-import org.wso2.carbon.throttling.agent.cache.ThrottlingInfoCache;
-import org.wso2.carbon.throttling.agent.internal.ThrottlingAgentServiceComponent;
-
-/**
- * Checks whether the axis2 operations (service calls) are allowed. 
- */
-public class ServiceRequestListener extends AbstractHandler {
-    private static final Log log = LogFactory.getLog(ServiceRequestListener.class);
-
-    public InvocationResponse invoke(MessageContext messageContext) throws AxisFault {
-        if (log.isDebugEnabled()) {
-            log.debug("Staring throttling handler invocation. Incoming message: " +
-                    messageContext.getEnvelope().toString());
-        }
-        AxisService service = messageContext.getAxisService();
-        Parameter param = service.getParameter("adminService");
-        
-        if (param != null && "true".equals(param.getValue())) {
-            //We will allow admin services to proceed.
-            return InvocationResponse.CONTINUE;
-        }
-        
-        int tenantId = getTenantId(messageContext);
-        if(tenantId <= 0){
-            //We can allow all super tenant actions
-            return InvocationResponse.CONTINUE;
-        }
-        
-        ThrottlingInfoCache throttlingInfoCache = ThrottlingAgentServiceComponent.getThrottlingAgent().getThrottlingInfoCache();
-        String[] actions = new String[]{StratosConstants.THROTTLING_SERVICE_IN_BANDWIDTH_ACTION, 
-                                        StratosConstants.THROTTLING_SERVICE_OUT_BANDWIDTH_ACTION,
-                                        StratosConstants.THROTTLING_SERVICE_REQUEST_ACTION,
-                                        StratosConstants.THROTTLING_SERVICE_RESPONSE_ACTION
-                                        };
-        ThrottlingActionInfo actionInfo = throttlingInfoCache.getTenantThrottlingInfo(tenantId).getThrottlingActionInfo(actions);
-
-        if (actionInfo.isBlocked()) {
-            String blockedMsg = actionInfo.getMessage();
-            String msg = "The throttling action is blocked. message: " + blockedMsg;
-            log.error(msg);
-            // we are only throwing the blocked exception, as it is a error message for the user
-            throw new AxisFault(blockedMsg);
-        }
-
-        return InvocationResponse.CONTINUE;
-    }
-    
-    private int getTenantId(MessageContext messageContext) {
-        Object obj = messageContext.getProperty("transport.http.servletRequest");
-        if (obj == null) {
-            // TODO: check for cause of the error.
-            log.debug("Servlet request is null. Skip monitoring.");
-            return 0;
-        }
-        if (!(obj instanceof MeteredServletRequest)) {
-            log.debug("HttpServletRequest is not of type MeteredServletRequest. Skip monitoring.");
-            return 0;
-        }
-
-        MeteredServletRequest servletRequest = (MeteredServletRequest) obj;
-        String address = servletRequest.getRequestURI();
-        String servicesPrefix = "/services/t/";
-        if (address != null && address.contains(servicesPrefix)) {
-            int domainNameStartIndex =
-                    address.indexOf(servicesPrefix) + servicesPrefix.length();
-            int domainNameEndIndex = address.indexOf('/', domainNameStartIndex);
-            String domainName = address.substring(domainNameStartIndex,
-                    domainNameEndIndex == -1 ? address.length() : domainNameEndIndex);
-
-            // return tenant id if domain name is not null
-            if (domainName != null) {
-                try {
-                    return ThrottlingAgentServiceComponent.getThrottlingAgent().getRealmService().getTenantManager().getTenantId(domainName);
-                } catch (org.wso2.carbon.user.api.UserStoreException e) {
-                    log.error("An error occurred while obtaining the tenant id.", e);
-                }
-            }
-        }
-
-        // return 0 if the domain name is null
-        return 0;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/ThrottlingModule.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/ThrottlingModule.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/ThrottlingModule.java
deleted file mode 100644
index 3ef89c9..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/ThrottlingModule.java
+++ /dev/null
@@ -1,49 +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.throttling.agent.listeners;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.description.AxisDescription;
-import org.apache.axis2.description.AxisModule;
-import org.apache.axis2.modules.Module;
-import org.apache.neethi.Assertion;
-import org.apache.neethi.Policy;
-
-/**
- * 
- */
-public class ThrottlingModule implements Module {
-
-    public void applyPolicy(Policy arg0, AxisDescription arg1) throws AxisFault {
-    }
-
-    public boolean canSupportAssertion(Assertion arg0) {
-        return true;
-    }
-
-    public void engageNotify(AxisDescription arg0) throws AxisFault {
-    }
-
-    public void init(ConfigurationContext arg0, AxisModule arg1) throws AxisFault {
-    }
-
-    public void shutdown(ConfigurationContext arg0) throws AxisFault {
-    }
-
-}


[12/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/postgresql.sql
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/postgresql.sql b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/postgresql.sql
new file mode 100644
index 0000000..4f897da
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/postgresql.sql
@@ -0,0 +1,427 @@
+DROP TABLE IF EXISTS REG_CLUSTER_LOCK;
+CREATE TABLE REG_CLUSTER_LOCK (
+             REG_LOCK_NAME VARCHAR (20),
+             REG_LOCK_STATUS VARCHAR (20),
+             REG_LOCKED_TIME TIMESTAMP,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (REG_LOCK_NAME)
+);
+
+DROP TABLE IF EXISTS REG_LOG;
+DROP SEQUENCE IF EXISTS REG_LOG_PK_SEQ;
+CREATE SEQUENCE REG_LOG_PK_SEQ;
+CREATE TABLE REG_LOG (
+             REG_LOG_ID INTEGER DEFAULT NEXTVAL('REG_LOG_PK_SEQ'),
+             REG_PATH VARCHAR (2000),
+             REG_USER_ID VARCHAR (20) NOT NULL,
+             REG_LOGGED_TIME TIMESTAMP NOT NULL,
+             REG_ACTION INTEGER NOT NULL,
+             REG_ACTION_DATA VARCHAR (500),
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID)
+);
+
+DROP TABLE IF EXISTS REG_PATH;
+DROP SEQUENCE IF EXISTS REG_PATH_PK_SEQ;
+CREATE SEQUENCE REG_PATH_PK_SEQ;
+CREATE TABLE REG_PATH(
+             REG_PATH_ID INTEGER DEFAULT NEXTVAL('REG_PATH_PK_SEQ'),
+             REG_PATH_VALUE VARCHAR(2000) NOT NULL,
+             REG_PATH_PARENT_ID INTEGER,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID)
+);
+
+CREATE INDEX REG_PATH_IND_BY_PATH_VALUE ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID);
+CREATE INDEX REG_PATH_IND_BY_PATH_PARENT_ID  ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID);
+
+DROP TABLE IF EXISTS REG_CONTENT;
+DROP SEQUENCE IF EXISTS REG_CONTENT_PK_SEQ;
+CREATE SEQUENCE REG_CONTENT_PK_SEQ;
+CREATE TABLE REG_CONTENT (
+             REG_CONTENT_ID INTEGER DEFAULT NEXTVAL('REG_CONTENT_PK_SEQ'),
+             REG_CONTENT_DATA BYTEA,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
+);
+
+DROP TABLE IF EXISTS REG_CONTENT_HISTORY;
+CREATE TABLE REG_CONTENT_HISTORY (
+             REG_CONTENT_ID INTEGER NOT NULL,
+             REG_CONTENT_DATA BYTEA,
+             REG_DELETED   SMALLINT,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
+);
+
+DROP TABLE IF EXISTS REG_RESOURCE;
+DROP SEQUENCE IF EXISTS REG_RESOURCE_PK_SEQ;
+CREATE SEQUENCE REG_RESOURCE_PK_SEQ;
+CREATE TABLE REG_RESOURCE (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR(256),
+            REG_VERSION         INTEGER DEFAULT NEXTVAL('REG_RESOURCE_PK_SEQ'),
+            REG_MEDIA_TYPE      VARCHAR(500),
+            REG_CREATOR         VARCHAR(20) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR(20),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
+);
+
+ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_IND_BY_NAME  ON REG_RESOURCE(REG_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME  ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
+
+DROP TABLE IF EXISTS REG_RESOURCE_HISTORY;
+CREATE TABLE REG_RESOURCE_HISTORY (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR(256),
+            REG_VERSION         INTEGER NOT NULL,
+            REG_MEDIA_TYPE      VARCHAR(500),
+            REG_CREATOR         VARCHAR(20) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR(20),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_DELETED         SMALLINT,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
+);
+
+ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME  ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME  ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
+
+DROP TABLE IF EXISTS REG_COMMENT;
+DROP SEQUENCE IF EXISTS REG_COMMENT_PK_SEQ;
+CREATE SEQUENCE REG_COMMENT_PK_SEQ;
+CREATE TABLE REG_COMMENT (
+            REG_ID        INTEGER DEFAULT NEXTVAL('REG_COMMENT_PK_SEQ'),
+            REG_COMMENT_TEXT      VARCHAR(500) NOT NULL,
+            REG_USER_ID           VARCHAR(20) NOT NULL,
+            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+DROP TABLE IF EXISTS REG_RESOURCE_COMMENT;
+CREATE TABLE REG_RESOURCE_COMMENT (
+            REG_COMMENT_ID          INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+);
+
+ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION  ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID);
+
+DROP TABLE IF EXISTS REG_RATING;
+DROP SEQUENCE IF EXISTS REG_RATING_PK_SEQ;
+CREATE SEQUENCE REG_RATING_PK_SEQ;
+CREATE TABLE REG_RATING (
+            REG_ID     INTEGER DEFAULT NEXTVAL('REG_RATING_PK_SEQ'),
+            REG_RATING        INTEGER NOT NULL,
+            REG_USER_ID       VARCHAR(20) NOT NULL,
+            REG_RATED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+DROP TABLE IF EXISTS REG_RESOURCE_RATING;
+CREATE TABLE REG_RESOURCE_RATING (
+            REG_RATING_ID           INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+);
+
+ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION  ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID);
+
+DROP TABLE IF EXISTS REG_TAG;
+DROP SEQUENCE IF EXISTS REG_TAG_PK_SEQ;
+CREATE SEQUENCE REG_TAG_PK_SEQ;
+CREATE TABLE REG_TAG (
+            REG_ID         INTEGER DEFAULT NEXTVAL('REG_TAG_PK_SEQ'),
+            REG_TAG_NAME       VARCHAR(500) NOT NULL,
+            REG_USER_ID        VARCHAR(20) NOT NULL,
+            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+DROP TABLE IF EXISTS REG_RESOURCE_TAG;
+CREATE TABLE REG_RESOURCE_TAG (
+            REG_TAG_ID              INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+);
+
+ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION  ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID);
+
+DROP TABLE IF EXISTS REG_PROPERTY;
+DROP SEQUENCE IF EXISTS REG_PROPERTY_PK_SEQ;
+CREATE SEQUENCE REG_PROPERTY_PK_SEQ;
+CREATE TABLE REG_PROPERTY (
+            REG_ID         INTEGER DEFAULT NEXTVAL('REG_PROPERTY_PK_SEQ'),
+            REG_NAME       VARCHAR(100) NOT NULL,
+            REG_VALUE        VARCHAR(1000),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+DROP TABLE IF EXISTS REG_RESOURCE_PROPERTY;
+CREATE TABLE REG_RESOURCE_PROPERTY (
+            REG_PROPERTY_ID         INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+);
+
+ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION  ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID);
+
+
+DROP TABLE IF EXISTS REG_ASSOCIATION;
+DROP SEQUENCE IF EXISTS REG_ASSOCIATION_PK_SEQ;
+CREATE SEQUENCE REG_ASSOCIATION_PK_SEQ;
+CREATE TABLE REG_ASSOCIATION (
+            REG_ASSOCIATION_ID INTEGER DEFAULT NEXTVAL('REG_ASSOCIATION_PK_SEQ'),
+            REG_SOURCEPATH VARCHAR (2000) NOT NULL,
+            REG_TARGETPATH VARCHAR (2000) NOT NULL,
+            REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID)
+);
+
+DROP TABLE IF EXISTS REG_SNAPSHOT;
+DROP SEQUENCE IF EXISTS REG_SNAPSHOT_PK_SEQ;
+CREATE SEQUENCE REG_SNAPSHOT_PK_SEQ;
+CREATE TABLE REG_SNAPSHOT (
+            REG_SNAPSHOT_ID     INTEGER DEFAULT NEXTVAL('REG_SNAPSHOT_PK_SEQ'),
+            REG_PATH_ID            INTEGER NOT NULL,
+            REG_RESOURCE_NAME      VARCHAR(255),
+            REG_RESOURCE_VIDS     BYTEA NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID)
+);
+
+CREATE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+
+ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+
+
+-- ################################
+-- USER MANAGER TABLES
+-- ################################
+
+DROP TABLE IF EXISTS UM_TENANT;
+DROP SEQUENCE IF EXISTS UM_TENANT_PK_SEQ;
+CREATE SEQUENCE UM_TENANT_PK_SEQ;
+CREATE TABLE UM_TENANT (
+			UM_ID INTEGER DEFAULT NEXTVAL('UM_TENANT_PK_SEQ'),
+			UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
+            UM_EMAIL VARCHAR(255),
+            UM_ACTIVE BOOLEAN DEFAULT FALSE,
+			PRIMARY KEY (UM_ID),
+			UNIQUE(UM_DOMAIN_NAME));
+
+DROP TABLE IF EXISTS UM_USER CASCADE;			
+DROP SEQUENCE IF EXISTS UM_USER_PK_SEQ;
+CREATE SEQUENCE UM_USER_PK_SEQ;
+CREATE TABLE UM_USER ( 
+             UM_ID INTEGER DEFAULT NEXTVAL('UM_USER_PK_SEQ'), 
+             UM_USER_NAME VARCHAR(255) NOT NULL, 
+             UM_USER_PASSWORD VARCHAR(255) NOT NULL,
+             UM_SALT_VALUE VARCHAR(31),
+             UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE,
+             UM_CHANGED_TIME TIMESTAMP NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             PRIMARY KEY (UM_ID, UM_TENANT_ID), 
+             UNIQUE(UM_USER_NAME, UM_TENANT_ID)
+); 
+
+DROP TABLE IF EXISTS UM_ROLE CASCADE;
+DROP SEQUENCE IF EXISTS UM_ROLE_PK_SEQ;
+CREATE SEQUENCE UM_ROLE_PK_SEQ;
+CREATE TABLE UM_ROLE ( 
+             UM_ID INTEGER DEFAULT NEXTVAL('UM_ROLE_PK_SEQ'), 
+             UM_ROLE_NAME VARCHAR(255) NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,  
+             PRIMARY KEY (UM_ID, UM_TENANT_ID),
+             UNIQUE(UM_ROLE_NAME, UM_TENANT_ID) 
+);
+
+DROP TABLE IF EXISTS UM_PERMISSION CASCADE;
+DROP SEQUENCE IF EXISTS UM_PERMISSION_PK_SEQ;
+CREATE SEQUENCE UM_PERMISSION_PK_SEQ;
+CREATE TABLE UM_PERMISSION ( 
+             UM_ID INTEGER DEFAULT NEXTVAL('UM_PERMISSION_PK_SEQ'), 
+             UM_RESOURCE_ID VARCHAR(255) NOT NULL, 
+             UM_ACTION VARCHAR(255) NOT NULL, 
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+); 
+
+CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION 
+                    ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID); 
+
+					
+DROP TABLE IF EXISTS UM_ROLE_PERMISSION;
+DROP SEQUENCE IF EXISTS UM_ROLE_PERMISSION_PK_SEQ;
+CREATE SEQUENCE UM_ROLE_PERMISSION_PK_SEQ;
+CREATE TABLE UM_ROLE_PERMISSION ( 
+             UM_ID INTEGER DEFAULT NEXTVAL('UM_ROLE_PERMISSION_PK_SEQ'), 
+             UM_PERMISSION_ID INTEGER NOT NULL, 
+             UM_ROLE_NAME VARCHAR(255) NOT NULL,
+             UM_IS_ALLOWED SMALLINT NOT NULL, 
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID), 
+             PRIMARY KEY (UM_ID, UM_TENANT_ID) 
+); 
+
+-- REMOVED UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID) 
+DROP TABLE IF EXISTS UM_USER_PERMISSION;
+DROP SEQUENCE IF EXISTS UM_USER_PERMISSION_PK_SEQ;
+CREATE SEQUENCE UM_USER_PERMISSION_PK_SEQ;
+CREATE TABLE UM_USER_PERMISSION ( 
+             UM_ID INTEGER DEFAULT NEXTVAL('UM_USER_PERMISSION_PK_SEQ'), 
+             UM_PERMISSION_ID INTEGER NOT NULL, 
+             UM_USER_NAME VARCHAR(255) NOT NULL,
+             UM_IS_ALLOWED SMALLINT NOT NULL,          
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID), 
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+-- REMOVED UNIQUE (UM_PERMISSION_ID, UM_USER_ID) 
+DROP TABLE IF EXISTS UM_USER_ROLE;
+DROP SEQUENCE IF EXISTS UM_USER_ROLE_PK_SEQ;
+CREATE SEQUENCE UM_USER_ROLE_PK_SEQ;
+CREATE TABLE UM_USER_ROLE ( 
+             UM_ID INTEGER DEFAULT NEXTVAL('UM_USER_ROLE_PK_SEQ'), 
+             UM_ROLE_ID INTEGER NOT NULL, 
+             UM_USER_ID INTEGER NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,  
+             UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID), 
+             FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID), 
+             FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), 
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+); 
+
+DROP TABLE IF EXISTS UM_USER_ATTRIBUTE;
+DROP SEQUENCE IF EXISTS UM_USER_ATTRIBUTE_PK_SEQ;
+CREATE SEQUENCE UM_USER_ATTRIBUTE_PK_SEQ;
+CREATE TABLE UM_USER_ATTRIBUTE ( 
+            UM_ID INTEGER DEFAULT NEXTVAL('UM_USER_ATTRIBUTE_PK_SEQ'), 
+            UM_ATTR_NAME VARCHAR(255) NOT NULL, 
+            UM_ATTR_VALUE VARCHAR(1024), 
+            UM_PROFILE_ID VARCHAR(255), 
+            UM_USER_ID INTEGER, 
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+); 
+
+
+DROP TABLE IF EXISTS UM_DIALECT CASCADE;
+DROP SEQUENCE IF EXISTS UM_DIALECT_PK_SEQ;
+CREATE SEQUENCE UM_DIALECT_PK_SEQ;
+CREATE TABLE UM_DIALECT( 
+            UM_ID INTEGER DEFAULT NEXTVAL('UM_DIALECT_PK_SEQ'), 
+            UM_DIALECT_URI VARCHAR(255) NOT NULL, 
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+); 
+
+DROP TABLE IF EXISTS UM_CLAIM;
+DROP SEQUENCE IF EXISTS UM_CLAIM_PK_SEQ;
+CREATE SEQUENCE UM_CLAIM_PK_SEQ;
+CREATE TABLE UM_CLAIM( 
+            UM_ID INTEGER DEFAULT NEXTVAL('UM_CLAIM_PK_SEQ'), 
+            UM_DIALECT_ID INTEGER NOT NULL, 
+            UM_CLAIM_URI VARCHAR(255) NOT NULL, 
+            UM_DISPLAY_TAG VARCHAR(255), 
+            UM_DESCRIPTION VARCHAR(255), 
+            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
+            UM_REG_EX VARCHAR(255), 
+            UM_SUPPORTED SMALLINT, 
+            UM_REQUIRED SMALLINT, 
+            UM_DISPLAY_ORDER INTEGER,
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID), 
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+); 
+
+DROP TABLE IF EXISTS UM_PROFILE_CONFIG;
+DROP SEQUENCE IF EXISTS UM_PROFILE_CONFIG_PK_SEQ;
+CREATE SEQUENCE UM_PROFILE_CONFIG_PK_SEQ;
+CREATE TABLE UM_PROFILE_CONFIG( 
+            UM_ID INTEGER DEFAULT NEXTVAL('UM_PROFILE_CONFIG_PK_SEQ'), 
+            UM_DIALECT_ID INTEGER NOT NULL, 
+            UM_PROFILE_NAME VARCHAR(255), 
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+); 
+
+DROP TABLE IF EXISTS UM_CLAIM_BEHAVIOR;    
+DROP SEQUENCE IF EXISTS UM_CLAIM_BEHAVIOR_PK_SEQ;
+CREATE SEQUENCE UM_CLAIM_BEHAVIOR_PK_SEQ;
+CREATE TABLE UM_CLAIM_BEHAVIOR( 
+            UM_ID INTEGER DEFAULT NEXTVAL('UM_CLAIM_BEHAVIOR_PK_SEQ'), 
+            UM_PROFILE_ID INTEGER, 
+            UM_CLAIM_ID INTEGER, 
+            UM_BEHAVIOUR SMALLINT, 
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID), 
+            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+); 
+
+DROP TABLE IF EXISTS UM_HYBRID_ROLE;
+DROP SEQUENCE IF EXISTS UM_HYBRID_ROLE_PK_SEQ;
+CREATE SEQUENCE UM_HYBRID_ROLE_PK_SEQ;
+CREATE TABLE UM_HYBRID_ROLE(
+            UM_ID INTEGER DEFAULT NEXTVAL('UM_HYBRID_ROLE_PK_SEQ'),
+            UM_ROLE_NAME VARCHAR(255),
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+DROP TABLE IF EXISTS UM_HYBRID_USER_ROLE;
+DROP SEQUENCE IF EXISTS UM_HYBRID_USER_ROLE_PK_SEQ;
+CREATE SEQUENCE UM_HYBRID_USER_ROLE_PK_SEQ;
+CREATE TABLE UM_HYBRID_USER_ROLE(
+            UM_ID INTEGER DEFAULT NEXTVAL('UM_HYBRID_USER_ROLE_PK_SEQ'),
+            UM_USER_NAME VARCHAR(255),
+            UM_ROLE_ID INTEGER NOT NULL,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
+            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/README
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/README b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/README
new file mode 100644
index 0000000..bdd5963
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/README
@@ -0,0 +1,22 @@
+CARBON_HOME/repository is the main repository for all kind of deployments and
+configurations in Carbon. This includes all Axis2 artifacts, Synapse artifacts etc. In
+addition to that, Axis2 configurations, Carbon configurations etc are also hosted
+under this folder.
+
+1. lib
+   Directory contains all the client side Axis2 libraries. These libraries will be copied here after
+   starting the server once or by running 'ant' from CARBON_HOME/bin.
+
+2. deployment
+   Directory can be used to deploy Axis2 (can have Synapse, BPel stuff as well) artifacts for both
+   server side and client side. See deployment/README for more details.
+
+3. conf
+   Directory contains all the configuration files. axis2.xml, carbon.xml etc.
+
+4. components
+   Directory contains all OSGi related stuff. Carbon bundles, OSGi configuration
+   files and p2 stuff. See components/README for more details.
+
+5. logs
+   Directory contains all Carbon logs.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/README
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/README b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/README
new file mode 100644
index 0000000..3faeb49
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/README
@@ -0,0 +1,39 @@
+CARBON_HOME/repository/conf directory contains all the Carbon configuration files
+
+1. axis2.xml
+   The Apache Axis2 configuration file. Apache Axis2 is used at the core
+   of WSO2 Carbon.
+
+2. carbon.xml
+   The Carbon server configuration file
+
+3. mime.types
+   Defines MIME types to file extension mappings.
+
+4. README
+   This file
+
+5. registry.xml
+   The Carbon registry configuration file. This will be used when the WSO2
+   Embedded Registry is used.
+
+6. synapse.xml
+   The Apache Synapse configuration file. This will be used if Apache Synapse
+   or WSO2 ESB related Carbon components are deployed.
+
+7. mgt-transports.xml
+   Used in standalone mode to configure HTTP/S transports for the Carbon management console
+
+8. user-mgt.xml
+   The User Manager configuration file used for configuring user management
+   details.
+
+9. wrapper.conf
+   The Java Service Wrapper (JSW) configuration file. JSW is used for running
+   Carbon as a Unix daemon or Windows NT service.
+
+10. secret-conf.properties
+   The Secret Manager Configuration that is used by secret vault component
+
+11  cipher-text.properties
+   File based secret repository 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/axis2.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/axis2.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/axis2.xml
new file mode 100644
index 0000000..5aa432a
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/axis2.xml
@@ -0,0 +1,633 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<axisconfig name="AxisJava2.0">
+
+    <!-- ================================================= -->
+    <!-- Globally engaged modules -->
+    <!-- ================================================= -->
+    <module ref="addressing"/>
+
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <parameter name="hotdeployment">${hotdeployment}</parameter>
+    <parameter name="hotupdate">${hotupdate}</parameter>
+    <parameter name="enableMTOM" locked="false">optional</parameter>
+    <parameter name="cacheAttachments">true</parameter>
+    <parameter name="attachmentDIR">work/mtom</parameter>
+    <parameter name="sizeThreshold">4000</parameter>
+
+    <!--
+    Defines how the persistence of WS-ReliableMessaging is handled
+
+    Possible value are: inmemory & persistent
+    -->
+    <!-- Following parameter will completely disable REST handling in both the servlets-->
+    <parameter name="disableREST" locked="false">false</parameter>
+
+    <parameter name="Sandesha2StorageManager">inmemory</parameter>
+
+    <!-- This deployment interceptor will be called whenever before a module is initialized or
+     service is deployed -->
+    <listener class="org.wso2.carbon.core.deployment.DeploymentInterceptor"/>
+
+    <!-- setting servicePath. contextRoot is defined in the carbon.xml file -->
+    <parameter name="servicePath">services</parameter>
+
+    <!--the directory in which .aar services are deployed inside axis2 repository-->
+    <parameter name="ServicesDirectory">axis2services</parameter>
+
+    <!--the directory in which modules are deployed inside axis2 repository-->
+    <parameter name="ModulesDirectory">axis2modules</parameter>
+
+    <parameter name="userAgent" locked="true">
+        @product.name@-@product.version@
+    </parameter>
+    <parameter name="server" locked="true">
+        @product.name@-@product.version@
+    </parameter>
+
+    <!-- ========================================================================-->
+
+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+    <!--that behaviour.-->
+    <parameter name="sendStacktraceDetailsWithFaults">false</parameter>
+
+    <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
+    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
+    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
+    <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
+    <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
+
+    <!--Set the flag to true if you want to enable transport level session mangment-->
+    <parameter name="manageTransportSession">true</parameter>
+
+    <!-- Synapse Configuration file -->
+    <parameter name="SynapseConfig.ConfigurationFile" locked="false">./repository/conf/synapse.xml</parameter>
+
+    <!-- Synapse Home parameter -->
+    <parameter name="SynapseConfig.HomeDirectory" locked="false">.</parameter>
+
+    <!-- Resolve root used to resolve synapse references like schemas inside a WSDL -->
+    <parameter name="SynapseConfig.ResolveRoot" locked="false">.</parameter>
+
+    <!-- Synapse Server name parameter -->
+    <parameter name="SynapseConfig.ServerName" locked="false">WSO2 Carbon Server</parameter>
+
+    <!--By default, JAXWS services are created by reading annotations. WSDL and schema are generated-->
+    <!--using a separate WSDL generator only when ?wsdl is called. Therefore, even if you engage-->
+    <!--policies etc.. to AxisService, it doesn't appear in the WSDL. By setting the following property-->
+    <!--to true, you can create the AxisService using the generated WSDL and remove the need for a-->
+    <!--WSDL generator. When ?wsdl is called, WSDL is generated in the normal way.-->
+    <parameter name="useGeneratedWSDLinJAXWS">true</parameter>
+
+    <!-- Deployer for the dataservice. -->
+    <!--<deployer extension="dbs" directory="dataservices" class="org.wso2.dataservices.DBDeployer"/>-->
+
+    <!-- Axis1 deployer for Axis2-->
+    <!--<deployer extension="wsdd" class="org.wso2.carbon.axis1services.Axis1Deployer" directory="axis1services"/>-->
+
+    <!-- POJO service deployer for Jar -->
+    <!--<deployer extension="jar" class="org.apache.axis2.deployment.POJODeployer" directory="pojoservices"/>-->
+
+    <!-- POJO service deployer for Class  -->
+    <!--<deployer extension="class" class="org.apache.axis2.deployment.POJODeployer" directory="pojoservices"/>-->
+
+    <!-- JAXWS service deployer  -->
+    <!--<deployer extension=".jar" class="org.apache.axis2.jaxws.framework.JAXWSDeployer" directory="servicejars"/>-->
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!--This is the Default Message Receiver for the system , if you want to have MessageReceivers for -->
+    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
+    <!--any operation -->
+    <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
+
+    <messageReceivers>
+        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only"
+                         class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/ns/wsdl/robust-in-only"
+                         class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
+                         class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+    </messageReceivers>
+
+    <messageFormatters>
+        <messageFormatter contentType="application/x-www-form-urlencoded"
+                         class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
+        <messageFormatter contentType="multipart/form-data"
+                         class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
+        <messageFormatter contentType="application/xml"
+                         class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
+        <messageFormatter contentType="text/xml"
+                         class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
+        <messageFormatter contentType="application/soap+xml"
+                         class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
+	<!--messageFormatter contentType="application/x-www-form-urlencoded"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
+        <!--messageFormatter contentType="multipart/form-data"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
+	<!--messageFormatter contentType="application/xml"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
+	<!--messageFormatter contentType="text/html"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
+	<!--messageFormatter contentType="application/soap+xml"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
+	 <!--messageFormatter contentType="x-application/hessian"
+			class="org.apache.synapse.format.hessian.HessianMessageFormatter"/-->
+        <!--<messageFormatter contentType="">
+			class="org.apache.synapse.format.hessian.HessianMessageFormatter"/-->
+   </messageFormatters>
+
+    <messageBuilders>
+        <messageBuilder contentType="application/xml"
+                        class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
+        <messageBuilder contentType="application/x-www-form-urlencoded"
+                        class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
+        <messageBuilder contentType="multipart/form-data"
+                        class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
+        <!--messageBuilder contentType="application/xml"
+     		        class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+	<!--messageBuilder contentType="application/x-www-form-urlencoded"
+                        class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+	<!--messageBuilder contentType="multipart/form-data"
+                        class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+	<!--messageBuilder contentType="multipart/related"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+	<!--messageBuilder contentType="application/soap+xml"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+	<!--messageBuilder contentType="text/plain"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+	<!--messageBuilder contentType="text/xml"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+	<!--messageFormatter contentType="text/plain"
+                        class="org.apache.axis2.format.PlainTextBuilder"/-->
+	<!--messageBuilder contentType="x-application/hessian"
+		       class="org.apache.synapse.format.hessian.HessianMessageBuilder"/-->
+    </messageBuilders>
+
+
+    <!-- ================================================= -->
+    <!-- In Transports -->
+    <!-- ================================================= -->
+    <transportReceiver name="http"
+                       class="org.wso2.carbon.core.transports.http.HttpTransportListener">
+        <!--
+           Uncomment the following if you are deploying this within an application server. You
+           need to specify the HTTP port of the application server
+        -->
+        <parameter name="port">9763</parameter>
+
+        <!--
+       Uncomment the following to enable Apache2 mod_proxy. The port on the Apache server is 80
+       in this case.
+        -->
+        <!--<parameter name="proxyPort">80</parameter>-->
+    </transportReceiver>
+
+    <!--Please uncomment this in Multiple Instance Scenario if you want to use NIO Transport Recievers and 
+ 	Remove the current transport REceivers in axis2.xml -->    
+    <!--transportReceiver name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOListener">
+        <parameter name="port" locked="false">8280</parameter>
+        <parameter name="non-blocking" locked="false">true</parameter>
+    </transportReceiver>
+    
+    <transportReceiver name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLListener">
+        <parameter name="port" locked="false">8243</parameter>
+        <parameter name="non-blocking" locked="false">true</parameter>
+        <parameter name="keystore" locked="false">
+            <KeyStore>
+                <Location>resources/security/wso2carbon.jks</Location>
+                <Type>JKS</Type>
+                <Password>wso2carbon</Password>
+                <KeyPassword>wso2carbon</KeyPassword>
+            </KeyStore>
+        </parameter>
+        <parameter name="truststore" locked="false">
+            <TrustStore>
+                <Location>resources/security/client-truststore.jks</Location>
+                <Type>JKS</Type>
+                <Password>wso2carbon</Password>
+            </TrustStore>
+        </parameter>
+    </transportReceiver-->
+    
+
+
+    <transportReceiver name="https"
+                       class="org.wso2.carbon.core.transports.http.HttpsTransportListener">
+        <!--
+           Uncomment the following if you are deploying this within an application server. You
+           need to specify the HTTPS port of the application server
+        -->
+        <parameter name="port">9443</parameter>
+
+        <!--
+       Uncomment the following to enable Apache2 mod_proxy. The port on the Apache server is 443
+       in this case.
+        -->
+        <!--<parameter name="proxyPort">443</parameter>-->
+    </transportReceiver>
+
+    <!--
+       Uncomment the following segment to enable TCP transport.
+       Note : Addressing module should be engaged for TCP transport to work
+    -->
+    <!--<transportReceiver name="tcp"
+                       class="org.apache.axis2.transport.tcp.TCPServer">
+        <parameter name="port">6667</parameter>
+    </transportReceiver>-->
+
+    <!--
+     To Enable SimpleMailListener, please change the configuration
+     parameters and uncomment the following
+    -->
+    <!--<transportReceiver name="mailto" class="org.apache.axis2.transport.mail.SimpleMailListener">
+        <parameter name="mail.pop3.host">localhost</parameter>
+        <parameter name="mail.pop3.user">red</parameter>
+        <parameter name="mail.store.protocol">pop3</parameter>
+        <parameter name="transport.mail.pop3.password">red</parameter>
+        <parameter name="transport.mail.replyToAddress">red@localhost</parameter>
+        <parameter name="transport.listener.interval">3000</parameter>
+    </transportReceiver>-->
+
+    <!--
+      Uncomment this and configure as appropriate for JMS transport support,
+      after setting up your JMS environment (e.g. ActiveMQ)
+    -->
+    <!--<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
+        <parameter name="myTopicConnectionFactory">
+        	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
+        </parameter>
+
+        <parameter name="myQueueConnectionFactory">
+        	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
+        </parameter>
+
+        <parameter name="default">
+        	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
+        </parameter>
+    </transportReceiver>-->
+
+    <!-- ================================================= -->
+    <!-- Out Transports -->
+    <!-- ================================================= -->
+
+    <transportSender name="tcp"
+                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+    <transportSender name="local"
+                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
+    <!--<transportSender name="jms"
+                     class="org.apache.axis2.transport.jms.JMSSender"/>-->
+    <transportSender name="http"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding">chunked</parameter>
+        <!-- This parameter has been added to overcome problems encounted in SOAP action parameter -->
+        <parameter name="OmitSOAP12Action">true</parameter>
+    </transportSender>
+    <transportSender name="https"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding">chunked</parameter>
+        <!-- This parameter has been added to overcome problems encounted in SOAP action parameter -->
+        <parameter name="OmitSOAP12Action">true</parameter>
+    </transportSender>
+
+    <!--<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
+        <parameter name="mail.smtp.host">localhost</parameter>
+    </transportSender>-->
+
+
+    <!--Please uncomment this in Multiple Instance Scenario if you want to use NIO sender -->
+    <!--  
+    <transportSender name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
+        <parameter name="non-blocking" locked="false">true</parameter>
+    </transportSender>
+    <transportSender name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLSender">
+        <parameter name="non-blocking" locked="false">true</parameter>
+        <parameter name="keystore" locked="false">
+            <KeyStore>
+                <Location>resources/security/wso2carbon.jks</Location>
+                <Type>JKS</Type>
+                <Password>wso2carbon</Password>
+                <KeyPassword>wso2carbon</KeyPassword>
+            </KeyStore>
+        </parameter>
+        <parameter name="truststore" locked="false">
+            <TrustStore>
+                <Location>resources/security/client-truststore.jks</Location>
+                <Type>JKS</Type>
+                <Password>wso2carbon</Password>
+            </TrustStore>
+        </parameter>
+    </transportSender>
+	-->
+
+
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="InFlow">
+        <!--  System pre defined phases       -->
+        <phase name="Transport">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+        </phase>
+        <phase name="Addressing">
+             <handler name="AddressingBasedDispatcher"
+                     class="org.wso2.carbon.core.multitenancy.MultitenantAddressingBasedDispatcher">
+                 <order phase="Addressing"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
+
+            <handler name="HTTPLocationBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
+
+            <handler name="MultitenantDispatcher"
+                     class="org.wso2.carbon.core.multitenancy.MultitenantDispatcher"/>
+        </phase>
+        <!--  System pre defined phases       -->
+        <phase name="RMPhase"/>
+        <phase name="OpPhase"/>
+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
+        <phase name="OperationInPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFlow">
+        <phase name="RMPhase"/>
+        <phase name="OpPhase"/>
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationOutPhase"/>
+        <!--system predefined phase-->
+        <!--these phase will run irrespective of the service-->
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+	    <phase name="Security">
+            <!--<handler name="test"
+                     class="org.wso2.carbon.core.multitenancy.MultitenantMeteringHandler">
+                <order phase="Security"/>
+            </handler>-->
+        </phase>
+    </phaseOrder>
+    <phaseOrder type="InFaultFlow">
+        <!--  System pre defined phases       -->
+        <phase name="Transport">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+            <!--<handler name="POXSecHandler"
+                     class="org.wso2.carbon.core.security.pox.POXSecurityHandler">
+                <order phase="Transport"/>
+            </handler>-->
+        </phase>
+
+        <phase name="Addressing">
+             <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+                 <order phase="Addressing"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
+
+            <handler name="HTTPLocationBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
+            <!--handler name="AdminServiceAuthenticationHandler"
+                     class="org.wso2.carbon.core.auth.AuthenticationHandler"/-->
+        </phase>
+        <phase name="RMPhase"/>
+        <phase name="OpPhase"/>
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationInFaultPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFaultFlow">
+        <phase name="RMPhase"/>
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationOutFaultPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+
+    <!-- ================================================= -->
+    <!-- Clustering  -->
+    <!-- ================================================= -->
+    <!--
+     To enable clustering for this node, set the value of "enable" attribute of the "clustering"
+     element to "true". The initialization of a node in the cluster is handled by the class
+     corresponding to the "class" attribute of the "clustering" element. It is also responsible for
+     getting this node to join the cluster.
+     -->
+    <clustering class="org.apache.axis2.clustering.tribes.TribesClusteringAgent" enable="false">
+
+        <!--
+           This parameter indicates whether the cluster has to be automatically initalized
+           when the AxisConfiguration is built. If set to "true" the initialization will not be
+           done at that stage, and some other party will have to explictly initialize the cluster.
+        -->
+        <parameter name="AvoidInitiation">true</parameter>
+
+        <!--
+           The membership scheme used in this setup. The only values supported at the moment are
+           "multicast" and "wka"
+
+           1. multicast - membership is automatically discovered using multicasting
+           2. wka - Well-Known Address based multicasting. Membership is discovered with the help
+                    of one or more nodes running at a Well-Known Address. New members joining a
+                    cluster will first connect to a well-known node, register with the well-known node
+                    and get the membership list from it. When new members join, one of the well-known
+                    nodes will notify the others in the group. When a member leaves the cluster or
+                    is deemed to have left the cluster, it will be detected by the Group Membership
+                    Service (GMS) using a TCP ping mechanism.
+        -->
+        <parameter name="membershipScheme">multicast</parameter>
+
+        <!--
+         The clustering domain/group. Nodes in the same group will belong to the same multicast
+         domain. There will not be interference between nodes in different groups.
+        -->
+        <parameter name="domain">wso2.carbon.domain</parameter>
+
+        <!--
+           When a Web service request is received, and processed, before the response is sent to the
+           client, should we update the states of all members in the cluster? If the value of
+           this parameter is set to "true", the response to the client will be sent only after
+           all the members have been updated. Obviously, this can be time consuming. In some cases,
+           such this overhead may not be acceptable, in which case the value of this parameter
+           should be set to "false"
+        -->
+        <parameter name="synchronizeAll">true</parameter>
+
+        <!--
+          The maximum number of times we need to retry to send a message to a particular node
+          before giving up and considering that node to be faulty
+        -->
+        <parameter name="maxRetries">10</parameter>
+
+        <!-- The multicast address to be used -->
+        <parameter name="mcastAddress">228.0.0.4</parameter>
+
+        <!-- The multicast port to be used -->
+        <parameter name="mcastPort">45564</parameter>
+
+        <!-- The frequency of sending membership multicast messages (in ms) -->
+        <parameter name="mcastFrequency">500</parameter>
+
+        <!-- The time interval within which if a member does not respond, the member will be
+         deemed to have left the group (in ms)
+         -->
+        <parameter name="memberDropTime">3000</parameter>
+
+        <!--
+           The IP address of the network interface to which the multicasting has to be bound to.
+           Multicasting would be done using this interface.
+        -->
+	<!--
+        <parameter name="mcastBindAddress">127.0.0.1</parameter>
+	-->
+        <!-- The host name or IP address of this member -->
+        <!--
+	<parameter name="localMemberHost">127.0.0.1</parameter>
+	-->
+        <!--
+        The TCP port used by this member. This is the port through which other nodes will
+        contact this member
+         -->
+        <parameter name="localMemberPort">4000</parameter>
+
+        <!--
+        Preserve message ordering. This will be done according to sender order.
+        -->
+        <parameter name="preserveMessageOrder">true</parameter>
+
+        <!--
+        Maintain atmost-once message processing semantics
+        -->
+        <parameter name="atmostOnceMessageSemantics">true</parameter>
+
+        <!--
+        Properties specific to this member
+        -->
+        <parameter name="properties">
+            <property name="backendServerURL" value="https://${hostName}:${httpsPort}/services/"/>
+            <property name="mgtConsoleURL" value="https://${hostName}:${httpsPort}/"/>
+        </parameter>
+
+        <!--
+           The list of static or well-known members. These entries will only be valid if the
+           "membershipScheme" above is set to "wka"
+        -->
+        <members>
+            <member>
+                <hostName>127.0.0.1</hostName>
+                <port>4000</port>
+            </member>
+            <member>
+                <hostName>127.0.0.1</hostName>
+                <port>4001</port>
+            </member>
+        </members>
+
+        <!--
+        Enable the groupManagement entry if you need to run this node as a cluster manager.
+        Multiple application domains with different GroupManagementAgent implementations
+        can be defined in this section.
+        -->
+        <groupManagement enable="false">
+            <applicationDomain name="apache.axis2.application.domain"
+                               description="Axis2 group"
+                               agent="org.apache.axis2.clustering.management.DefaultGroupManagementAgent"/>
+        </groupManagement>
+
+        <!--
+           This interface is responsible for handling management of a specific node in the cluster
+           The "enable" attribute indicates whether Node management has been enabled
+        -->
+        <nodeManager class="org.apache.axis2.clustering.management.DefaultNodeManager"
+                     enable="true"/>
+
+        <!--
+           This interface is responsible for handling state replication. The property changes in
+           the Axis2 context hierarchy in this node, are propagated to all other nodes in the cluster.
+
+           The "excludes" patterns can be used to specify the prefixes (e.g. local_*) or
+           suffixes (e.g. *_local) of the properties to be excluded from replication. The pattern
+           "*" indicates that all properties in a particular context should not be replicated.
+
+            The "enable" attribute indicates whether context replication has been enabled
+        -->
+        <stateManager class="org.apache.axis2.clustering.state.DefaultStateManager"
+                      enable="true">
+            <replication>
+                <defaults>
+                    <exclude name="local_*"/>
+                    <exclude name="LOCAL_*"/>
+                </defaults>
+                <context class="org.apache.axis2.context.ConfigurationContext">
+                    <exclude name="local_*"/>
+                </context>
+                <context class="org.apache.axis2.context.ServiceGroupContext">
+                    <exclude name="local_*"/>
+                </context>
+                <context class="org.apache.axis2.context.ServiceContext">
+                    <exclude name="local_*"/>
+                </context>
+            </replication>
+        </stateManager>
+    </clustering>
+</axisconfig>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/axis2_client.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/axis2_client.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/axis2_client.xml
new file mode 100644
index 0000000..4f2e1b9
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/axis2_client.xml
@@ -0,0 +1,283 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<axisconfig name="AxisJava2.0">
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <parameter name="hotdeployment">true</parameter>
+    <parameter name="hotupdate">false</parameter>
+    <parameter name="enableMTOM">false</parameter>
+
+    <!--If turned on with use the Accept header of the request to determine the contentType of the
+    response-->
+    <parameter name="httpContentNegotiation">false</parameter>
+
+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+    <!--that behaviour.-->
+    <parameter name="sendStacktraceDetailsWithFaults">true</parameter>
+
+    <!--If there aren't any information available to find out the fault reason, we set the message of the exception-->
+    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
+    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
+    <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
+    <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
+
+    <!--This is the user name and password of admin console-->
+    <parameter name="userName">admin</parameter>
+    <parameter name="password">axis2</parameter>
+
+    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
+    <!--ServicesDirectory only works on the following cases-->
+    <!---File based configurator and in that case the value should be a file URL (http:// not allowed)-->
+    <!---When creating URL Based configurator with URL “file://”  -->
+    <!--- War based configurator with expanded case , -->
+
+    <!--All the other scenarios it will be ignored.-->
+    <!--<parameter name="ServicesDirectory">service</parameter>-->
+    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
+    <!--<parameter name="ModulesDirectory">modules</parameter>-->
+
+    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
+    <!--root which can configured using the following contextRoot parameter-->
+    <!--<parameter name="contextRoot">axis2</parameter>-->
+
+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distinguish those endpoints-->
+    <!--<parameter name="servicePath">services</parameter>-->
+    <!--<parameter name="restPath">rest</parameter>-->
+
+    <!-- Following parameter will completely disable REST handling in Axis2-->
+    <parameter name="disableREST" locked="false">false</parameter>
+
+    <!--POJO deployer , this will alow users to drop .class file and make that into a service-->
+    <deployer extension=".class" directory="pojo" class="org.apache.axis2.deployment.POJODeployer"/>
+
+    <!-- Following parameter will set the host name for the epr-->
+    <!--<parameter name="hostname" locked="true">myhost.com</parameter>-->
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!--This is the Default Message Receiver for the system , if you want to have MessageReceivers for -->
+    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
+    <!--any operation -->
+    <!--Note : You can override this for particular service by adding the same element with your requirement-->
+    <messageReceivers>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+    </messageReceivers>
+
+    <!-- ================================================= -->
+    <!-- Message Formatter -->
+    <!-- ================================================= -->
+    <!--Following content type to message formatter mapping can be used to implement support for different message -->
+    <!--format  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
+    <messageFormatters>
+        <messageFormatter contentType="application/x-www-form-urlencoded"
+                          class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
+        <messageFormatter contentType="multipart/form-data"
+                          class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
+        <messageFormatter contentType="application/xml"
+                          class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
+        <messageFormatter contentType="text/xml"
+                          class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
+        <messageFormatter contentType="application/soap+xml"
+                          class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
+    </messageFormatters>
+
+    <!-- ================================================= -->
+    <!-- Message Builders -->
+    <!-- ================================================= -->
+    <!--Following content type to builder mapping can be used to implement support for different message -->
+    <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
+    <messageBuilders>
+        <messageBuilder contentType="application/xml"
+                        class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
+        <messageBuilder contentType="application/x-www-form-urlencoded"
+                        class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
+        <!--Left commented because it adds the depandancy of servlet-api to other modules.
+        Please uncomment to Receive messages in multipart/form-data format-->
+        <!--<messageBuilder contentType="multipart/form-data"-->
+        <!--class="org.apache.axis2.builder.MultipartFormDataBuilder"/>-->
+    </messageBuilders>
+
+    <!-- ================================================= -->
+    <!-- Target Resolvers -->
+    <!-- ================================================= -->
+    <!-- Uncomment the following and specify the class name for your TargetResolver to add -->
+    <!-- a TargetResolver. TargetResolvers are used to process the To EPR for example to -->
+    <!-- choose a server in a cluster -->
+    <!--<targetResolvers>-->
+    <!--<targetResolver class="" />-->
+    <!--</targetResolvers>-->
+
+
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+    <transportReceiver name="http"
+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
+        <parameter name="port">6071</parameter>
+        <!--If you want to give your own host address for EPR generation-->
+        <!--uncomment following parameter , and set as you required.-->
+        <!--<parameter name="hostname">http://myApp.com/ws</parameter>-->
+    </transportReceiver>
+
+    <!--Uncomment if you want to have TCP transport support-->
+    <!--<transportReceiver name="tcp"
+                       class="org.apache.axis2.transport.tcp.TCPServer">
+        <parameter name="port">6061</parameter>-->
+    <!--If you want to give your own host address for EPR generation-->
+    <!--uncomment following parameter , and set as you required.-->
+    <!--<parameter name="hostname">tcp://myApp.com/ws</parameter>-->
+    <!--</transportReceiver>-->
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <!--<transportSender name="jms"-->
+    <!--class="org.apache.axis2.transport.jms.JMSSender"/>-->
+    <transportSender name="tcp"
+                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+    <transportSender name="local"
+                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
+    <transportSender name="http"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding">chunked</parameter>
+        <parameter name="SO_TIMEOUT">60000</parameter>
+        <parameter name="CONNECTION_TIMEOUT">60000</parameter>
+    </transportSender>
+    <transportSender name="https"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding">chunked</parameter>
+        <parameter name="SO_TIMEOUT">60000</parameter>
+        <parameter name="CONNECTION_TIMEOUT">60000</parameter>
+    </transportSender>
+    <!--<transportSender name="java"-->
+    <!--class="org.apache.axis2.transport.java.JavaTransportSender"/>-->
+
+
+    <!-- ================================================= -->
+    <!--  SOAP Role Configuration                          -->
+    <!-- ================================================= -->
+    <!-- Use the following pattern to configure this axis2
+         instance to act in particular roles. Note that in
+         the absence of any configuration, Axis2 will act 
+         only in the ultimate receiver role -->
+    <!--
+    <SOAPRoleConfiguration isUltimateReceiver="true">
+    	<role>http://my/custom/role</role>
+    </SOAPRoleConfiguration>
+	-->
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="InFlow">
+        <!--  System pre-defined phases       -->
+        <phase name="Transport">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+        </phase>
+        <phase name="Addressing">
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+                <order phase="Addressing"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
+
+            <handler name="HTTPLocationBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
+        </phase>
+        <phase name="RMPhase"/>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
+        <phase name="OperationInPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFlow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationOutPhase"/>
+        <!--system predefined phase-->
+        <!--these phase will run irrespective of the service-->
+        <phase name="RMPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+    <phaseOrder type="InFaultFlow">
+        <phase name="Addressing">
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+                <order phase="Addressing"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
+
+            <handler name="HTTPLocationBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
+        </phase>
+        <phase name="RMPhase"/>
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationInFaultPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFaultFlow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationOutFaultPhase"/>
+        <phase name="RMPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+</axisconfig>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/broker-config.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/broker-config.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/broker-config.xml
new file mode 100644
index 0000000..6ceb834
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/broker-config.xml
@@ -0,0 +1,55 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<eventBroker xmlns="http://wso2.org/ns/2009/09/eventing">
+    <eventStream name="RegistryEventBroker">
+        <subscriptionManager class="org.wso2.carbon.event.broker.subscriptions.EmbeddedRegistryBasedSubscriptionManager">
+            <parameter name="topicHeaderName">topic</parameter>
+            <parameter name="topicHeaderNS">http://wso2.org/ns/2009/09/eventing/notify</parameter>
+            <parameter name="subscriptionStoragePath">/repository/components/org.wso2.carbon.event</parameter>
+        </subscriptionManager>
+        <!-- Uncomment to to RemoteRegistryBasedSubscriptionManager -->
+        <!--subscriptionManager class="org.wso2.carbon.event.broker.subscriptions.RemoteRegistryBasedSubscriptionManager">
+            <parameter name="topicHeaderName">topic</parameter>
+            <parameter name="topicHeaderNS">http://wso2.org/ns/2009/09/eventing/notify</parameter>
+            <parameter name="subscriptionStoragePath">/repository/components/org.wso2.carbon.event</parameter>
+            <parameter name="registryURL">http://remote-ip:port/registry/</parameter>
+            <parameter name="username">username</parameter>
+            <parameter name="password">password</parameter>
+        </subscriptionManager-->
+        <eventDispatcher>org.wso2.carbon.registry.eventing.RegistryEventDispatcher</eventDispatcher>
+        <notificationManager class="org.wso2.carbon.event.broker.CarbonNotificationManager">
+            <parameter name="minSpareThreads">25</parameter>
+            <parameter name="maxThreads">150</parameter>
+            <parameter name="maxQueuedRequests">100</parameter>
+            <!-- Keep Alive time in nano seconds -->
+            <parameter name="keepAliveTime">1000</parameter>
+            <!-- Specify path of security policy file to enable security. -->
+            <!--parameter name="securityPolicy">policypath</parameter-->
+
+            <!-- Parameters specific to the Registry Event Broker configuration -->
+            <!-- Set this as false to disable displaying of registry URL in notification e-mails -->
+            <parameter name="showRegistryURL" locked="true">true</parameter>
+            <!-- Set this to print the powered-by message in notification e-mails. -->
+            <parameter name="registryPoweredBy" locked="true">This message is automatically generated by the ${product.name}.</parameter>
+            <!-- Set this to customize the URL printed in notification e-mails. -->
+            <!--parameter name="registryURL" locked="true">https://localhost:9443/carbon/</parameter-->
+        </notificationManager>
+    </eventStream>
+</eventBroker>


[14/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/db2.sql
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/db2.sql b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/db2.sql
new file mode 100644
index 0000000..077da05
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/db2.sql
@@ -0,0 +1,450 @@
+CREATE TABLE REG_CLUSTER_LOCK (
+             REG_LOCK_NAME VARCHAR (20) NOT NULL,
+             REG_LOCK_STATUS VARCHAR (20),
+             REG_LOCKED_TIME TIMESTAMP,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (REG_LOCK_NAME)
+);
+
+CREATE TABLE REG_LOG (
+             REG_LOG_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) ,
+             REG_PATH VARCHAR (2000),
+             REG_USER_ID VARCHAR (31) NOT NULL,
+             REG_LOGGED_TIME TIMESTAMP NOT NULL,
+             REG_ACTION INTEGER NOT NULL,
+             REG_ACTION_DATA VARCHAR (500),
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (REG_LOG_ID)
+);
+
+CREATE TABLE REG_PATH(
+             REG_PATH_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
+             REG_PATH_VALUE VARCHAR(2000) NOT NULL,
+             REG_PATH_PARENT_ID INTEGER,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID)
+);
+-- This index cannot be created due to large length of REG_PATH_VALUE column - sumedha
+--CREATE UNIQUE INDEX REG_PATH_IND_BY_PATH_PATH_VALUE ON REG_PATH(REG_PATH_VALUE);
+
+CREATE TABLE REG_CONTENT (
+             REG_CONTENT_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
+             REG_CONTENT_DATA BLOB(2G),
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID)
+);
+
+CREATE TABLE REG_CONTENT_HISTORY (
+             REG_CONTENT_ID INTEGER NOT NULL,
+             REG_CONTENT_DATA BLOB(2G),
+             REG_DELETED   SMALLINT,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID)
+);
+
+CREATE TABLE REG_RESOURCE (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR(256),
+            REG_VERSION         INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
+            REG_MEDIA_TYPE      VARCHAR(500),
+            REG_CREATOR         VARCHAR(31) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR(31),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION)
+            /**CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(PATH_ID,NAME,VERSION)*/
+);
+
+ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
+ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID);
+CREATE UNIQUE INDEX REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME);
+CREATE UNIQUE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME);
+
+CREATE TABLE REG_RESOURCE_HISTORY (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR(256),
+            REG_VERSION         INTEGER NOT NULL,
+            REG_MEDIA_TYPE      VARCHAR(500),
+            REG_CREATOR         VARCHAR(31) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR(31),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_DELETED         SMALLINT,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION)
+);
+
+ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
+ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID);
+CREATE UNIQUE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME);
+CREATE UNIQUE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME);
+
+CREATE TABLE REG_COMMENT (
+            REG_ID        INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
+            REG_COMMENT_TEXT      VARCHAR(500) NOT NULL,
+            REG_USER_ID           VARCHAR(31) NOT NULL,
+            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID)
+);
+
+CREATE TABLE REG_RESOURCE_COMMENT (
+            REG_COMMENT_ID          INTEGER NOT NULL,
+            REG_VERSION             INTEGER NOT NULL,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_COMMENT PRIMARY KEY(REG_VERSION, REG_COMMENT_ID)
+);
+
+ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
+ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID) REFERENCES REG_COMMENT (REG_ID);
+CREATE UNIQUE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME);
+CREATE UNIQUE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION  ON REG_RESOURCE_COMMENT(REG_VERSION);
+
+CREATE TABLE REG_RATING (
+            REG_ID     INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
+            REG_RATING        INTEGER NOT NULL,
+            REG_USER_ID       VARCHAR(31) NOT NULL,
+            REG_RATED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID)
+);
+
+CREATE TABLE REG_RESOURCE_RATING (
+            REG_RATING_ID           INTEGER NOT NULL,
+            REG_VERSION             INTEGER NOT NULL,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_RATING PRIMARY KEY(REG_VERSION, REG_RATING_ID)
+);
+
+ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
+ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID) REFERENCES REG_RATING (REG_ID);
+CREATE UNIQUE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME);
+CREATE UNIQUE INDEX REG_RESOURCE_RATING_IND_BY_VERSION  ON REG_RESOURCE_RATING(REG_VERSION);
+
+
+CREATE TABLE REG_TAG (
+            REG_ID         INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
+            REG_TAG_NAME       VARCHAR(500) NOT NULL,
+            REG_USER_ID        VARCHAR(31) NOT NULL,
+            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID)
+);
+
+CREATE TABLE REG_RESOURCE_TAG (
+            REG_TAG_ID              INTEGER NOT NULL,
+            REG_VERSION             INTEGER NOT NULL,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_TAG PRIMARY KEY(REG_VERSION, REG_TAG_ID)
+);
+
+ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
+ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID) REFERENCES REG_TAG (REG_ID);
+CREATE UNIQUE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME);
+CREATE UNIQUE INDEX REG_RESOURCE_TAG_IND_BY_VERSION  ON REG_RESOURCE_TAG(REG_VERSION);
+
+CREATE TABLE REG_PROPERTY (
+            REG_ID         INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
+            REG_NAME       VARCHAR(100) NOT NULL,
+            REG_VALUE        VARCHAR(1000),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID)
+);
+
+CREATE TABLE REG_RESOURCE_PROPERTY (
+            REG_PROPERTY_ID         INTEGER NOT NULL,
+            REG_VERSION             INTEGER NOT NULL,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_PROPERTY PRIMARY KEY(REG_VERSION, REG_PROPERTY_ID)
+);
+
+ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
+ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID) REFERENCES REG_PROPERTY (REG_ID);
+CREATE UNIQUE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME);
+CREATE UNIQUE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION  ON REG_RESOURCE_PROPERTY(REG_VERSION);
+
+-- CREATE TABLE REG_ASSOCIATIONS (
+-- SRC_PATH_ID     INTEGER,
+-- SRC_RESOURCE_NAME    VARCHAR(256),
+-- SRC_VERSION     INTEGER,
+-- TGT_PATH_ID     INTEGER,
+-- TGT_RESOURCE_NAME    VARCHAR(256),
+-- TGT_VERSION     INTEGER
+-- );
+-- 
+-- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_SRC_PATH_ID FOREIGN KEY (SRC_PATH_ID) REFERENCES REG_PATH (PATH_ID);
+-- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_TGT_PATH_ID FOREIGN KEY (TGT_PATH_ID) REFERENCES REG_PATH (PATH_ID);
+-- CREATE UNIQUE INDEX REG_ASSOCIATIONS_IND_BY_SRC_VERSION ON REG_ASSOCIATIONS(SRC_VERSION);
+-- CREATE UNIQUE INDEX REG_ASSOCIATIONS_IND_BY_TGT_VERSION ON REG_ASSOCIATIONS(TGT_VERSION);
+-- CREATE UNIQUE INDEX REG_ASSOCIATIONS_IND_BY_SRC_RESOURCE_NAME ON REG_ASSOCIATIONS(SRC_RESOURCE_NAME);
+-- CREATE UNIQUE INDEX REG_ASSOCIATIONS_IND_BY_TGT_RESOURCE_NAME ON REG_ASSOCIATIONS(TGT_RESOURCE_NAME);
+
+
+
+--had to reduce REG_SOURCEPATH from 2000 to 1700, REG_TARGETPATH from 2000 to 1700 and REG_ASSOCIATION_TYPE from 2000 to 500
+CREATE TABLE REG_ASSOCIATION (
+            REG_ASSOCIATION_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
+            REG_SOURCEPATH VARCHAR(1700) NOT NULL,
+            REG_TARGETPATH VARCHAR(1700) NOT NULL,
+            REG_ASSOCIATION_TYPE VARCHAR(500) NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (REG_ASSOCIATION_ID)
+);
+
+CREATE TABLE REG_SNAPSHOT (
+            REG_SNAPSHOT_ID     INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
+            REG_PATH_ID            INTEGER NOT NULL,
+            REG_RESOURCE_NAME      VARCHAR(255),
+            REG_RESOURCE_VIDS     BLOB(2G) NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID)
+);
+
+CREATE UNIQUE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME);
+
+ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
+
+
+-- ################################
+-- USER MANAGER TABLES
+-- ################################
+
+CREATE TABLE UM_USER ( 
+             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+             UM_USER_NAME VARCHAR(255) NOT NULL, 
+             UM_USER_PASSWORD VARCHAR(255) NOT NULL,
+             UM_SALT_VALUE VARCHAR(31),
+             UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE,
+             UM_CHANGED_TIME TIMESTAMP NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             PRIMARY KEY (UM_ID), 
+             UNIQUE(UM_USER_NAME) 
+); 
+
+CREATE TABLE UM_ROLE ( 
+             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+             UM_ROLE_NAME VARCHAR(255) NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,  
+             PRIMARY KEY (UM_ID), 
+             UNIQUE(UM_ROLE_NAME) 
+); 
+
+CREATE TABLE UM_ROLE_ATTRIBUTE ( 
+             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+             UM_ATTR_NAME VARCHAR(255) NOT NULL, 
+             UM_ATTR_VALUE VARCHAR(255), 
+             UM_ROLE_ID INTEGER,
+             UM_TENANT_ID INTEGER DEFAULT 0,  
+             FOREIGN KEY (UM_ROLE_ID) REFERENCES UM_ROLE(UM_ID), 
+             PRIMARY KEY (UM_ID) 
+); 
+
+CREATE TABLE UM_PERMISSION ( 
+             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+             UM_RESOURCE_ID VARCHAR(255) NOT NULL, 
+             UM_ACTION VARCHAR(255) NOT NULL, 
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             PRIMARY KEY (UM_ID) 
+); 
+
+CREATE UNIQUE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION 
+                    ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION); 
+
+CREATE TABLE UM_ROLE_PERMISSION ( 
+             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+             UM_PERMISSION_ID INTEGER NOT NULL, 
+             UM_ROLE_ID INTEGER NOT NULL, 
+             UM_IS_ALLOWED SMALLINT NOT NULL, 
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             FOREIGN KEY (UM_PERMISSION_ID) REFERENCES UM_PERMISSION(UM_ID) ON DELETE CASCADE, 
+             FOREIGN KEY (UM_ROLE_ID) REFERENCES UM_ROLE(UM_ID), 
+             PRIMARY KEY (UM_ID) 
+); 
+-- REMOVED UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID) 
+ 
+
+CREATE TABLE UM_USER_PERMISSION ( 
+             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+             UM_PERMISSION_ID INTEGER NOT NULL, 
+             UM_USER_ID INTEGER NOT NULL, 
+             UM_IS_ALLOWED SMALLINT NOT NULL,             
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             FOREIGN KEY (UM_PERMISSION_ID) REFERENCES UM_PERMISSION(UM_ID) ON DELETE CASCADE , 
+             FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID), 
+             PRIMARY KEY (UM_ID) 
+); 
+-- REMOVED UNIQUE (UM_PERMISSION_ID, UM_USER_ID) 
+
+CREATE TABLE UM_USER_ROLE ( 
+             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+             UM_ROLE_ID INTEGER NOT NULL, 
+             UM_USER_ID INTEGER NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,  
+             UNIQUE (UM_USER_ID, UM_ROLE_ID), 
+             FOREIGN KEY (UM_ROLE_ID) REFERENCES UM_ROLE(UM_ID), 
+             FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID), 
+             PRIMARY KEY (UM_ID) 
+); 
+
+
+CREATE TABLE UM_USER_DATA ( 
+       UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+       UM_USER_ID INTEGER NOT NULL, 
+       UM_EMAIL VARCHAR(255), 
+       UM_FIRST_NAME VARCHAR(150), 
+       UM_LAST_NAME VARCHAR(150), 
+       UM_BIRTH_DATE VARCHAR(100), 
+       UM_FULL_NAME VARCHAR(255), 
+       UM_NAME_PREFIX VARCHAR(30), 
+       UM_GENDER VARCHAR(10), 
+       UM_TIME_ZONE VARCHAR(100), 
+       UM_COMPANY_NAME VARCHAR(255), 
+       UM_JOB_TITLE VARCHAR(150), 
+       UM_PRIMARY_PHONE VARCHAR(100), 
+       UM_HOME_PHONE VARCHAR(100), 
+       UM_WORK_PHONE VARCHAR(100), 
+       UM_MOBILE_PHONE VARCHAR(100), 
+       UM_STREET_ADDRESS VARCHAR(255), 
+       UM_CITY VARCHAR(100), 
+       UM_STATE VARCHAR(100), 
+       UM_COUNTRY VARCHAR(50), 
+       UM_POSTAL_CODE VARCHAR(50), 
+       UM_WEB_PAGE VARCHAR(255), 
+       UM_LANGUAGE VARCHAR(255), 
+       UM_BLOG VARCHAR(255), 
+       UM_PROFILE_ID VARCHAR(50),
+       UM_TENANT_ID INTEGER DEFAULT 0,  
+       FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID), 
+       PRIMARY KEY (UM_ID) 
+); 
+
+
+CREATE TABLE UM_BIN_DATA ( 
+            UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+            UM_USER_ID INTEGER NOT NULL, 
+            UM_CONTENT_NAME VARCHAR(255) NOT NULL, 
+            UM_CONTENT BLOB NOT NULL, 
+            UM_PROFILE_ID VARCHAR(255) NOT NULL, 
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID), 
+            PRIMARY KEY (UM_ID) 
+); 
+
+
+CREATE TABLE UM_USER_ATTRIBUTE ( 
+            UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+            UM_ATTR_NAME VARCHAR(255) NOT NULL, 
+            UM_ATTR_VALUE VARCHAR(1024), 
+            UM_PROFILE_ID VARCHAR(255), 
+            UM_USER_ID INTEGER, 
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID), 
+            PRIMARY KEY (UM_ID) 
+); 
+
+
+
+CREATE TABLE UM_DIALECT( 
+            UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+            UM_DIALECT_URI VARCHAR(255) NOT NULL, 
+            UM_REALM VARCHAR(63) NOT NULL,
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            UNIQUE(UM_DIALECT_URI, UM_REALM), 
+            PRIMARY KEY (UM_ID) 
+); 
+
+CREATE TABLE UM_CLAIM( 
+            UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+            UM_DIALECT_ID INTEGER NOT NULL, 
+            UM_CLAIM_URI VARCHAR(255) NOT NULL, 
+            UM_DISPLAY_TAG VARCHAR(255), 
+            UM_DESCRIPTION VARCHAR(255), 
+            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
+            UM_REG_EX VARCHAR(255), 
+            UM_SUPPORTED SMALLINT, 
+            UM_REQUIRED SMALLINT, 
+            UM_DISPLAY_ORDER INTEGER,
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI), 
+            FOREIGN KEY(UM_DIALECT_ID) REFERENCES UM_DIALECT(UM_ID), 
+            PRIMARY KEY (UM_ID) 
+); 
+
+CREATE TABLE UM_PROFILE_CONFIG( 
+            UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+            UM_DIALECT_ID INTEGER NOT NULL, 
+            UM_PROFILE_NAME VARCHAR(255), 
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            FOREIGN KEY(UM_DIALECT_ID) REFERENCES UM_DIALECT(UM_ID), 
+            PRIMARY KEY (UM_ID) 
+); 
+    
+CREATE TABLE UM_CLAIM_BEHAVIOR( 
+            UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+            UM_PROFILE_ID INTEGER, 
+            UM_CLAIM_ID INTEGER, 
+            UM_BEHAVIOUR SMALLINT, 
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            FOREIGN KEY(UM_PROFILE_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID), 
+            FOREIGN KEY(UM_CLAIM_ID) REFERENCES UM_CLAIM(UM_ID), 
+            PRIMARY KEY (UM_ID) 
+); 
+
+CREATE TABLE HYBRID_ROLE ( 
+             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+             UM_ROLE_ID VARCHAR(255) NOT NULL, 
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             PRIMARY KEY (UM_ID), 
+             UNIQUE(UM_ROLE_ID) 
+); 
+
+CREATE TABLE HYBRID_USER_ROLE ( 
+             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+             UM_USER_ID VARCHAR(255), 
+             UM_ROLE_ID VARCHAR(255) NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,  
+             PRIMARY KEY (UM_ID) 
+); 
+
+CREATE TABLE HYBRID_PERMISSION ( 
+             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+             UM_RESOURCE_ID VARCHAR(255), 
+             UM_ACTION VARCHAR(255) NOT NULL, 
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             PRIMARY KEY (UM_ID) 
+); 
+
+CREATE TABLE HYBRID_ROLE_PERMISSION ( 
+             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+             UM_PERMISSION_ID INTEGER NOT NULL, 
+             UM_ROLE_ID VARCHAR(255) NOT NULL, 
+             UM_IS_ALLOWED SMALLINT NOT NULL, 
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID), 
+             FOREIGN KEY (UM_PERMISSION_ID) REFERENCES HYBRID_PERMISSION(UM_ID), 
+             PRIMARY KEY (UM_ID) 
+); 
+
+CREATE TABLE HYBRID_USER_PERMISSION ( 
+             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
+             UM_PERMISSION_ID INTEGER NOT NULL, 
+             UM_USER_ID VARCHAR(255) NOT NULL, 
+             UM_IS_ALLOWED SMALLINT NOT NULL, 
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             UNIQUE (UM_PERMISSION_ID, UM_USER_ID), 
+             FOREIGN KEY (UM_PERMISSION_ID) REFERENCES HYBRID_PERMISSION(UM_ID), 
+             PRIMARY KEY (UM_ID) 
+);

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/derby.sql
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/derby.sql b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/derby.sql
new file mode 100644
index 0000000..2253785
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/derby.sql
@@ -0,0 +1,364 @@
+CREATE TABLE REG_CLUSTER_LOCK (
+             REG_LOCK_NAME VARCHAR (20),
+             REG_LOCK_STATUS VARCHAR (20),
+             REG_LOCKED_TIME TIMESTAMP,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (REG_LOCK_NAME)
+);
+
+CREATE TABLE REG_LOG (
+             REG_LOG_ID INTEGER GENERATED ALWAYS AS IDENTITY,
+             REG_PATH VARCHAR (2000),
+             REG_USER_ID VARCHAR (31) NOT NULL,
+             REG_LOGGED_TIME TIMESTAMP NOT NULL,
+             REG_ACTION INTEGER NOT NULL,
+             REG_ACTION_DATA VARCHAR (500),
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE REG_PATH(
+             REG_PATH_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+             REG_PATH_VALUE VARCHAR(2000) NOT NULL,
+             REG_PATH_PARENT_ID INT,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID)
+);
+CREATE INDEX REG_PATH_IND_BY_PATH_VALUE ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID);
+CREATE INDEX REG_PATH_IND_BY_PARENT_ID ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID);
+
+CREATE TABLE REG_CONTENT (
+             REG_CONTENT_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+             REG_CONTENT_DATA BLOB,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE REG_CONTENT_HISTORY (
+             REG_CONTENT_ID INTEGER NOT NULL,
+             REG_CONTENT_DATA BLOB,
+             REG_DELETED   SMALLINT,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE REG_RESOURCE (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR(256),
+            REG_VERSION         INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+            REG_MEDIA_TYPE      VARCHAR(500),
+            REG_CREATOR         VARCHAR(31) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR(31),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
+);
+
+ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
+
+CREATE TABLE REG_RESOURCE_HISTORY (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR(256),
+            REG_VERSION         INTEGER DEFAULT 0,
+            REG_MEDIA_TYPE      VARCHAR(500),
+            REG_CREATOR         VARCHAR(31) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR(31),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_DELETED         SMALLINT,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
+);
+
+ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
+
+CREATE TABLE REG_COMMENT (
+            REG_ID        INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+            REG_COMMENT_TEXT      VARCHAR(500) NOT NULL,
+            REG_USER_ID           VARCHAR(31) NOT NULL,
+            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE REG_RESOURCE_COMMENT (
+            REG_COMMENT_ID          INTEGER NOT NULL,
+            REG_VERSION             INTEGER DEFAULT 0,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+);
+
+
+ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID);
+
+CREATE TABLE REG_RATING (
+            REG_ID     INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+            REG_RATING        INTEGER NOT NULL,
+            REG_USER_ID       VARCHAR(31) NOT NULL,
+            REG_RATED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE REG_RESOURCE_RATING (
+            REG_RATING_ID           INTEGER NOT NULL,
+            REG_VERSION             INTEGER DEFAULT 0,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+);
+
+ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID);
+
+CREATE TABLE REG_TAG (
+            REG_ID         INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+            REG_TAG_NAME       VARCHAR(500) NOT NULL,
+            REG_USER_ID        VARCHAR(31) NOT NULL,
+            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE REG_RESOURCE_TAG (
+            REG_TAG_ID              INTEGER NOT NULL,
+            REG_VERSION             INTEGER DEFAULT 0,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+);
+
+ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID);
+
+CREATE TABLE REG_PROPERTY (
+            REG_ID         INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+            REG_NAME       VARCHAR(100) NOT NULL,
+            REG_VALUE        VARCHAR(1000),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE REG_RESOURCE_PROPERTY (
+            REG_PROPERTY_ID         INTEGER NOT NULL,
+            REG_VERSION             INTEGER DEFAULT 0,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+);
+
+ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID);
+
+-- CREATE TABLE REG_ASSOCIATION (
+-- SRC_PATH_ID     INTEGER,
+-- SRC_RESOURCE_NAME    VARCHAR(256),
+-- SRC_VERSION     INTEGER,
+-- TGT_PATH_ID     INTEGER,
+-- TGT_RESOURCE_NAME    VARCHAR(256),
+-- TGT_VERSION     INTEGER
+-- );
+--
+-- ALTER TABLE REG_ASSOCIATION ADD CONSTRAINT REG_ASSOCIATION_FK_BY_SRC_PATH_ID FOREIGN KEY (SRC_PATH_ID) REFERENCES REG_PATH (PATH_ID);
+-- ALTER TABLE REG_ASSOCIATION ADD CONSTRAINT REG_ASSOCIATION_FK_BY_TGT_PATH_ID FOREIGN KEY (TGT_PATH_ID) REFERENCES REG_PATH (PATH_ID);
+-- CREATE INDEX REG_ASSOCIATION_IND_BY_SRC_VERSION ON REG_ASSOCIATION(SRC_VERSION);
+-- CREATE INDEX REG_ASSOCIATION_IND_BY_TGT_VERSION ON REG_ASSOCIATION(TGT_VERSION);
+-- CREATE INDEX REG_ASSOCIATION_IND_BY_SRC_RESOURCE_NAME ON REG_ASSOCIATION(SRC_RESOURCE_NAME);
+-- CREATE INDEX REG_ASSOCIATION_IND_BY_TGT_RESOURCE_NAME ON REG_ASSOCIATION(TGT_RESOURCE_NAME);
+
+
+
+CREATE TABLE REG_ASSOCIATION (
+            REG_ASSOCIATION_ID INTEGER GENERATED ALWAYS AS IDENTITY,
+            REG_SOURCEPATH VARCHAR (2000) NOT NULL,
+            REG_TARGETPATH VARCHAR (2000) NOT NULL,
+            REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE REG_SNAPSHOT (
+            REG_SNAPSHOT_ID     INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+            REG_PATH_ID            INTEGER NOT NULL,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_RESOURCE_VIDS     BLOB NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID)
+);
+
+CREATE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+
+ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+
+
+-- ################################
+-- USER MANAGER TABLES
+-- ################################
+
+CREATE TABLE UM_TENANT (
+			UM_ID INTEGER  GENERATED ALWAYS AS IDENTITY,
+			UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
+    			UM_EMAIL VARCHAR(255),
+	                UM_ACTIVE BOOLEAN DEFAULT FALSE,
+			PRIMARY KEY (UM_ID),
+			UNIQUE(UM_DOMAIN_NAME));
+
+CREATE TABLE UM_USER (
+             UM_ID INTEGER GENERATED ALWAYS AS IDENTITY,
+             UM_USER_NAME VARCHAR(255) NOT NULL,
+             UM_USER_PASSWORD VARCHAR(255) NOT NULL,
+             UM_SALT_VALUE VARCHAR(31),
+             UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE,
+             UM_CHANGED_TIME TIMESTAMP NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (UM_ID, UM_TENANT_ID),
+             UNIQUE(UM_USER_NAME, UM_TENANT_ID)
+);
+
+CREATE TABLE UM_ROLE (
+             UM_ID INTEGER GENERATED ALWAYS AS IDENTITY,
+             UM_ROLE_NAME VARCHAR(255) NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (UM_ID, UM_TENANT_ID),
+             UNIQUE(UM_ROLE_NAME, UM_TENANT_ID)
+);
+
+
+CREATE TABLE UM_PERMISSION (
+             UM_ID INTEGER GENERATED ALWAYS AS IDENTITY,
+             UM_RESOURCE_ID VARCHAR(255) NOT NULL,
+             UM_ACTION VARCHAR(255) NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION
+                    ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID);
+
+CREATE TABLE UM_ROLE_PERMISSION (
+             UM_ID INTEGER GENERATED ALWAYS AS IDENTITY,
+             UM_PERMISSION_ID INTEGER NOT NULL,
+             UM_ROLE_NAME VARCHAR(255) NOT NULL,
+             UM_IS_ALLOWED SMALLINT NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,
+             --UNIQUE (PERMISSION_ID, UM_ROLE_NAME),
+             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE TABLE UM_USER_PERMISSION (
+             UM_ID INTEGER GENERATED ALWAYS AS IDENTITY,
+             UM_PERMISSION_ID INTEGER NOT NULL,
+             UM_USER_NAME VARCHAR(255) NOT NULL,
+             UM_IS_ALLOWED SMALLINT NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,
+             --UNIQUE (PERMISSION_ID, UM_USER_NAME),
+             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE ,
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE TABLE UM_USER_ROLE (
+             UM_ID INTEGER GENERATED ALWAYS AS IDENTITY,
+             UM_ROLE_ID INTEGER NOT NULL,
+             UM_USER_ID INTEGER NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,
+             UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID),
+             FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID),
+             FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID),
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE TABLE UM_USER_ATTRIBUTE (
+            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY,
+            UM_ATTR_NAME VARCHAR(255) NOT NULL,
+            UM_ATTR_VALUE VARCHAR(1024), 
+            UM_PROFILE_ID VARCHAR(255), 
+            UM_USER_ID INTEGER,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE TABLE UM_DIALECT(
+            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY, 
+            UM_DIALECT_URI VARCHAR(255) NOT NULL,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE TABLE UM_CLAIM(
+            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY, 
+            UM_DIALECT_ID INTEGER NOT NULL, 
+            UM_CLAIM_URI VARCHAR(255) NOT NULL, 
+            UM_DISPLAY_TAG VARCHAR(255), 
+            UM_DESCRIPTION VARCHAR(255), 
+            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
+            UM_REG_EX VARCHAR(255), 
+            UM_SUPPORTED SMALLINT, 
+            UM_REQUIRED SMALLINT, 
+            UM_DISPLAY_ORDER INTEGER,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID),
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE TABLE UM_PROFILE_CONFIG(
+            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY, 
+            UM_DIALECT_ID INTEGER, 
+            UM_PROFILE_NAME VARCHAR(255), 
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+    
+CREATE TABLE UM_CLAIM_BEHAVIOR(
+            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY, 
+            UM_PROFILE_ID INTEGER, 
+            UM_CLAIM_ID INTEGER, 
+            UM_BEHAVIOUR SMALLINT, 
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID), 
+            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE TABLE UM_HYBRID_ROLE(
+            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY,
+            UM_ROLE_NAME VARCHAR(255),
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE TABLE UM_HYBRID_USER_ROLE(
+            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY,
+            UM_USER_NAME VARCHAR(255),
+            UM_ROLE_ID INTEGER NOT NULL,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
+            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/h2.sql
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/h2.sql b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/h2.sql
new file mode 100644
index 0000000..19f81cd
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/h2.sql
@@ -0,0 +1,337 @@
+CREATE TABLE IF NOT EXISTS REG_CLUSTER_LOCK (
+             REG_LOCK_NAME VARCHAR (20),
+             REG_LOCK_STATUS VARCHAR (20),
+             REG_LOCKED_TIME TIMESTAMP,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (REG_LOCK_NAME)
+);
+
+CREATE TABLE IF NOT EXISTS REG_LOG (
+             REG_LOG_ID INTEGER AUTO_INCREMENT,
+             REG_PATH VARCHAR (2000),
+             REG_USER_ID VARCHAR (31) NOT NULL,
+             REG_LOGGED_TIME TIMESTAMP NOT NULL,
+             REG_ACTION INTEGER NOT NULL,
+             REG_ACTION_DATA VARCHAR (500),
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE IF NOT EXISTS REG_PATH(
+             REG_PATH_ID INTEGER NOT NULL AUTO_INCREMENT,
+             REG_PATH_VALUE VARCHAR(2000) NOT NULL,
+             REG_PATH_PARENT_ID INT,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID)
+);
+CREATE INDEX IF NOT EXISTS REG_PATH_IND_BY_NAME ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_PATH_IND_BY_PARENT_ID ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID);
+
+
+CREATE TABLE IF NOT EXISTS REG_CONTENT (
+             REG_CONTENT_ID INTEGER NOT NULL AUTO_INCREMENT,
+             REG_CONTENT_DATA LONGBLOB,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE IF NOT EXISTS REG_CONTENT_HISTORY (
+             REG_CONTENT_ID INTEGER NOT NULL,
+             REG_CONTENT_DATA LONGBLOB,
+             REG_DELETED   SMALLINT,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE IF NOT EXISTS REG_RESOURCE (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR(256),
+            REG_VERSION         INTEGER NOT NULL AUTO_INCREMENT,
+            REG_MEDIA_TYPE      VARCHAR(500),
+            REG_CREATOR         VARCHAR(31) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR(31),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
+);
+
+ALTER TABLE REG_RESOURCE ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_RESOURCE_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
+
+CREATE TABLE IF NOT EXISTS REG_RESOURCE_HISTORY (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR(256),
+            REG_VERSION         INTEGER NOT NULL,
+            REG_MEDIA_TYPE      VARCHAR(500),
+            REG_CREATOR         VARCHAR(31) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR(31),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_DELETED         SMALLINT,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
+);
+
+ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_RESOURCE_HISTORY_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
+
+CREATE TABLE IF NOT EXISTS REG_COMMENT (
+            REG_ID        INTEGER NOT NULL AUTO_INCREMENT,
+            REG_COMMENT_TEXT      VARCHAR(500) NOT NULL,
+            REG_USER_ID           VARCHAR(31) NOT NULL,
+            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE IF NOT EXISTS REG_RESOURCE_COMMENT (
+            REG_COMMENT_ID          INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+);
+
+ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_RESOURCE_COMMENT_IND_BY_VERSION ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID);
+
+CREATE TABLE IF NOT EXISTS REG_RATING (
+            REG_ID     INTEGER NOT NULL AUTO_INCREMENT,
+            REG_RATING        INTEGER NOT NULL,
+            REG_USER_ID       VARCHAR(31) NOT NULL,
+            REG_RATED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE IF NOT EXISTS REG_RESOURCE_RATING (
+            REG_RATING_ID           INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+);
+
+ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_RESOURCE_RATING_IND_BY_VERSION ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID);
+
+
+CREATE TABLE IF NOT EXISTS REG_TAG (
+            REG_ID         INTEGER NOT NULL AUTO_INCREMENT,
+            REG_TAG_NAME       VARCHAR(500) NOT NULL,
+            REG_USER_ID        VARCHAR(31) NOT NULL,
+            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE IF NOT EXISTS REG_RESOURCE_TAG (
+            REG_TAG_ID              INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+);
+
+ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_RESOURCE_TAG_IND_BY_VERSION ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID);
+
+CREATE TABLE IF NOT EXISTS REG_PROPERTY (
+            REG_ID         INTEGER NOT NULL AUTO_INCREMENT,
+            REG_NAME       VARCHAR(100) NOT NULL,
+            REG_VALUE        VARCHAR(1000),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE IF NOT EXISTS REG_RESOURCE_PROPERTY (
+            REG_PROPERTY_ID         INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+);
+
+ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_RESOURCE_PROPERTY_IND_BY_VERSION ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID);
+
+CREATE TABLE IF NOT EXISTS REG_ASSOCIATION (
+            REG_ASSOCIATION_ID INTEGER AUTO_INCREMENT,
+            REG_SOURCEPATH VARCHAR (2000) NOT NULL,
+            REG_TARGETPATH VARCHAR (2000) NOT NULL,
+            REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID)
+);
+
+CREATE TABLE IF NOT EXISTS REG_SNAPSHOT (
+            REG_SNAPSHOT_ID     INTEGER NOT NULL AUTO_INCREMENT,
+            REG_PATH_ID            INTEGER NOT NULL,
+            REG_RESOURCE_NAME VARCHAR (256),
+            REG_RESOURCE_VIDS     LONGBLOB NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID)
+);
+
+ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT IF NOT EXISTS REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+CREATE INDEX IF NOT EXISTS REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+
+-- ################################
+-- USER MANAGER TABLES
+-- ################################
+
+CREATE TABLE IF NOT EXISTS UM_TENANT (
+			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+			UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
+	                UM_EMAIL VARCHAR(255),
+	                UM_ACTIVE BOOLEAN DEFAULT FALSE,
+            UM_CREATED_DATE TIMESTAMP NOT NULL,
+			PRIMARY KEY (UM_ID),
+			UNIQUE(UM_DOMAIN_NAME));
+
+CREATE TABLE IF NOT EXISTS UM_USER (
+			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+			UM_USER_NAME VARCHAR(255) NOT NULL,
+			UM_USER_PASSWORD VARCHAR(255) NOT NULL,
+			UM_SALT_VALUE VARCHAR(31),
+			UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE,
+            UM_CHANGED_TIME TIMESTAMP NOT NULL,
+			UM_TENANT_ID INTEGER DEFAULT 0,
+			PRIMARY KEY (UM_ID, UM_TENANT_ID),
+			UNIQUE(UM_USER_NAME, UM_TENANT_ID));
+
+CREATE TABLE IF NOT EXISTS UM_USER_ATTRIBUTE (
+			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+			UM_ATTR_NAME VARCHAR(255) NOT NULL,
+			UM_ATTR_VALUE VARCHAR(1024),
+            UM_PROFILE_ID VARCHAR(255),
+            UM_USER_ID INTEGER,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+			PRIMARY KEY (UM_ID, UM_TENANT_ID),
+			FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID));
+
+CREATE TABLE IF NOT EXISTS UM_ROLE (
+			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+			UM_ROLE_NAME VARCHAR(255) NOT NULL,
+			UM_TENANT_ID INTEGER DEFAULT 0,
+			PRIMARY KEY (UM_ID, UM_TENANT_ID),
+			UNIQUE(UM_ROLE_NAME, UM_TENANT_ID));
+
+CREATE TABLE IF NOT EXISTS UM_PERMISSION (
+			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+			UM_RESOURCE_ID VARCHAR(255) NOT NULL,
+			UM_ACTION VARCHAR(255) NOT NULL,
+			UM_TENANT_ID INTEGER DEFAULT 0,
+			PRIMARY KEY (UM_ID, UM_TENANT_ID));
+
+CREATE INDEX IF NOT EXISTS INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID);
+
+CREATE TABLE IF NOT EXISTS UM_ROLE_PERMISSION (
+			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+			UM_PERMISSION_ID INTEGER NOT NULL,
+			UM_ROLE_NAME VARCHAR(255) NOT NULL,
+            UM_IS_ALLOWED SMALLINT NOT NULL,
+			UM_TENANT_ID INTEGER DEFAULT 0,
+			UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID),
+			FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID),
+			PRIMARY KEY (UM_ID, UM_TENANT_ID));
+
+CREATE TABLE IF NOT EXISTS UM_USER_PERMISSION (
+			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+			UM_PERMISSION_ID INTEGER NOT NULL,
+			UM_USER_NAME VARCHAR(255) NOT NULL,
+            UM_IS_ALLOWED SMALLINT NOT NULL,
+			UNIQUE (UM_PERMISSION_ID, UM_USER_NAME, UM_TENANT_ID),
+			UM_TENANT_ID INTEGER DEFAULT 0,
+			FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID),
+			PRIMARY KEY (UM_ID, UM_TENANT_ID));
+
+CREATE TABLE IF NOT EXISTS UM_USER_ROLE (
+			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+			UM_ROLE_ID INTEGER NOT NULL,
+			UM_USER_ID INTEGER NOT NULL,
+			UM_TENANT_ID INTEGER DEFAULT 0,
+			UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID),
+			FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID),
+			FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID),
+			PRIMARY KEY (UM_ID, UM_TENANT_ID));
+
+CREATE TABLE IF NOT EXISTS UM_DIALECT(
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+            UM_DIALECT_URI VARCHAR(255) NOT NULL,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+
+CREATE TABLE IF NOT EXISTS UM_CLAIM(
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+            UM_DIALECT_ID INTEGER NOT NULL,
+            UM_CLAIM_URI VARCHAR(255) NOT NULL,
+            UM_DISPLAY_TAG VARCHAR(255),
+            UM_DESCRIPTION VARCHAR(255),
+            UM_MAPPED_ATTRIBUTE VARCHAR(255),
+            UM_REG_EX VARCHAR(255),
+            UM_SUPPORTED SMALLINT,
+            UM_REQUIRED SMALLINT,
+            UM_DISPLAY_ORDER INTEGER,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID),
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE TABLE IF NOT EXISTS UM_PROFILE_CONFIG(
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+            UM_DIALECT_ID INTEGER,
+            UM_PROFILE_NAME VARCHAR(255),
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE TABLE IF NOT EXISTS UM_CLAIM_BEHAVIOR(
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+            UM_PROFILE_ID INTEGER,
+            UM_CLAIM_ID INTEGER,
+            UM_BEHAVIOUR SMALLINT,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID),
+            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE TABLE IF NOT EXISTS UM_HYBRID_ROLE(
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+            UM_ROLE_NAME VARCHAR(255),
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+CREATE TABLE IF NOT EXISTS UM_HYBRID_USER_ROLE(
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+            UM_USER_NAME VARCHAR(255),
+            UM_ROLE_ID INTEGER NOT NULL,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
+            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/mssql.sql
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/mssql.sql b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/mssql.sql
new file mode 100755
index 0000000..1e67fc5
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/mssql.sql
@@ -0,0 +1,494 @@
+--create table REG_CLUSTER_LOCK
+IF NOT  EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_CLUSTER_LOCK]') AND TYPE IN (N'U'))
+CREATE TABLE  REG_CLUSTER_LOCK (
+             REG_LOCK_NAME VARCHAR (20),
+             REG_LOCK_STATUS VARCHAR (20),
+             REG_LOCKED_TIME DATETIME,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (REG_LOCK_NAME)
+);
+
+--create table REG_LOG
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_LOG]') AND TYPE IN (N'U'))
+
+CREATE TABLE REG_LOG (
+             REG_LOG_ID INTEGER IDENTITY(1,1) NOT NULL,
+             REG_PATH VARCHAR (2000),
+             REG_USER_ID VARCHAR (31) NOT NULL,
+             REG_LOGGED_TIME DATETIME NOT NULL,
+             REG_ACTION INTEGER NOT NULL,
+             REG_ACTION_DATA VARCHAR (500),
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID)
+);
+
+--create table regpath
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_PATH]') AND TYPE IN (N'U'))
+CREATE TABLE  REG_PATH(
+             REG_PATH_ID INTEGER IDENTITY(1,1) NOT NULL,
+             REG_PATH_VALUE VARCHAR(895) NOT NULL,
+             REG_PATH_PARENT_ID INTEGER,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID)
+);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_PATH_IND_BY_PATH_VALUE')
+DROP INDEX REG_PATH.REG_PATH_IND_BY_PATH_VALUE
+CREATE INDEX REG_PATH_IND_BY_PATH_VALUE ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID);
+
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_PATH_IND_BY_PARENT_ID')
+DROP INDEX REG_PATH.REG_PATH_IND_BY_PARENT_ID
+CREATE INDEX REG_PATH_IND_BY_PARENT_ID ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID);
+--create table regcontent
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_CONTENT]') AND TYPE IN (N'U'))
+CREATE TABLE  REG_CONTENT (
+             REG_CONTENT_ID INTEGER IDENTITY(1,1) NOT NULL,
+             REG_CONTENT_DATA VARBINARY(MAX),
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
+);
+
+--create table REG_CONTENT_HISTORY
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_CONTENT_HISTORY]') AND TYPE IN (N'U'))
+CREATE TABLE  REG_CONTENT_HISTORY (
+             REG_CONTENT_ID INTEGER NOT NULL,
+             REG_CONTENT_DATA VARBINARY(MAX),
+             REG_DELETED   SMALLINT,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
+);
+
+
+--create table REG_RESOURCE
+IF NOT  EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE]') AND TYPE IN (N'U'))
+CREATE TABLE  REG_RESOURCE (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR(256),
+            REG_VERSION          INTEGER IDENTITY(1,1) NOT NULL,
+            REG_MEDIA_TYPE      VARCHAR(500),
+            REG_CREATOR         VARCHAR(31) NOT NULL,
+            REG_CREATED_TIME    DATETIME NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR(31),
+            REG_LAST_UPDATED_TIME   DATETIME NOT NULL,
+            REG_DESCRIPTION     VARCHAR(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_TENANT_ID INTEGER DEFAULT 0
+            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
+);
+
+IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_FK_BY_PATH_ID]') AND PARENT_OBJECT_ID = OBJECT_ID(N'DBO.[REG_RESOURCE]'))
+ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+
+--This foriegn key constrainst is maintained from the code level
+--IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_FK_BY_CONTENT_ID]') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE]'))
+--ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_IND_BY_NAME')
+DROP INDEX REG_RESOURCE.REG_RESOURCE_IND_BY_NAME
+CREATE INDEX REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME, REG_TENANT_ID);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_IND_BY_PATH_ID_NAME')
+DROP INDEX REG_RESOURCE.REG_RESOURCE_IND_BY_PATH_ID_NAME
+CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
+
+
+--create table REG_RESOURCE_HISTORY
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_HISTORY]') AND TYPE IN (N'U'))
+CREATE TABLE  REG_RESOURCE_HISTORY (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR(256),
+            REG_VERSION         INTEGER NOT NULL,
+            REG_MEDIA_TYPE      VARCHAR(500),
+            REG_CREATOR         VARCHAR(31) NOT NULL,
+            REG_CREATED_TIME    DATETIME NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR(31),
+            REG_LAST_UPDATED_TIME  DATETIME NOT NULL,
+            REG_DESCRIPTION     VARCHAR(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_DELETED         SMALLINT,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
+);
+
+IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE object_id = OBJECT_ID(N'[dbo].[REG_RESOURCE_HIST_FK_BY_PATHID]') AND parent_object_id = OBJECT_ID(N'[dbo].[REG_RESOURCE_HISTORY]'))
+ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+
+IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE object_id = OBJECT_ID(N'[dbo].[REG_RESOURCE_HIST_FK_BY_CONTENT_ID]') AND parent_object_id = OBJECT_ID(N'[dbo].[REG_RESOURCE_HISTORY]'))
+ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_HISTORY_IND_BY_NAME')
+DROP INDEX REG_RESOURCE_HISTORY.REG_RESOURCE_HISTORY_IND_BY_NAME
+CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME')
+DROP INDEX REG_RESOURCE_HISTORY.REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME
+CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME ON REG_RESOURCE_HISTORY(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
+
+--create table REG_COMMENT
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_COMMENT]') AND TYPE IN (N'U'))
+CREATE TABLE  REG_COMMENT (
+            REG_ID      INTEGER IDENTITY(1,1) NOT NULL,
+            REG_COMMENT_TEXT      VARCHAR(500) NOT NULL,
+            REG_USER_ID           VARCHAR(31) NOT NULL,
+            REG_COMMENTED_TIME    DATETIME NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+--create table REG_RESOURCE_COMMENT
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_COMMENT]') AND TYPE IN (N'U'))
+CREATE TABLE  REG_RESOURCE_COMMENT (
+            REG_COMMENT_ID          INTEGER NOT NULL,
+            REG_VERSION             INTEGER DEFAULT 0,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_COMMENT PRIMARY KEY(REG_COMMENT_ID, REG_TENANT_ID)
+);
+
+IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].REG_RESOURCE_COMMENT_FK_BY_PATH_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_COMMENT'))
+ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+
+IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_COMMENT'))
+ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME')
+DROP INDEX REG_RESOURCE_COMMENT.REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME
+CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_COMMENT_IND_BY_VERSION')
+DROP INDEX REG_RESOURCE_COMMENT.REG_RESOURCE_COMMENT_IND_BY_VERSION
+CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID);
+
+--create table  REG_RATING
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RATING]') AND TYPE IN (N'U'))
+CREATE TABLE REG_RATING (
+            REG_ID      INTEGER IDENTITY(1,1) NOT NULL,
+            REG_RATING        INTEGER NOT NULL,
+            REG_USER_ID       VARCHAR(31) NOT NULL,
+            REG_RATED_TIME    DATETIME NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+--create table REG_RESOURCE_RATING
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_RATING]') AND TYPE IN (N'U'))
+CREATE TABLE  REG_RESOURCE_RATING (
+            REG_RATING_ID           INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_RATING PRIMARY KEY(REG_RATING_ID, REG_TENANT_ID)
+);
+
+IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].REG_RESOURCE_RATING_FK_BY_PATH_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[dbo].REG_RESOURCE_RATING'))
+ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+
+IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].REG_RESOURCE_RATING_FK_BY_RATING_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[dbo].REG_RESOURCE_RATING'))
+ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME')
+DROP INDEX REG_RESOURCE_RATING.REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME
+CREATE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_RATING_IND_BY_VERSION')
+DROP INDEX REG_RESOURCE_RATING.REG_RESOURCE_RATING_IND_BY_VERSION
+CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID);
+
+--create table  REG_TAG
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_TAG]') AND TYPE IN (N'U'))
+CREATE TABLE  REG_TAG (
+            REG_ID         INTEGER IDENTITY(1,1) NOT NULL,
+            REG_TAG_NAME       VARCHAR(500) NOT NULL,
+            REG_USER_ID        VARCHAR(31) NOT NULL,
+            REG_TAGGED_TIME    DATETIME NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+
+
+--create table  REG_RESOURCE_TAG
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_TAG]') AND TYPE IN (N'U'))
+CREATE TABLE   REG_RESOURCE_TAG (
+            REG_TAG_ID              INTEGER NOT NULL,
+            REG_VERSION             INTEGER DEFAULT 0,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_TAG PRIMARY KEY(REG_TAG_ID, REG_TENANT_ID)
+);
+
+IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_TAG_FK_BY_PATH_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_TAG'))
+ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+
+IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_TAG_FK_BY_TAG_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_TAG'))
+ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME')
+DROP INDEX REG_RESOURCE_TAG.REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME
+CREATE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_TAG_IND_BY_VERSION')
+DROP INDEX REG_RESOURCE_TAG.REG_RESOURCE_TAG_IND_BY_VERSION
+CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID);
+
+--CREATE TABLE REG_PROPERTY
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_PROPERTY]') AND TYPE IN (N'U'))
+CREATE TABLE REG_PROPERTY (
+            REG_ID        INTEGER IDENTITY(1,1) NOT NULL,
+            REG_NAME       VARCHAR(100) NOT NULL,
+            REG_VALUE        VARCHAR(1000),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID)
+);
+
+--CREATE TABLE REG_RESOURCE_PROPERTY
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_PROPERTY]') AND TYPE IN (N'U'))
+CREATE TABLE  REG_RESOURCE_PROPERTY (
+            REG_PROPERTY_ID         INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_PROPERTY PRIMARY KEY(REG_PROPERTY_ID, REG_TENANT_ID)
+);
+
+IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_PROPERTY_FK_BY_PATH_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_PROPERTY'))
+ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+
+IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_PROPERTY_FK_BY_TAG_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_PROPERTY'))
+ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME')
+DROP INDEX REG_RESOURCE_PROPERTY.REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME
+CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_PROPERTY_IND_BY_VERSION')
+DROP INDEX REG_RESOURCE_PROPERTY.REG_RESOURCE_PROPERTY_IND_BY_VERSION
+CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID);
+
+--CREATE TABLE  REG_ASSOCIATION
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_ASSOCIATION]') AND TYPE IN (N'U'))
+CREATE TABLE  REG_ASSOCIATION (
+            REG_ASSOCIATION_ID  INTEGER IDENTITY(1,1) NOT NULL,
+            REG_SOURCEPATH VARCHAR (2000) NOT NULL,
+            REG_TARGETPATH VARCHAR (2000) NOT NULL,
+            REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID)
+);
+
+--CREATE TABLE  REG_SNAPSHOT
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_SNAPSHOT]') AND TYPE IN (N'U'))
+CREATE TABLE REG_SNAPSHOT (
+            REG_SNAPSHOT_ID     INTEGER IDENTITY(1,1) NOT NULL,
+            REG_PATH_ID            INTEGER NOT NULL,
+            REG_RESOURCE_NAME            VARCHAR (256),
+            REG_RESOURCE_VIDS     VARBINARY(MAX) NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID)
+);
+IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].REG_SNAPSHOT_FK_BY_PATH_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_SNAPSHOT'))
+ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+
+
+IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME')
+DROP INDEX REG_SNAPSHOT.REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME
+CREATE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+
+-- ################################
+-- USER MANAGER TABLES
+-- ################################
+
+--CREATE TABLE   UM_TENANT_
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_TENANT]') AND TYPE IN (N'U'))
+CREATE TABLE UM_TENANT (
+			UM_ID INTEGER IDENTITY(1,1) NOT NULL,
+			UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
+	        UM_EMAIL VARCHAR(255),
+            UM_ACTIVE BIT DEFAULT 0,
+			PRIMARY KEY (UM_ID),
+			UNIQUE(UM_DOMAIN_NAME));
+
+--CREATE TABLE   UM_USER
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_USER]') AND TYPE IN (N'U'))
+CREATE TABLE  UM_USER (
+             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
+             UM_USER_NAME VARCHAR(255) NOT NULL,
+             UM_USER_PASSWORD VARCHAR(255) NOT NULL,
+             UM_SALT_VALUE VARCHAR(31),
+             UM_REQUIRE_CHANGE BIT DEFAULT 0,
+             UM_CHANGED_TIME DATETIME NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (UM_ID, UM_TENANT_ID),
+             UNIQUE(UM_USER_NAME, UM_TENANT_ID)
+);
+
+--CREATE TABLE   UM_USER_ATTRIBUTE
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_USER_ATTRIBUTE]') AND TYPE IN (N'U'))
+CREATE TABLE  UM_USER_ATTRIBUTE (
+             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
+			UM_ATTR_NAME VARCHAR(255) NOT NULL,
+			UM_ATTR_VALUE VARCHAR(1024),
+			UM_PROFILE_ID VARCHAR(255),
+			UM_USER_ID INTEGER,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+			FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID),
+			PRIMARY KEY (UM_ID, UM_TENANT_ID));
+
+--CREATE TABLE   UM_ROLE
+
+IF NOT  EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_ROLE]') AND TYPE IN (N'U'))
+CREATE TABLE UM_ROLE (
+             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
+             UM_ROLE_NAME VARCHAR(255) NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (UM_ID, UM_TENANT_ID),
+             UNIQUE(UM_ROLE_NAME, UM_TENANT_ID)
+);
+
+
+--CREATE TABLE UM_PERMISSION
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_PERMISSION]') AND TYPE IN (N'U'))
+CREATE TABLE  UM_PERMISSION (
+             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
+             UM_RESOURCE_ID VARCHAR(255) NOT NULL,
+             UM_ACTION VARCHAR(255) NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+IF EXISTS (SELECT name FROM sysindexes WHERE name = 'INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION')
+DROP INDEX UM_PERMISSION.INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION
+CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID);
+
+--CREATE TABLE UM_ROLE_PERMISSION
+
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_ROLE_PERMISSION]') AND TYPE IN (N'U'))
+CREATE TABLE  UM_ROLE_PERMISSION (
+             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
+             UM_PERMISSION_ID INTEGER NOT NULL,
+             UM_ROLE_NAME VARCHAR(255) NOT NULL,
+             UM_IS_ALLOWED SMALLINT NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,
+             UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID),
+             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID),
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+--CREATE TABLE UM_USER_PERMISSION
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_USER_PERMISSION]') AND TYPE IN (N'U'))
+CREATE TABLE  UM_USER_PERMISSION (
+             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
+             UM_PERMISSION_ID INTEGER NOT NULL,
+             UM_USER_NAME VARCHAR(255) NOT NULL,
+             UM_IS_ALLOWED SMALLINT NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,
+             UNIQUE (UM_PERMISSION_ID, UM_USER_NAME, UM_TENANT_ID),
+             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID),
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+-- create table UM_USER_ROLE
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_USER_ROLE]') AND TYPE IN (N'U'))
+CREATE TABLE  UM_USER_ROLE (
+             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
+             UM_ROLE_ID INTEGER NOT NULL,
+             UM_USER_ID INTEGER NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,
+             UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID),
+             FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID),
+             FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID),
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+-- create table UM_DIALECT
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_DIALECT]') AND TYPE IN (N'U'))
+CREATE TABLE UM_DIALECT(
+       	    UM_ID INTEGER IDENTITY(1, 1),
+            UM_DIALECT_URI VARCHAR(255),
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+-- create table UM_CLAIM
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_CLAIM]') AND TYPE IN (N'U'))
+CREATE TABLE UM_CLAIM(
+       	UM_ID INTEGER IDENTITY(1, 1),
+            UM_DIALECT_ID INTEGER,
+            UM_CLAIM_URI VARCHAR(255), 
+            UM_DISPLAY_TAG VARCHAR(255), 
+            UM_DESCRIPTION VARCHAR(255), 
+            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
+            UM_REG_EX VARCHAR(255), 
+            UM_SUPPORTED SMALLINT, 
+            UM_REQUIRED SMALLINT, 
+            UM_DISPLAY_ORDER INTEGER, 
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+-- create table UM_PROFILE_CONFIG
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_PROFILE_CONFIG]') AND TYPE IN (N'U'))
+CREATE TABLE UM_PROFILE_CONFIG(
+       	UM_ID INTEGER IDENTITY(1, 1),
+            UM_DIALECT_ID INTEGER, 
+            UM_PROFILE_NAME VARCHAR(255), 
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+-- create table UM_CLAIM_BEHAVIOR
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_CLAIM_BEHAVIOR]') AND TYPE IN (N'U'))
+CREATE TABLE UM_CLAIM_BEHAVIOR(
+       	    UM_ID INTEGER IDENTITY(1, 1),
+            UM_PROFILE_ID INTEGER, 
+            UM_CLAIM_ID INTEGER, 
+            UM_BEHAVIOUR SMALLINT,
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID), 
+            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+-- create table UM_HYBRID_ROLE
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_HYBRID_ROLE]') AND TYPE IN (N'U'))
+CREATE TABLE UM_HYBRID_ROLE(
+            UM_ID INTEGER IDENTITY(1, 1),
+            UM_ROLE_NAME VARCHAR(255),
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+
+-- create table UM_HYBRID_USER_ROLE
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_HYBRID_USER_ROLE]') AND TYPE IN (N'U'))
+CREATE TABLE UM_HYBRID_USER_ROLE(
+            UM_ID INTEGER IDENTITY(1, 1),
+            UM_USER_NAME VARCHAR(255),
+            UM_ROLE_ID INTEGER NOT NULL,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
+            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+);
+


[06/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/db2.sql
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/db2.sql b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/db2.sql
deleted file mode 100644
index 077da05..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/db2.sql
+++ /dev/null
@@ -1,450 +0,0 @@
-CREATE TABLE REG_CLUSTER_LOCK (
-             REG_LOCK_NAME VARCHAR (20) NOT NULL,
-             REG_LOCK_STATUS VARCHAR (20),
-             REG_LOCKED_TIME TIMESTAMP,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (REG_LOCK_NAME)
-);
-
-CREATE TABLE REG_LOG (
-             REG_LOG_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) ,
-             REG_PATH VARCHAR (2000),
-             REG_USER_ID VARCHAR (31) NOT NULL,
-             REG_LOGGED_TIME TIMESTAMP NOT NULL,
-             REG_ACTION INTEGER NOT NULL,
-             REG_ACTION_DATA VARCHAR (500),
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (REG_LOG_ID)
-);
-
-CREATE TABLE REG_PATH(
-             REG_PATH_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
-             REG_PATH_VALUE VARCHAR(2000) NOT NULL,
-             REG_PATH_PARENT_ID INTEGER,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID)
-);
--- This index cannot be created due to large length of REG_PATH_VALUE column - sumedha
---CREATE UNIQUE INDEX REG_PATH_IND_BY_PATH_PATH_VALUE ON REG_PATH(REG_PATH_VALUE);
-
-CREATE TABLE REG_CONTENT (
-             REG_CONTENT_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
-             REG_CONTENT_DATA BLOB(2G),
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID)
-);
-
-CREATE TABLE REG_CONTENT_HISTORY (
-             REG_CONTENT_ID INTEGER NOT NULL,
-             REG_CONTENT_DATA BLOB(2G),
-             REG_DELETED   SMALLINT,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID)
-);
-
-CREATE TABLE REG_RESOURCE (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR(256),
-            REG_VERSION         INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
-            REG_MEDIA_TYPE      VARCHAR(500),
-            REG_CREATOR         VARCHAR(31) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR(31),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION)
-            /**CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(PATH_ID,NAME,VERSION)*/
-);
-
-ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
-ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID);
-CREATE UNIQUE INDEX REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME);
-CREATE UNIQUE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME);
-
-CREATE TABLE REG_RESOURCE_HISTORY (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR(256),
-            REG_VERSION         INTEGER NOT NULL,
-            REG_MEDIA_TYPE      VARCHAR(500),
-            REG_CREATOR         VARCHAR(31) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR(31),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_DELETED         SMALLINT,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION)
-);
-
-ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
-ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID);
-CREATE UNIQUE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME);
-CREATE UNIQUE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME);
-
-CREATE TABLE REG_COMMENT (
-            REG_ID        INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
-            REG_COMMENT_TEXT      VARCHAR(500) NOT NULL,
-            REG_USER_ID           VARCHAR(31) NOT NULL,
-            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID)
-);
-
-CREATE TABLE REG_RESOURCE_COMMENT (
-            REG_COMMENT_ID          INTEGER NOT NULL,
-            REG_VERSION             INTEGER NOT NULL,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_COMMENT PRIMARY KEY(REG_VERSION, REG_COMMENT_ID)
-);
-
-ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
-ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID) REFERENCES REG_COMMENT (REG_ID);
-CREATE UNIQUE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME);
-CREATE UNIQUE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION  ON REG_RESOURCE_COMMENT(REG_VERSION);
-
-CREATE TABLE REG_RATING (
-            REG_ID     INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
-            REG_RATING        INTEGER NOT NULL,
-            REG_USER_ID       VARCHAR(31) NOT NULL,
-            REG_RATED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID)
-);
-
-CREATE TABLE REG_RESOURCE_RATING (
-            REG_RATING_ID           INTEGER NOT NULL,
-            REG_VERSION             INTEGER NOT NULL,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_RATING PRIMARY KEY(REG_VERSION, REG_RATING_ID)
-);
-
-ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
-ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID) REFERENCES REG_RATING (REG_ID);
-CREATE UNIQUE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME);
-CREATE UNIQUE INDEX REG_RESOURCE_RATING_IND_BY_VERSION  ON REG_RESOURCE_RATING(REG_VERSION);
-
-
-CREATE TABLE REG_TAG (
-            REG_ID         INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
-            REG_TAG_NAME       VARCHAR(500) NOT NULL,
-            REG_USER_ID        VARCHAR(31) NOT NULL,
-            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID)
-);
-
-CREATE TABLE REG_RESOURCE_TAG (
-            REG_TAG_ID              INTEGER NOT NULL,
-            REG_VERSION             INTEGER NOT NULL,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_TAG PRIMARY KEY(REG_VERSION, REG_TAG_ID)
-);
-
-ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
-ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID) REFERENCES REG_TAG (REG_ID);
-CREATE UNIQUE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME);
-CREATE UNIQUE INDEX REG_RESOURCE_TAG_IND_BY_VERSION  ON REG_RESOURCE_TAG(REG_VERSION);
-
-CREATE TABLE REG_PROPERTY (
-            REG_ID         INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
-            REG_NAME       VARCHAR(100) NOT NULL,
-            REG_VALUE        VARCHAR(1000),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID)
-);
-
-CREATE TABLE REG_RESOURCE_PROPERTY (
-            REG_PROPERTY_ID         INTEGER NOT NULL,
-            REG_VERSION             INTEGER NOT NULL,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_PROPERTY PRIMARY KEY(REG_VERSION, REG_PROPERTY_ID)
-);
-
-ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
-ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID) REFERENCES REG_PROPERTY (REG_ID);
-CREATE UNIQUE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME);
-CREATE UNIQUE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION  ON REG_RESOURCE_PROPERTY(REG_VERSION);
-
--- CREATE TABLE REG_ASSOCIATIONS (
--- SRC_PATH_ID     INTEGER,
--- SRC_RESOURCE_NAME    VARCHAR(256),
--- SRC_VERSION     INTEGER,
--- TGT_PATH_ID     INTEGER,
--- TGT_RESOURCE_NAME    VARCHAR(256),
--- TGT_VERSION     INTEGER
--- );
--- 
--- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_SRC_PATH_ID FOREIGN KEY (SRC_PATH_ID) REFERENCES REG_PATH (PATH_ID);
--- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_TGT_PATH_ID FOREIGN KEY (TGT_PATH_ID) REFERENCES REG_PATH (PATH_ID);
--- CREATE UNIQUE INDEX REG_ASSOCIATIONS_IND_BY_SRC_VERSION ON REG_ASSOCIATIONS(SRC_VERSION);
--- CREATE UNIQUE INDEX REG_ASSOCIATIONS_IND_BY_TGT_VERSION ON REG_ASSOCIATIONS(TGT_VERSION);
--- CREATE UNIQUE INDEX REG_ASSOCIATIONS_IND_BY_SRC_RESOURCE_NAME ON REG_ASSOCIATIONS(SRC_RESOURCE_NAME);
--- CREATE UNIQUE INDEX REG_ASSOCIATIONS_IND_BY_TGT_RESOURCE_NAME ON REG_ASSOCIATIONS(TGT_RESOURCE_NAME);
-
-
-
---had to reduce REG_SOURCEPATH from 2000 to 1700, REG_TARGETPATH from 2000 to 1700 and REG_ASSOCIATION_TYPE from 2000 to 500
-CREATE TABLE REG_ASSOCIATION (
-            REG_ASSOCIATION_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
-            REG_SOURCEPATH VARCHAR(1700) NOT NULL,
-            REG_TARGETPATH VARCHAR(1700) NOT NULL,
-            REG_ASSOCIATION_TYPE VARCHAR(500) NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (REG_ASSOCIATION_ID)
-);
-
-CREATE TABLE REG_SNAPSHOT (
-            REG_SNAPSHOT_ID     INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
-            REG_PATH_ID            INTEGER NOT NULL,
-            REG_RESOURCE_NAME      VARCHAR(255),
-            REG_RESOURCE_VIDS     BLOB(2G) NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID)
-);
-
-CREATE UNIQUE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME);
-
-ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID) REFERENCES REG_PATH (REG_PATH_ID);
-
-
--- ################################
--- USER MANAGER TABLES
--- ################################
-
-CREATE TABLE UM_USER ( 
-             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-             UM_USER_NAME VARCHAR(255) NOT NULL, 
-             UM_USER_PASSWORD VARCHAR(255) NOT NULL,
-             UM_SALT_VALUE VARCHAR(31),
-             UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE,
-             UM_CHANGED_TIME TIMESTAMP NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             PRIMARY KEY (UM_ID), 
-             UNIQUE(UM_USER_NAME) 
-); 
-
-CREATE TABLE UM_ROLE ( 
-             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-             UM_ROLE_NAME VARCHAR(255) NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,  
-             PRIMARY KEY (UM_ID), 
-             UNIQUE(UM_ROLE_NAME) 
-); 
-
-CREATE TABLE UM_ROLE_ATTRIBUTE ( 
-             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-             UM_ATTR_NAME VARCHAR(255) NOT NULL, 
-             UM_ATTR_VALUE VARCHAR(255), 
-             UM_ROLE_ID INTEGER,
-             UM_TENANT_ID INTEGER DEFAULT 0,  
-             FOREIGN KEY (UM_ROLE_ID) REFERENCES UM_ROLE(UM_ID), 
-             PRIMARY KEY (UM_ID) 
-); 
-
-CREATE TABLE UM_PERMISSION ( 
-             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-             UM_RESOURCE_ID VARCHAR(255) NOT NULL, 
-             UM_ACTION VARCHAR(255) NOT NULL, 
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             PRIMARY KEY (UM_ID) 
-); 
-
-CREATE UNIQUE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION 
-                    ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION); 
-
-CREATE TABLE UM_ROLE_PERMISSION ( 
-             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-             UM_PERMISSION_ID INTEGER NOT NULL, 
-             UM_ROLE_ID INTEGER NOT NULL, 
-             UM_IS_ALLOWED SMALLINT NOT NULL, 
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             FOREIGN KEY (UM_PERMISSION_ID) REFERENCES UM_PERMISSION(UM_ID) ON DELETE CASCADE, 
-             FOREIGN KEY (UM_ROLE_ID) REFERENCES UM_ROLE(UM_ID), 
-             PRIMARY KEY (UM_ID) 
-); 
--- REMOVED UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID) 
- 
-
-CREATE TABLE UM_USER_PERMISSION ( 
-             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-             UM_PERMISSION_ID INTEGER NOT NULL, 
-             UM_USER_ID INTEGER NOT NULL, 
-             UM_IS_ALLOWED SMALLINT NOT NULL,             
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             FOREIGN KEY (UM_PERMISSION_ID) REFERENCES UM_PERMISSION(UM_ID) ON DELETE CASCADE , 
-             FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID), 
-             PRIMARY KEY (UM_ID) 
-); 
--- REMOVED UNIQUE (UM_PERMISSION_ID, UM_USER_ID) 
-
-CREATE TABLE UM_USER_ROLE ( 
-             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-             UM_ROLE_ID INTEGER NOT NULL, 
-             UM_USER_ID INTEGER NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,  
-             UNIQUE (UM_USER_ID, UM_ROLE_ID), 
-             FOREIGN KEY (UM_ROLE_ID) REFERENCES UM_ROLE(UM_ID), 
-             FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID), 
-             PRIMARY KEY (UM_ID) 
-); 
-
-
-CREATE TABLE UM_USER_DATA ( 
-       UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-       UM_USER_ID INTEGER NOT NULL, 
-       UM_EMAIL VARCHAR(255), 
-       UM_FIRST_NAME VARCHAR(150), 
-       UM_LAST_NAME VARCHAR(150), 
-       UM_BIRTH_DATE VARCHAR(100), 
-       UM_FULL_NAME VARCHAR(255), 
-       UM_NAME_PREFIX VARCHAR(30), 
-       UM_GENDER VARCHAR(10), 
-       UM_TIME_ZONE VARCHAR(100), 
-       UM_COMPANY_NAME VARCHAR(255), 
-       UM_JOB_TITLE VARCHAR(150), 
-       UM_PRIMARY_PHONE VARCHAR(100), 
-       UM_HOME_PHONE VARCHAR(100), 
-       UM_WORK_PHONE VARCHAR(100), 
-       UM_MOBILE_PHONE VARCHAR(100), 
-       UM_STREET_ADDRESS VARCHAR(255), 
-       UM_CITY VARCHAR(100), 
-       UM_STATE VARCHAR(100), 
-       UM_COUNTRY VARCHAR(50), 
-       UM_POSTAL_CODE VARCHAR(50), 
-       UM_WEB_PAGE VARCHAR(255), 
-       UM_LANGUAGE VARCHAR(255), 
-       UM_BLOG VARCHAR(255), 
-       UM_PROFILE_ID VARCHAR(50),
-       UM_TENANT_ID INTEGER DEFAULT 0,  
-       FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID), 
-       PRIMARY KEY (UM_ID) 
-); 
-
-
-CREATE TABLE UM_BIN_DATA ( 
-            UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-            UM_USER_ID INTEGER NOT NULL, 
-            UM_CONTENT_NAME VARCHAR(255) NOT NULL, 
-            UM_CONTENT BLOB NOT NULL, 
-            UM_PROFILE_ID VARCHAR(255) NOT NULL, 
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID), 
-            PRIMARY KEY (UM_ID) 
-); 
-
-
-CREATE TABLE UM_USER_ATTRIBUTE ( 
-            UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-            UM_ATTR_NAME VARCHAR(255) NOT NULL, 
-            UM_ATTR_VALUE VARCHAR(1024), 
-            UM_PROFILE_ID VARCHAR(255), 
-            UM_USER_ID INTEGER, 
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID), 
-            PRIMARY KEY (UM_ID) 
-); 
-
-
-
-CREATE TABLE UM_DIALECT( 
-            UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-            UM_DIALECT_URI VARCHAR(255) NOT NULL, 
-            UM_REALM VARCHAR(63) NOT NULL,
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            UNIQUE(UM_DIALECT_URI, UM_REALM), 
-            PRIMARY KEY (UM_ID) 
-); 
-
-CREATE TABLE UM_CLAIM( 
-            UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-            UM_DIALECT_ID INTEGER NOT NULL, 
-            UM_CLAIM_URI VARCHAR(255) NOT NULL, 
-            UM_DISPLAY_TAG VARCHAR(255), 
-            UM_DESCRIPTION VARCHAR(255), 
-            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
-            UM_REG_EX VARCHAR(255), 
-            UM_SUPPORTED SMALLINT, 
-            UM_REQUIRED SMALLINT, 
-            UM_DISPLAY_ORDER INTEGER,
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI), 
-            FOREIGN KEY(UM_DIALECT_ID) REFERENCES UM_DIALECT(UM_ID), 
-            PRIMARY KEY (UM_ID) 
-); 
-
-CREATE TABLE UM_PROFILE_CONFIG( 
-            UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-            UM_DIALECT_ID INTEGER NOT NULL, 
-            UM_PROFILE_NAME VARCHAR(255), 
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            FOREIGN KEY(UM_DIALECT_ID) REFERENCES UM_DIALECT(UM_ID), 
-            PRIMARY KEY (UM_ID) 
-); 
-    
-CREATE TABLE UM_CLAIM_BEHAVIOR( 
-            UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-            UM_PROFILE_ID INTEGER, 
-            UM_CLAIM_ID INTEGER, 
-            UM_BEHAVIOUR SMALLINT, 
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            FOREIGN KEY(UM_PROFILE_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID), 
-            FOREIGN KEY(UM_CLAIM_ID) REFERENCES UM_CLAIM(UM_ID), 
-            PRIMARY KEY (UM_ID) 
-); 
-
-CREATE TABLE HYBRID_ROLE ( 
-             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-             UM_ROLE_ID VARCHAR(255) NOT NULL, 
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             PRIMARY KEY (UM_ID), 
-             UNIQUE(UM_ROLE_ID) 
-); 
-
-CREATE TABLE HYBRID_USER_ROLE ( 
-             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-             UM_USER_ID VARCHAR(255), 
-             UM_ROLE_ID VARCHAR(255) NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,  
-             PRIMARY KEY (UM_ID) 
-); 
-
-CREATE TABLE HYBRID_PERMISSION ( 
-             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-             UM_RESOURCE_ID VARCHAR(255), 
-             UM_ACTION VARCHAR(255) NOT NULL, 
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             PRIMARY KEY (UM_ID) 
-); 
-
-CREATE TABLE HYBRID_ROLE_PERMISSION ( 
-             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-             UM_PERMISSION_ID INTEGER NOT NULL, 
-             UM_ROLE_ID VARCHAR(255) NOT NULL, 
-             UM_IS_ALLOWED SMALLINT NOT NULL, 
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID), 
-             FOREIGN KEY (UM_PERMISSION_ID) REFERENCES HYBRID_PERMISSION(UM_ID), 
-             PRIMARY KEY (UM_ID) 
-); 
-
-CREATE TABLE HYBRID_USER_PERMISSION ( 
-             UM_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), 
-             UM_PERMISSION_ID INTEGER NOT NULL, 
-             UM_USER_ID VARCHAR(255) NOT NULL, 
-             UM_IS_ALLOWED SMALLINT NOT NULL, 
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             UNIQUE (UM_PERMISSION_ID, UM_USER_ID), 
-             FOREIGN KEY (UM_PERMISSION_ID) REFERENCES HYBRID_PERMISSION(UM_ID), 
-             PRIMARY KEY (UM_ID) 
-);

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/derby.sql
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/derby.sql b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/derby.sql
deleted file mode 100644
index 2253785..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/derby.sql
+++ /dev/null
@@ -1,364 +0,0 @@
-CREATE TABLE REG_CLUSTER_LOCK (
-             REG_LOCK_NAME VARCHAR (20),
-             REG_LOCK_STATUS VARCHAR (20),
-             REG_LOCKED_TIME TIMESTAMP,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (REG_LOCK_NAME)
-);
-
-CREATE TABLE REG_LOG (
-             REG_LOG_ID INTEGER GENERATED ALWAYS AS IDENTITY,
-             REG_PATH VARCHAR (2000),
-             REG_USER_ID VARCHAR (31) NOT NULL,
-             REG_LOGGED_TIME TIMESTAMP NOT NULL,
-             REG_ACTION INTEGER NOT NULL,
-             REG_ACTION_DATA VARCHAR (500),
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE REG_PATH(
-             REG_PATH_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-             REG_PATH_VALUE VARCHAR(2000) NOT NULL,
-             REG_PATH_PARENT_ID INT,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID)
-);
-CREATE INDEX REG_PATH_IND_BY_PATH_VALUE ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID);
-CREATE INDEX REG_PATH_IND_BY_PARENT_ID ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID);
-
-CREATE TABLE REG_CONTENT (
-             REG_CONTENT_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-             REG_CONTENT_DATA BLOB,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE REG_CONTENT_HISTORY (
-             REG_CONTENT_ID INTEGER NOT NULL,
-             REG_CONTENT_DATA BLOB,
-             REG_DELETED   SMALLINT,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE REG_RESOURCE (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR(256),
-            REG_VERSION         INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-            REG_MEDIA_TYPE      VARCHAR(500),
-            REG_CREATOR         VARCHAR(31) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR(31),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
-);
-
-ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
-
-CREATE TABLE REG_RESOURCE_HISTORY (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR(256),
-            REG_VERSION         INTEGER DEFAULT 0,
-            REG_MEDIA_TYPE      VARCHAR(500),
-            REG_CREATOR         VARCHAR(31) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR(31),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_DELETED         SMALLINT,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
-);
-
-ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
-
-CREATE TABLE REG_COMMENT (
-            REG_ID        INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-            REG_COMMENT_TEXT      VARCHAR(500) NOT NULL,
-            REG_USER_ID           VARCHAR(31) NOT NULL,
-            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE REG_RESOURCE_COMMENT (
-            REG_COMMENT_ID          INTEGER NOT NULL,
-            REG_VERSION             INTEGER DEFAULT 0,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-);
-
-
-ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID);
-
-CREATE TABLE REG_RATING (
-            REG_ID     INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-            REG_RATING        INTEGER NOT NULL,
-            REG_USER_ID       VARCHAR(31) NOT NULL,
-            REG_RATED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE REG_RESOURCE_RATING (
-            REG_RATING_ID           INTEGER NOT NULL,
-            REG_VERSION             INTEGER DEFAULT 0,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-);
-
-ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID);
-
-CREATE TABLE REG_TAG (
-            REG_ID         INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-            REG_TAG_NAME       VARCHAR(500) NOT NULL,
-            REG_USER_ID        VARCHAR(31) NOT NULL,
-            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE REG_RESOURCE_TAG (
-            REG_TAG_ID              INTEGER NOT NULL,
-            REG_VERSION             INTEGER DEFAULT 0,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-);
-
-ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID);
-
-CREATE TABLE REG_PROPERTY (
-            REG_ID         INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-            REG_NAME       VARCHAR(100) NOT NULL,
-            REG_VALUE        VARCHAR(1000),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE REG_RESOURCE_PROPERTY (
-            REG_PROPERTY_ID         INTEGER NOT NULL,
-            REG_VERSION             INTEGER DEFAULT 0,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-);
-
-ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID);
-
--- CREATE TABLE REG_ASSOCIATION (
--- SRC_PATH_ID     INTEGER,
--- SRC_RESOURCE_NAME    VARCHAR(256),
--- SRC_VERSION     INTEGER,
--- TGT_PATH_ID     INTEGER,
--- TGT_RESOURCE_NAME    VARCHAR(256),
--- TGT_VERSION     INTEGER
--- );
---
--- ALTER TABLE REG_ASSOCIATION ADD CONSTRAINT REG_ASSOCIATION_FK_BY_SRC_PATH_ID FOREIGN KEY (SRC_PATH_ID) REFERENCES REG_PATH (PATH_ID);
--- ALTER TABLE REG_ASSOCIATION ADD CONSTRAINT REG_ASSOCIATION_FK_BY_TGT_PATH_ID FOREIGN KEY (TGT_PATH_ID) REFERENCES REG_PATH (PATH_ID);
--- CREATE INDEX REG_ASSOCIATION_IND_BY_SRC_VERSION ON REG_ASSOCIATION(SRC_VERSION);
--- CREATE INDEX REG_ASSOCIATION_IND_BY_TGT_VERSION ON REG_ASSOCIATION(TGT_VERSION);
--- CREATE INDEX REG_ASSOCIATION_IND_BY_SRC_RESOURCE_NAME ON REG_ASSOCIATION(SRC_RESOURCE_NAME);
--- CREATE INDEX REG_ASSOCIATION_IND_BY_TGT_RESOURCE_NAME ON REG_ASSOCIATION(TGT_RESOURCE_NAME);
-
-
-
-CREATE TABLE REG_ASSOCIATION (
-            REG_ASSOCIATION_ID INTEGER GENERATED ALWAYS AS IDENTITY,
-            REG_SOURCEPATH VARCHAR (2000) NOT NULL,
-            REG_TARGETPATH VARCHAR (2000) NOT NULL,
-            REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE REG_SNAPSHOT (
-            REG_SNAPSHOT_ID     INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-            REG_PATH_ID            INTEGER NOT NULL,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_RESOURCE_VIDS     BLOB NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID)
-);
-
-CREATE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-
-ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-
-
--- ################################
--- USER MANAGER TABLES
--- ################################
-
-CREATE TABLE UM_TENANT (
-			UM_ID INTEGER  GENERATED ALWAYS AS IDENTITY,
-			UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
-    			UM_EMAIL VARCHAR(255),
-	                UM_ACTIVE BOOLEAN DEFAULT FALSE,
-			PRIMARY KEY (UM_ID),
-			UNIQUE(UM_DOMAIN_NAME));
-
-CREATE TABLE UM_USER (
-             UM_ID INTEGER GENERATED ALWAYS AS IDENTITY,
-             UM_USER_NAME VARCHAR(255) NOT NULL,
-             UM_USER_PASSWORD VARCHAR(255) NOT NULL,
-             UM_SALT_VALUE VARCHAR(31),
-             UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE,
-             UM_CHANGED_TIME TIMESTAMP NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (UM_ID, UM_TENANT_ID),
-             UNIQUE(UM_USER_NAME, UM_TENANT_ID)
-);
-
-CREATE TABLE UM_ROLE (
-             UM_ID INTEGER GENERATED ALWAYS AS IDENTITY,
-             UM_ROLE_NAME VARCHAR(255) NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (UM_ID, UM_TENANT_ID),
-             UNIQUE(UM_ROLE_NAME, UM_TENANT_ID)
-);
-
-
-CREATE TABLE UM_PERMISSION (
-             UM_ID INTEGER GENERATED ALWAYS AS IDENTITY,
-             UM_RESOURCE_ID VARCHAR(255) NOT NULL,
-             UM_ACTION VARCHAR(255) NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION
-                    ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID);
-
-CREATE TABLE UM_ROLE_PERMISSION (
-             UM_ID INTEGER GENERATED ALWAYS AS IDENTITY,
-             UM_PERMISSION_ID INTEGER NOT NULL,
-             UM_ROLE_NAME VARCHAR(255) NOT NULL,
-             UM_IS_ALLOWED SMALLINT NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,
-             --UNIQUE (PERMISSION_ID, UM_ROLE_NAME),
-             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE TABLE UM_USER_PERMISSION (
-             UM_ID INTEGER GENERATED ALWAYS AS IDENTITY,
-             UM_PERMISSION_ID INTEGER NOT NULL,
-             UM_USER_NAME VARCHAR(255) NOT NULL,
-             UM_IS_ALLOWED SMALLINT NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,
-             --UNIQUE (PERMISSION_ID, UM_USER_NAME),
-             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE ,
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE TABLE UM_USER_ROLE (
-             UM_ID INTEGER GENERATED ALWAYS AS IDENTITY,
-             UM_ROLE_ID INTEGER NOT NULL,
-             UM_USER_ID INTEGER NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,
-             UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID),
-             FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID),
-             FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID),
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE TABLE UM_USER_ATTRIBUTE (
-            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY,
-            UM_ATTR_NAME VARCHAR(255) NOT NULL,
-            UM_ATTR_VALUE VARCHAR(1024), 
-            UM_PROFILE_ID VARCHAR(255), 
-            UM_USER_ID INTEGER,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE TABLE UM_DIALECT(
-            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY, 
-            UM_DIALECT_URI VARCHAR(255) NOT NULL,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE TABLE UM_CLAIM(
-            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY, 
-            UM_DIALECT_ID INTEGER NOT NULL, 
-            UM_CLAIM_URI VARCHAR(255) NOT NULL, 
-            UM_DISPLAY_TAG VARCHAR(255), 
-            UM_DESCRIPTION VARCHAR(255), 
-            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
-            UM_REG_EX VARCHAR(255), 
-            UM_SUPPORTED SMALLINT, 
-            UM_REQUIRED SMALLINT, 
-            UM_DISPLAY_ORDER INTEGER,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID),
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE TABLE UM_PROFILE_CONFIG(
-            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY, 
-            UM_DIALECT_ID INTEGER, 
-            UM_PROFILE_NAME VARCHAR(255), 
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-    
-CREATE TABLE UM_CLAIM_BEHAVIOR(
-            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY, 
-            UM_PROFILE_ID INTEGER, 
-            UM_CLAIM_ID INTEGER, 
-            UM_BEHAVIOUR SMALLINT, 
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID), 
-            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE TABLE UM_HYBRID_ROLE(
-            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY,
-            UM_ROLE_NAME VARCHAR(255),
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE TABLE UM_HYBRID_USER_ROLE(
-            UM_ID INTEGER GENERATED BY DEFAULT AS IDENTITY,
-            UM_USER_NAME VARCHAR(255),
-            UM_ROLE_ID INTEGER NOT NULL,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
-            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/h2.sql
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/h2.sql b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/h2.sql
deleted file mode 100644
index 19f81cd..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/h2.sql
+++ /dev/null
@@ -1,337 +0,0 @@
-CREATE TABLE IF NOT EXISTS REG_CLUSTER_LOCK (
-             REG_LOCK_NAME VARCHAR (20),
-             REG_LOCK_STATUS VARCHAR (20),
-             REG_LOCKED_TIME TIMESTAMP,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (REG_LOCK_NAME)
-);
-
-CREATE TABLE IF NOT EXISTS REG_LOG (
-             REG_LOG_ID INTEGER AUTO_INCREMENT,
-             REG_PATH VARCHAR (2000),
-             REG_USER_ID VARCHAR (31) NOT NULL,
-             REG_LOGGED_TIME TIMESTAMP NOT NULL,
-             REG_ACTION INTEGER NOT NULL,
-             REG_ACTION_DATA VARCHAR (500),
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE IF NOT EXISTS REG_PATH(
-             REG_PATH_ID INTEGER NOT NULL AUTO_INCREMENT,
-             REG_PATH_VALUE VARCHAR(2000) NOT NULL,
-             REG_PATH_PARENT_ID INT,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID)
-);
-CREATE INDEX IF NOT EXISTS REG_PATH_IND_BY_NAME ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_PATH_IND_BY_PARENT_ID ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID);
-
-
-CREATE TABLE IF NOT EXISTS REG_CONTENT (
-             REG_CONTENT_ID INTEGER NOT NULL AUTO_INCREMENT,
-             REG_CONTENT_DATA LONGBLOB,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE IF NOT EXISTS REG_CONTENT_HISTORY (
-             REG_CONTENT_ID INTEGER NOT NULL,
-             REG_CONTENT_DATA LONGBLOB,
-             REG_DELETED   SMALLINT,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE IF NOT EXISTS REG_RESOURCE (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR(256),
-            REG_VERSION         INTEGER NOT NULL AUTO_INCREMENT,
-            REG_MEDIA_TYPE      VARCHAR(500),
-            REG_CREATOR         VARCHAR(31) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR(31),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
-);
-
-ALTER TABLE REG_RESOURCE ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_RESOURCE_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
-
-CREATE TABLE IF NOT EXISTS REG_RESOURCE_HISTORY (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR(256),
-            REG_VERSION         INTEGER NOT NULL,
-            REG_MEDIA_TYPE      VARCHAR(500),
-            REG_CREATOR         VARCHAR(31) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR(31),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_DELETED         SMALLINT,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
-);
-
-ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_RESOURCE_HISTORY_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
-
-CREATE TABLE IF NOT EXISTS REG_COMMENT (
-            REG_ID        INTEGER NOT NULL AUTO_INCREMENT,
-            REG_COMMENT_TEXT      VARCHAR(500) NOT NULL,
-            REG_USER_ID           VARCHAR(31) NOT NULL,
-            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE IF NOT EXISTS REG_RESOURCE_COMMENT (
-            REG_COMMENT_ID          INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-);
-
-ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_RESOURCE_COMMENT_IND_BY_VERSION ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID);
-
-CREATE TABLE IF NOT EXISTS REG_RATING (
-            REG_ID     INTEGER NOT NULL AUTO_INCREMENT,
-            REG_RATING        INTEGER NOT NULL,
-            REG_USER_ID       VARCHAR(31) NOT NULL,
-            REG_RATED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE IF NOT EXISTS REG_RESOURCE_RATING (
-            REG_RATING_ID           INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-);
-
-ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_RESOURCE_RATING_IND_BY_VERSION ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID);
-
-
-CREATE TABLE IF NOT EXISTS REG_TAG (
-            REG_ID         INTEGER NOT NULL AUTO_INCREMENT,
-            REG_TAG_NAME       VARCHAR(500) NOT NULL,
-            REG_USER_ID        VARCHAR(31) NOT NULL,
-            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE IF NOT EXISTS REG_RESOURCE_TAG (
-            REG_TAG_ID              INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-);
-
-ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_RESOURCE_TAG_IND_BY_VERSION ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID);
-
-CREATE TABLE IF NOT EXISTS REG_PROPERTY (
-            REG_ID         INTEGER NOT NULL AUTO_INCREMENT,
-            REG_NAME       VARCHAR(100) NOT NULL,
-            REG_VALUE        VARCHAR(1000),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE IF NOT EXISTS REG_RESOURCE_PROPERTY (
-            REG_PROPERTY_ID         INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-);
-
-ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_RESOURCE_PROPERTY_IND_BY_VERSION ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID);
-
-CREATE TABLE IF NOT EXISTS REG_ASSOCIATION (
-            REG_ASSOCIATION_ID INTEGER AUTO_INCREMENT,
-            REG_SOURCEPATH VARCHAR (2000) NOT NULL,
-            REG_TARGETPATH VARCHAR (2000) NOT NULL,
-            REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID)
-);
-
-CREATE TABLE IF NOT EXISTS REG_SNAPSHOT (
-            REG_SNAPSHOT_ID     INTEGER NOT NULL AUTO_INCREMENT,
-            REG_PATH_ID            INTEGER NOT NULL,
-            REG_RESOURCE_NAME VARCHAR (256),
-            REG_RESOURCE_VIDS     LONGBLOB NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID)
-);
-
-ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT IF NOT EXISTS REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-CREATE INDEX IF NOT EXISTS REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-
--- ################################
--- USER MANAGER TABLES
--- ################################
-
-CREATE TABLE IF NOT EXISTS UM_TENANT (
-			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-			UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
-	                UM_EMAIL VARCHAR(255),
-	                UM_ACTIVE BOOLEAN DEFAULT FALSE,
-            UM_CREATED_DATE TIMESTAMP NOT NULL,
-			PRIMARY KEY (UM_ID),
-			UNIQUE(UM_DOMAIN_NAME));
-
-CREATE TABLE IF NOT EXISTS UM_USER (
-			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-			UM_USER_NAME VARCHAR(255) NOT NULL,
-			UM_USER_PASSWORD VARCHAR(255) NOT NULL,
-			UM_SALT_VALUE VARCHAR(31),
-			UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE,
-            UM_CHANGED_TIME TIMESTAMP NOT NULL,
-			UM_TENANT_ID INTEGER DEFAULT 0,
-			PRIMARY KEY (UM_ID, UM_TENANT_ID),
-			UNIQUE(UM_USER_NAME, UM_TENANT_ID));
-
-CREATE TABLE IF NOT EXISTS UM_USER_ATTRIBUTE (
-			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-			UM_ATTR_NAME VARCHAR(255) NOT NULL,
-			UM_ATTR_VALUE VARCHAR(1024),
-            UM_PROFILE_ID VARCHAR(255),
-            UM_USER_ID INTEGER,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-			PRIMARY KEY (UM_ID, UM_TENANT_ID),
-			FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID));
-
-CREATE TABLE IF NOT EXISTS UM_ROLE (
-			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-			UM_ROLE_NAME VARCHAR(255) NOT NULL,
-			UM_TENANT_ID INTEGER DEFAULT 0,
-			PRIMARY KEY (UM_ID, UM_TENANT_ID),
-			UNIQUE(UM_ROLE_NAME, UM_TENANT_ID));
-
-CREATE TABLE IF NOT EXISTS UM_PERMISSION (
-			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-			UM_RESOURCE_ID VARCHAR(255) NOT NULL,
-			UM_ACTION VARCHAR(255) NOT NULL,
-			UM_TENANT_ID INTEGER DEFAULT 0,
-			PRIMARY KEY (UM_ID, UM_TENANT_ID));
-
-CREATE INDEX IF NOT EXISTS INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID);
-
-CREATE TABLE IF NOT EXISTS UM_ROLE_PERMISSION (
-			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-			UM_PERMISSION_ID INTEGER NOT NULL,
-			UM_ROLE_NAME VARCHAR(255) NOT NULL,
-            UM_IS_ALLOWED SMALLINT NOT NULL,
-			UM_TENANT_ID INTEGER DEFAULT 0,
-			UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID),
-			FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID),
-			PRIMARY KEY (UM_ID, UM_TENANT_ID));
-
-CREATE TABLE IF NOT EXISTS UM_USER_PERMISSION (
-			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-			UM_PERMISSION_ID INTEGER NOT NULL,
-			UM_USER_NAME VARCHAR(255) NOT NULL,
-            UM_IS_ALLOWED SMALLINT NOT NULL,
-			UNIQUE (UM_PERMISSION_ID, UM_USER_NAME, UM_TENANT_ID),
-			UM_TENANT_ID INTEGER DEFAULT 0,
-			FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID),
-			PRIMARY KEY (UM_ID, UM_TENANT_ID));
-
-CREATE TABLE IF NOT EXISTS UM_USER_ROLE (
-			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-			UM_ROLE_ID INTEGER NOT NULL,
-			UM_USER_ID INTEGER NOT NULL,
-			UM_TENANT_ID INTEGER DEFAULT 0,
-			UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID),
-			FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID),
-			FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID),
-			PRIMARY KEY (UM_ID, UM_TENANT_ID));
-
-CREATE TABLE IF NOT EXISTS UM_DIALECT(
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-            UM_DIALECT_URI VARCHAR(255) NOT NULL,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-
-CREATE TABLE IF NOT EXISTS UM_CLAIM(
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-            UM_DIALECT_ID INTEGER NOT NULL,
-            UM_CLAIM_URI VARCHAR(255) NOT NULL,
-            UM_DISPLAY_TAG VARCHAR(255),
-            UM_DESCRIPTION VARCHAR(255),
-            UM_MAPPED_ATTRIBUTE VARCHAR(255),
-            UM_REG_EX VARCHAR(255),
-            UM_SUPPORTED SMALLINT,
-            UM_REQUIRED SMALLINT,
-            UM_DISPLAY_ORDER INTEGER,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID),
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE TABLE IF NOT EXISTS UM_PROFILE_CONFIG(
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-            UM_DIALECT_ID INTEGER,
-            UM_PROFILE_NAME VARCHAR(255),
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE TABLE IF NOT EXISTS UM_CLAIM_BEHAVIOR(
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-            UM_PROFILE_ID INTEGER,
-            UM_CLAIM_ID INTEGER,
-            UM_BEHAVIOUR SMALLINT,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID),
-            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE TABLE IF NOT EXISTS UM_HYBRID_ROLE(
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-            UM_ROLE_NAME VARCHAR(255),
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-CREATE TABLE IF NOT EXISTS UM_HYBRID_USER_ROLE(
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-            UM_USER_NAME VARCHAR(255),
-            UM_ROLE_ID INTEGER NOT NULL,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
-            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/mssql.sql
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/mssql.sql b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/mssql.sql
deleted file mode 100755
index 1e67fc5..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/mssql.sql
+++ /dev/null
@@ -1,494 +0,0 @@
---create table REG_CLUSTER_LOCK
-IF NOT  EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_CLUSTER_LOCK]') AND TYPE IN (N'U'))
-CREATE TABLE  REG_CLUSTER_LOCK (
-             REG_LOCK_NAME VARCHAR (20),
-             REG_LOCK_STATUS VARCHAR (20),
-             REG_LOCKED_TIME DATETIME,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (REG_LOCK_NAME)
-);
-
---create table REG_LOG
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_LOG]') AND TYPE IN (N'U'))
-
-CREATE TABLE REG_LOG (
-             REG_LOG_ID INTEGER IDENTITY(1,1) NOT NULL,
-             REG_PATH VARCHAR (2000),
-             REG_USER_ID VARCHAR (31) NOT NULL,
-             REG_LOGGED_TIME DATETIME NOT NULL,
-             REG_ACTION INTEGER NOT NULL,
-             REG_ACTION_DATA VARCHAR (500),
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID)
-);
-
---create table regpath
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_PATH]') AND TYPE IN (N'U'))
-CREATE TABLE  REG_PATH(
-             REG_PATH_ID INTEGER IDENTITY(1,1) NOT NULL,
-             REG_PATH_VALUE VARCHAR(895) NOT NULL,
-             REG_PATH_PARENT_ID INTEGER,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID)
-);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_PATH_IND_BY_PATH_VALUE')
-DROP INDEX REG_PATH.REG_PATH_IND_BY_PATH_VALUE
-CREATE INDEX REG_PATH_IND_BY_PATH_VALUE ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID);
-
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_PATH_IND_BY_PARENT_ID')
-DROP INDEX REG_PATH.REG_PATH_IND_BY_PARENT_ID
-CREATE INDEX REG_PATH_IND_BY_PARENT_ID ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID);
---create table regcontent
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_CONTENT]') AND TYPE IN (N'U'))
-CREATE TABLE  REG_CONTENT (
-             REG_CONTENT_ID INTEGER IDENTITY(1,1) NOT NULL,
-             REG_CONTENT_DATA VARBINARY(MAX),
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
-);
-
---create table REG_CONTENT_HISTORY
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_CONTENT_HISTORY]') AND TYPE IN (N'U'))
-CREATE TABLE  REG_CONTENT_HISTORY (
-             REG_CONTENT_ID INTEGER NOT NULL,
-             REG_CONTENT_DATA VARBINARY(MAX),
-             REG_DELETED   SMALLINT,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
-);
-
-
---create table REG_RESOURCE
-IF NOT  EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE]') AND TYPE IN (N'U'))
-CREATE TABLE  REG_RESOURCE (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR(256),
-            REG_VERSION          INTEGER IDENTITY(1,1) NOT NULL,
-            REG_MEDIA_TYPE      VARCHAR(500),
-            REG_CREATOR         VARCHAR(31) NOT NULL,
-            REG_CREATED_TIME    DATETIME NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR(31),
-            REG_LAST_UPDATED_TIME   DATETIME NOT NULL,
-            REG_DESCRIPTION     VARCHAR(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_TENANT_ID INTEGER DEFAULT 0
-            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
-);
-
-IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_FK_BY_PATH_ID]') AND PARENT_OBJECT_ID = OBJECT_ID(N'DBO.[REG_RESOURCE]'))
-ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-
---This foriegn key constrainst is maintained from the code level
---IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_FK_BY_CONTENT_ID]') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE]'))
---ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_IND_BY_NAME')
-DROP INDEX REG_RESOURCE.REG_RESOURCE_IND_BY_NAME
-CREATE INDEX REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME, REG_TENANT_ID);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_IND_BY_PATH_ID_NAME')
-DROP INDEX REG_RESOURCE.REG_RESOURCE_IND_BY_PATH_ID_NAME
-CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
-
-
---create table REG_RESOURCE_HISTORY
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_HISTORY]') AND TYPE IN (N'U'))
-CREATE TABLE  REG_RESOURCE_HISTORY (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR(256),
-            REG_VERSION         INTEGER NOT NULL,
-            REG_MEDIA_TYPE      VARCHAR(500),
-            REG_CREATOR         VARCHAR(31) NOT NULL,
-            REG_CREATED_TIME    DATETIME NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR(31),
-            REG_LAST_UPDATED_TIME  DATETIME NOT NULL,
-            REG_DESCRIPTION     VARCHAR(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_DELETED         SMALLINT,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
-);
-
-IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE object_id = OBJECT_ID(N'[dbo].[REG_RESOURCE_HIST_FK_BY_PATHID]') AND parent_object_id = OBJECT_ID(N'[dbo].[REG_RESOURCE_HISTORY]'))
-ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-
-IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE object_id = OBJECT_ID(N'[dbo].[REG_RESOURCE_HIST_FK_BY_CONTENT_ID]') AND parent_object_id = OBJECT_ID(N'[dbo].[REG_RESOURCE_HISTORY]'))
-ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_HISTORY_IND_BY_NAME')
-DROP INDEX REG_RESOURCE_HISTORY.REG_RESOURCE_HISTORY_IND_BY_NAME
-CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME')
-DROP INDEX REG_RESOURCE_HISTORY.REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME
-CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME ON REG_RESOURCE_HISTORY(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
-
---create table REG_COMMENT
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_COMMENT]') AND TYPE IN (N'U'))
-CREATE TABLE  REG_COMMENT (
-            REG_ID      INTEGER IDENTITY(1,1) NOT NULL,
-            REG_COMMENT_TEXT      VARCHAR(500) NOT NULL,
-            REG_USER_ID           VARCHAR(31) NOT NULL,
-            REG_COMMENTED_TIME    DATETIME NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
---create table REG_RESOURCE_COMMENT
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_COMMENT]') AND TYPE IN (N'U'))
-CREATE TABLE  REG_RESOURCE_COMMENT (
-            REG_COMMENT_ID          INTEGER NOT NULL,
-            REG_VERSION             INTEGER DEFAULT 0,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_COMMENT PRIMARY KEY(REG_COMMENT_ID, REG_TENANT_ID)
-);
-
-IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].REG_RESOURCE_COMMENT_FK_BY_PATH_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_COMMENT'))
-ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-
-IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_COMMENT'))
-ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME')
-DROP INDEX REG_RESOURCE_COMMENT.REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME
-CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_COMMENT_IND_BY_VERSION')
-DROP INDEX REG_RESOURCE_COMMENT.REG_RESOURCE_COMMENT_IND_BY_VERSION
-CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID);
-
---create table  REG_RATING
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RATING]') AND TYPE IN (N'U'))
-CREATE TABLE REG_RATING (
-            REG_ID      INTEGER IDENTITY(1,1) NOT NULL,
-            REG_RATING        INTEGER NOT NULL,
-            REG_USER_ID       VARCHAR(31) NOT NULL,
-            REG_RATED_TIME    DATETIME NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
---create table REG_RESOURCE_RATING
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_RATING]') AND TYPE IN (N'U'))
-CREATE TABLE  REG_RESOURCE_RATING (
-            REG_RATING_ID           INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_RATING PRIMARY KEY(REG_RATING_ID, REG_TENANT_ID)
-);
-
-IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].REG_RESOURCE_RATING_FK_BY_PATH_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[dbo].REG_RESOURCE_RATING'))
-ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-
-IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].REG_RESOURCE_RATING_FK_BY_RATING_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[dbo].REG_RESOURCE_RATING'))
-ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME')
-DROP INDEX REG_RESOURCE_RATING.REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME
-CREATE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_RATING_IND_BY_VERSION')
-DROP INDEX REG_RESOURCE_RATING.REG_RESOURCE_RATING_IND_BY_VERSION
-CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID);
-
---create table  REG_TAG
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_TAG]') AND TYPE IN (N'U'))
-CREATE TABLE  REG_TAG (
-            REG_ID         INTEGER IDENTITY(1,1) NOT NULL,
-            REG_TAG_NAME       VARCHAR(500) NOT NULL,
-            REG_USER_ID        VARCHAR(31) NOT NULL,
-            REG_TAGGED_TIME    DATETIME NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-
-
---create table  REG_RESOURCE_TAG
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_TAG]') AND TYPE IN (N'U'))
-CREATE TABLE   REG_RESOURCE_TAG (
-            REG_TAG_ID              INTEGER NOT NULL,
-            REG_VERSION             INTEGER DEFAULT 0,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_TAG PRIMARY KEY(REG_TAG_ID, REG_TENANT_ID)
-);
-
-IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_TAG_FK_BY_PATH_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_TAG'))
-ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-
-IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_TAG_FK_BY_TAG_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_TAG'))
-ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME')
-DROP INDEX REG_RESOURCE_TAG.REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME
-CREATE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_TAG_IND_BY_VERSION')
-DROP INDEX REG_RESOURCE_TAG.REG_RESOURCE_TAG_IND_BY_VERSION
-CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID);
-
---CREATE TABLE REG_PROPERTY
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_PROPERTY]') AND TYPE IN (N'U'))
-CREATE TABLE REG_PROPERTY (
-            REG_ID        INTEGER IDENTITY(1,1) NOT NULL,
-            REG_NAME       VARCHAR(100) NOT NULL,
-            REG_VALUE        VARCHAR(1000),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
---CREATE TABLE REG_RESOURCE_PROPERTY
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_RESOURCE_PROPERTY]') AND TYPE IN (N'U'))
-CREATE TABLE  REG_RESOURCE_PROPERTY (
-            REG_PROPERTY_ID         INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_PROPERTY PRIMARY KEY(REG_PROPERTY_ID, REG_TENANT_ID)
-);
-
-IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_PROPERTY_FK_BY_PATH_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_PROPERTY'))
-ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-
-IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_PROPERTY_FK_BY_TAG_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_RESOURCE_PROPERTY'))
-ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME')
-DROP INDEX REG_RESOURCE_PROPERTY.REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME
-CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_RESOURCE_PROPERTY_IND_BY_VERSION')
-DROP INDEX REG_RESOURCE_PROPERTY.REG_RESOURCE_PROPERTY_IND_BY_VERSION
-CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID);
-
---CREATE TABLE  REG_ASSOCIATION
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_ASSOCIATION]') AND TYPE IN (N'U'))
-CREATE TABLE  REG_ASSOCIATION (
-            REG_ASSOCIATION_ID  INTEGER IDENTITY(1,1) NOT NULL,
-            REG_SOURCEPATH VARCHAR (2000) NOT NULL,
-            REG_TARGETPATH VARCHAR (2000) NOT NULL,
-            REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID)
-);
-
---CREATE TABLE  REG_SNAPSHOT
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[REG_SNAPSHOT]') AND TYPE IN (N'U'))
-CREATE TABLE REG_SNAPSHOT (
-            REG_SNAPSHOT_ID     INTEGER IDENTITY(1,1) NOT NULL,
-            REG_PATH_ID            INTEGER NOT NULL,
-            REG_RESOURCE_NAME            VARCHAR (256),
-            REG_RESOURCE_VIDS     VARBINARY(MAX) NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID)
-);
-IF NOT EXISTS (SELECT * FROM SYS.FOREIGN_KEYS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].REG_SNAPSHOT_FK_BY_PATH_ID') AND PARENT_OBJECT_ID = OBJECT_ID(N'[DBO].REG_SNAPSHOT'))
-ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-
-
-IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME')
-DROP INDEX REG_SNAPSHOT.REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME
-CREATE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-
--- ################################
--- USER MANAGER TABLES
--- ################################
-
---CREATE TABLE   UM_TENANT_
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_TENANT]') AND TYPE IN (N'U'))
-CREATE TABLE UM_TENANT (
-			UM_ID INTEGER IDENTITY(1,1) NOT NULL,
-			UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
-	        UM_EMAIL VARCHAR(255),
-            UM_ACTIVE BIT DEFAULT 0,
-			PRIMARY KEY (UM_ID),
-			UNIQUE(UM_DOMAIN_NAME));
-
---CREATE TABLE   UM_USER
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_USER]') AND TYPE IN (N'U'))
-CREATE TABLE  UM_USER (
-             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
-             UM_USER_NAME VARCHAR(255) NOT NULL,
-             UM_USER_PASSWORD VARCHAR(255) NOT NULL,
-             UM_SALT_VALUE VARCHAR(31),
-             UM_REQUIRE_CHANGE BIT DEFAULT 0,
-             UM_CHANGED_TIME DATETIME NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (UM_ID, UM_TENANT_ID),
-             UNIQUE(UM_USER_NAME, UM_TENANT_ID)
-);
-
---CREATE TABLE   UM_USER_ATTRIBUTE
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_USER_ATTRIBUTE]') AND TYPE IN (N'U'))
-CREATE TABLE  UM_USER_ATTRIBUTE (
-             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
-			UM_ATTR_NAME VARCHAR(255) NOT NULL,
-			UM_ATTR_VALUE VARCHAR(1024),
-			UM_PROFILE_ID VARCHAR(255),
-			UM_USER_ID INTEGER,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-			FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID),
-			PRIMARY KEY (UM_ID, UM_TENANT_ID));
-
---CREATE TABLE   UM_ROLE
-
-IF NOT  EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_ROLE]') AND TYPE IN (N'U'))
-CREATE TABLE UM_ROLE (
-             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
-             UM_ROLE_NAME VARCHAR(255) NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (UM_ID, UM_TENANT_ID),
-             UNIQUE(UM_ROLE_NAME, UM_TENANT_ID)
-);
-
-
---CREATE TABLE UM_PERMISSION
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_PERMISSION]') AND TYPE IN (N'U'))
-CREATE TABLE  UM_PERMISSION (
-             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
-             UM_RESOURCE_ID VARCHAR(255) NOT NULL,
-             UM_ACTION VARCHAR(255) NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-IF EXISTS (SELECT name FROM sysindexes WHERE name = 'INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION')
-DROP INDEX UM_PERMISSION.INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION
-CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID);
-
---CREATE TABLE UM_ROLE_PERMISSION
-
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_ROLE_PERMISSION]') AND TYPE IN (N'U'))
-CREATE TABLE  UM_ROLE_PERMISSION (
-             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
-             UM_PERMISSION_ID INTEGER NOT NULL,
-             UM_ROLE_NAME VARCHAR(255) NOT NULL,
-             UM_IS_ALLOWED SMALLINT NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,
-             UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID),
-             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID),
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
---CREATE TABLE UM_USER_PERMISSION
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_USER_PERMISSION]') AND TYPE IN (N'U'))
-CREATE TABLE  UM_USER_PERMISSION (
-             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
-             UM_PERMISSION_ID INTEGER NOT NULL,
-             UM_USER_NAME VARCHAR(255) NOT NULL,
-             UM_IS_ALLOWED SMALLINT NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,
-             UNIQUE (UM_PERMISSION_ID, UM_USER_NAME, UM_TENANT_ID),
-             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID),
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
--- create table UM_USER_ROLE
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_USER_ROLE]') AND TYPE IN (N'U'))
-CREATE TABLE  UM_USER_ROLE (
-             UM_ID INTEGER IDENTITY(1,1) NOT NULL,
-             UM_ROLE_ID INTEGER NOT NULL,
-             UM_USER_ID INTEGER NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,
-             UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID),
-             FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID),
-             FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID),
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
--- create table UM_DIALECT
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_DIALECT]') AND TYPE IN (N'U'))
-CREATE TABLE UM_DIALECT(
-       	    UM_ID INTEGER IDENTITY(1, 1),
-            UM_DIALECT_URI VARCHAR(255),
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
--- create table UM_CLAIM
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_CLAIM]') AND TYPE IN (N'U'))
-CREATE TABLE UM_CLAIM(
-       	UM_ID INTEGER IDENTITY(1, 1),
-            UM_DIALECT_ID INTEGER,
-            UM_CLAIM_URI VARCHAR(255), 
-            UM_DISPLAY_TAG VARCHAR(255), 
-            UM_DESCRIPTION VARCHAR(255), 
-            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
-            UM_REG_EX VARCHAR(255), 
-            UM_SUPPORTED SMALLINT, 
-            UM_REQUIRED SMALLINT, 
-            UM_DISPLAY_ORDER INTEGER, 
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
--- create table UM_PROFILE_CONFIG
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_PROFILE_CONFIG]') AND TYPE IN (N'U'))
-CREATE TABLE UM_PROFILE_CONFIG(
-       	UM_ID INTEGER IDENTITY(1, 1),
-            UM_DIALECT_ID INTEGER, 
-            UM_PROFILE_NAME VARCHAR(255), 
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
--- create table UM_CLAIM_BEHAVIOR
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_CLAIM_BEHAVIOR]') AND TYPE IN (N'U'))
-CREATE TABLE UM_CLAIM_BEHAVIOR(
-       	    UM_ID INTEGER IDENTITY(1, 1),
-            UM_PROFILE_ID INTEGER, 
-            UM_CLAIM_ID INTEGER, 
-            UM_BEHAVIOUR SMALLINT,
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID), 
-            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
--- create table UM_HYBRID_ROLE
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_HYBRID_ROLE]') AND TYPE IN (N'U'))
-CREATE TABLE UM_HYBRID_ROLE(
-            UM_ID INTEGER IDENTITY(1, 1),
-            UM_ROLE_NAME VARCHAR(255),
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
--- create table UM_HYBRID_USER_ROLE
-IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[UM_HYBRID_USER_ROLE]') AND TYPE IN (N'U'))
-CREATE TABLE UM_HYBRID_USER_ROLE(
-            UM_ID INTEGER IDENTITY(1, 1),
-            UM_USER_NAME VARCHAR(255),
-            UM_ROLE_ID INTEGER NOT NULL,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
-            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-


[03/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/carbon.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/carbon.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/carbon.xml
deleted file mode 100644
index 147fd43..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/carbon.xml
+++ /dev/null
@@ -1,351 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<!--
-  ~ Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<!--
-    This is the main server configuration file
-    
-    ${carbon.home} represents the carbon.home system property.
-    Other system properties can be specified in a similar manner.
--->
-<Server xmlns="http://wso2.org/projects/carbon/carbon.xml">
-
-    <!--
-       Product Name
-    -->
-    <Name>${product.name}</Name>
-
-    <!--
-       Product Version
-    -->
-    <Version>${product.version}</Version>
-
-    <!--
-       The fully qualified name of the server
-    -->
-    <Package>org.wso2.carbon</Package>
-
-    <!--
-    Webapp context root of WSO2 Carbon. If Carbon is to be deployed on a different context,
-    the carbon webapp directory has to be renamed, and this entry has to be changed to have the
-    same name as the renamed carbon webapp directory.
-    -->
-    <WebContextRoot>/</WebContextRoot>
-
-    <!--
-     The URL of the back end server. This is where the admin services are hosted and
-     will be used by the clients in the front end server.
-     This is required only for the Front-end server. This is used when seperating BE server from FE server
-    -->
-    <ServerURL>https://${carbon.local.ip}:${carbon.management.port}${carbon.context}/services/</ServerURL>
-
-
-    <!-- In-order to  get the registry http Port from the back-end when the default http transport is not the same-->
-    <!--RegistryHttpPort>9763</RegistryHttpPort-->
-
-    <!--
-    Number of items to be displayed on a management console page. This is used at the
-    backend server for pagination of various items.
-    -->
-    <ItemsPerPage>15</ItemsPerPage>
-
-    <!--
-       Host name or IP address of the machine hosting this server
-       e.g. www.wso2.org, 192.168.1.10
-       This is will become part of the End Point Reference of the
-       services deployed on this server instance.
-    -->
-
-    <!--HostName>www.wso2.org</HostName-->
-
-    <!--
-     The URL of the index page. This is where the user will be redirected after signing in to the
-     carbon server.
-    -->
-    <!--IndexPageURL>/carbon/admin/index.jsp</IndexPageURL-->
-
-    <!-- HTTP and HTTPS ports when apache is fronted to a carbon server-->
-    <!--ApacheHttpPort>80</ApacheHttpPort>
-    <ApacheHttpsPort>443</ApacheHttpsPort-->
-
-    <!--
-       Ports used by this server
-    -->
-    <Ports>
-        <!--
-           The JMX Port
-        -->
-        <!--
-        <JMX>9999</JMX>
-         -->
-    </Ports>
-
-    <!--
-    Axis2 related configurations
-    -->
-    <Axis2Config>
-        <!--
-             Location of the Axis2 Services & Modules repository
-
-             This can be a directory in the local file system, or a URL.
-
-             e.g.
-             1. /home/wso2wsas/repository/ - An absolute path
-             2. repository - In this case, the path is relative to CARBON_HOME
-             3. file:///home/wso2wsas/repository/
-             4. http://wso2wsas/repository/
-        -->
-        <RepositoryLocation>${carbon.home}/repository/deployment/server/</RepositoryLocation>
-
-        <!--
-            Location of the main Axis2 configuration descriptor file, a.k.a. axis2.xml file
-
-            This can be a file on the local file system, or a URL
-
-            e.g.
-            1. /home/repository/axis2.xml - An absolute path
-            2. conf/axis2.xml - In this case, the path is relative to CARBON_HOME
-            3. file:///home/carbon/repository/axis2.xml
-            4. http://repository/conf/axis2.xml
-        -->
-        <ConfigurationFile>${carbon.home}/repository/conf/axis2.xml</ConfigurationFile>
-
-        <!--
-          ServiceGroupContextIdleTime, which will be set in ConfigurationContex
-          for multiple clients which are going to access the same ServiceGroupContext
-          Default Value is 30 Sec.
-        -->
-        <ServiceGroupContextIdleTime>30000</ServiceGroupContextIdleTime>
-
-        <!--
-          This repository location is used to crete the client side configuration
-          context used by the server when calling admin services.
-        -->
-        <ClientRepositoryLocation>${carbon.home}/repository/deployment/client/</ClientRepositoryLocation>
-        <!-- This axis2 xml is used in createing the configuration context by the FE server
-         calling to BE server -->
-        <clientAxis2XmlLocation>${carbon.home}/repository/conf/axis2_client.xml</clientAxis2XmlLocation>
-    </Axis2Config>
-
-    <!--
-       The default user roles which will be created when the server
-       is started up for the first time.
-    -->
-    <ServiceUserRoles>
-        <Role>
-            <Name>admin</Name>
-            <Description>Default Administrator Role</Description>
-        </Role>
-        <Role>
-            <Name>user</Name>
-            <Description>Default User Role</Description>
-        </Role>
-    </ServiceUserRoles>
-
-    <!--
-      Security configurations
-    -->
-    <Security>
-        <!--
-            KeyStore which will be used for encrypting/decrypting passwords
-            and other sensitive information.
-        -->
-        <KeyStore>
-            <!-- Keystore file location-->
-            <Location>${carbon.home}/resources/security/wso2carbon.jks</Location>
-            <!-- Keystore type (JKS/PKCS12 etc.)-->
-            <Type>JKS</Type>
-            <!-- Keystore password-->
-            <Password>wso2carbon</Password>
-            <!-- Private Key alias-->
-            <KeyAlias>wso2carbon</KeyAlias>
-            <!-- Private Key password-->
-            <KeyPassword>wso2carbon</KeyPassword>
-        </KeyStore>
-
-        <!--
-           The directory under which all other KeyStore files will be stored
-        -->
-        <KeyStoresDir>${carbon.home}/repository/conf/keystores</KeyStoresDir>
-    </Security>
-
-    <!--
-       The temporary work directory
-    -->
-    <WorkDirectory>${carbon.home}/tmp/work</WorkDirectory>
-
-    <!--
-       House-keeping configuration
-    -->
-    <HouseKeeping>
-
-        <!--
-           true  - Start House-keeping thread on server startup
-           false - Do not start House-keeping thread on server startup.
-                   The user will run it manually as and when he wishes.
-        -->
-        <AutoStart>true</AutoStart>
-
-        <!--
-           The interval in *minutes*, between house-keeping runs
-        -->
-        <Interval>10</Interval>
-
-        <!--
-          The maximum time in *minutes*, temp files are allowed to live
-          in the system. Files/directories which were modified more than
-          "MaxTempFileLifetime" minutes ago will be removed by the
-          house-keeping task
-        -->
-        <MaxTempFileLifetime>30</MaxTempFileLifetime>
-    </HouseKeeping>
-
-    <!--
-       Configuration for handling different types of file upload.
-
-       To map all actions to a particular FileUploadExecutor, use
-       <Action>*</Action>
-    -->
-    <FileUploadConfig>
-        <Mapping>
-            <Actions>
-                <Action>keystore</Action>
-                <Action>certificate</Action>
-                <Action>*</Action>
-            </Actions>
-            <Class>org.wso2.carbon.ui.transports.fileupload.AnyFileUploadExecutor</Class>
-        </Mapping>
-
-        <Mapping>
-            <Actions>
-                <Action>jarZip</Action>
-            </Actions>
-            <Class>org.wso2.carbon.ui.transports.fileupload.JarZipUploadExecutor</Class>
-        </Mapping>
-        <Mapping>
-            <Actions>
-                <Action>dbs</Action>
-            </Actions>
-            <Class>org.wso2.carbon.ui.transports.fileupload.DBSFileUploadExecutor</Class>
-        </Mapping>
-        <Mapping>
-            <Actions>
-                <Action>tools</Action>
-            </Actions>
-            <Class>org.wso2.carbon.ui.transports.fileupload.ToolsFileUploadExecutor</Class>
-        </Mapping>
-        <Mapping>
-            <Actions>
-                <Action>toolsAny</Action>
-            </Actions>
-            <Class>org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor</Class>
-        </Mapping>
-    </FileUploadConfig>
-
-    <!--
-       Processors which process special HTTP GET requests such as ?wsdl, ?policy etc.
-
-       In order to plug in a processor to handle a special request, simply add an entry to this
-       section.
-
-       The value of the Item element is the first parameter in the query string(e.g. ?wsdl)
-       which needs special processing
-       
-       The value of the Class element is a class which implements
-       org.wso2.carbon.transport.HttpGetRequestProcessor
-    -->
-    <HttpGetRequestProcessors>
-        <Processor>
-            <Item>info</Item>
-            <Class>org.wso2.carbon.core.transports.util.InfoProcessor</Class>
-        </Processor>
-        <Processor>
-            <Item>wsdl</Item>
-            <Class>org.wso2.carbon.core.transports.util.Wsdl11Processor</Class>
-        </Processor>
-        <Processor>
-            <Item>wsdl2</Item>
-            <Class>org.wso2.carbon.core.transports.util.Wsdl20Processor</Class>
-        </Processor>
-        <Processor>
-            <Item>xsd</Item>
-            <Class>org.wso2.carbon.core.transports.util.XsdProcessor</Class>
-        </Processor>
-    </HttpGetRequestProcessors>
-
-    <!--
-    Server intializing code, specified as implementation classes of org.wso2.carbon.core.ServerInitializer.
-    This code will be run when the Carbon server is initialized
-    -->
-    <ServerInitializers>
-        <!--<Initializer></Initializer>-->
-    </ServerInitializers>
-    
-    <!--
-    Un-comment the following block to enable token based authenticator.
-    The priority of the default authenticator is 5 - to supersede that, you need to have higher priority level.
-    -->
-    <!-- Authenticators>
-		<TokenUIAuthenticator>
-			<Priority>20</Priority>
-		</TokenUIAuthenticator>
-	</Authenticators -->
-
-    <!--
-    @deprecated Use the registry.xml file to configure the Registry.
-    -->
-    <Registry/>
-
-    <!--
-    Indicates whether the Carbon Servlet is required by the system, and whether it should be
-    registered
-    -->
-    <RequireCarbonServlet>${require.carbon.servlet}</RequireCarbonServlet>
-
-    <!--
-    Carbon H2 OSGI Configuration
-    By default non of the servers start.
-        name="web" - Start the web server with the H2 Console
-        name="webPort" - The port (default: 8082)
-        name="webAllowOthers" - Allow other computers to connect
-        name="webSSL" - Use encrypted (HTTPS) connections
-        name="tcp" - Start the TCP server
-        name="tcpPort" - The port (default: 9092)
-        name="tcpAllowOthers" - Allow other computers to connect
-        name="tcpSSL" - Use encrypted (SSL) connections
-        name="pg" - Start the PG server
-        name="pgPort"  - The port (default: 5435)
-        name="pgAllowOthers"  - Allow other computers to connect
-        name="trace" - Print additional trace information; for all servers
-        name="baseDir" - The base directory for H2 databases; for all servers  
-    -->
-    <!--H2DatabaseConfiguration>
-        <property name="web" />
-        <property name="webPort">8082</property>
-        <property name="webAllowOthers" />
-        <property name="webSSL" />
-        <property name="tcp" />
-        <property name="tcpPort">9092</property>
-        <property name="tcpAllowOthers" />
-        <property name="tcpSSL" />
-        <property name="pg" />
-        <property name="pgPort">5435</property>
-        <property name="pgAllowOthers" />
-        <property name="trace" />
-        <property name="baseDir">${carbon.home}</property>
-    </H2DatabaseConfiguration-->
-</Server>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/cipher-text.properties
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/cipher-text.properties b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/cipher-text.properties
deleted file mode 100644
index 9432376..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/cipher-text.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-#aliases=testpass
-#
-## configuration  per each plaintext
-#testpass.secret=LxtcBuAfwazeX3Fk1kFHe9CvL6T3XaVAuh79ZpkJY5yeDAdfqmrVgq3HWNrLrWp4YLDUlhDP8VI0e/HMykul6yyuXa7YrZUpx5RovH5/Nl1dZvemgsVrgK5mioYtw9Z/1KQFDGphekd0NLNNXOD6uiQdUxrHc7jXXe9fAAXTDkI=
-#testpass.secret.alias=wso2carbon
-#testpass.secret.keystore=identity
-#
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/mgt-transports.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/mgt-transports.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/mgt-transports.xml
deleted file mode 100644
index af22641..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/mgt-transports.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<!--
-  ~ Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<!--
-  ~ This file contains the configuration of the transport connectors used by
-  ~ the embedded application server instance which hosts the Carbon management
-  ~ console
-  -->
-
-<transports>
-    <transport name="http" class="org.wso2.carbon.server.transports.http.HttpTransport">
-        <parameter name="port">9763</parameter>
-
-        <!--
-       Uncomment the following to enable Apache2 mod_proxy. The port on the Apache server is 80
-       in this case. 
-        -->
-        <!--<parameter name="proxyPort">80</parameter>-->
-
-        <parameter name="maxHttpHeaderSize">8192</parameter>
-        <parameter name="maxThreads">150</parameter>
-        <parameter name="minSpareThreads">25</parameter>
-        <parameter name="maxSpareThreads">75</parameter>
-        <parameter name="enableLookups">false</parameter>
-        <parameter name="disableUploadTimeout">false</parameter>
-        <parameter name="clientAuth">false</parameter>
-        <parameter name="maxKeepAliveRequests">100</parameter>
-        <parameter name="acceptCount">100</parameter>
-
-        <parameter name="compression">force</parameter>
-        <parameter name="compressionMinSize">2048</parameter>
-        <parameter name="noCompressionUserAgents">gozilla, traviata</parameter>
-        <parameter name="compressableMimeType">
-            text/html,text/javascript,application/x-javascript,application/javascript,application/xml,text/css,application/xslt+xml,text/xsl,image/gif,image/jpg,image/jpeg
-        </parameter>
-    </transport>
-
-    <transport name="https" class="org.wso2.carbon.server.transports.http.HttpsTransport">
-        <parameter name="port">9443</parameter>
-
-        <!--
-       Uncomment the following to enable Apache2 mod_proxy. The port on the Apache server is 443
-       in this case. 
-        -->
-        <!--<parameter name="proxyPort">443</parameter>-->
-        <!--
-       Uncomment the following to run on IBM J9 VM. Also, change the sslProtocol to SSL from the
-       Default value of TLS.
-        -->
-        <!--<parameter name="algorithm">IbmX509</parameter>-->
-        <parameter name="sslProtocol">TLS</parameter>
-        <parameter name="maxHttpHeaderSize">8192</parameter>
-        <parameter name="maxThreads">150</parameter>
-        <parameter name="minSpareThreads">25</parameter>
-        <parameter name="maxSpareThreads">75</parameter>
-        <parameter name="enableLookups">false</parameter>
-        <parameter name="disableUploadTimeout">false</parameter>
-        <parameter name="clientAuth">false</parameter>
-        <parameter name="maxKeepAliveRequests">100</parameter>
-        <parameter name="acceptCount">100</parameter>
-
-        <parameter name="compression">force</parameter>
-        <parameter name="compressionMinSize">2048</parameter>
-        <parameter name="noCompressionUserAgents">gozilla, traviata</parameter>
-        <parameter name="compressableMimeType">
-            text/html,text/javascript,application/x-javascript,application/javascript,application/xml,text/css,application/xslt+xml,text/xsl,image/gif,image/jpg,image/jpeg
-        </parameter>
-        <parameter name="keystore">${carbon.home}/resources/security/wso2carbon.jks</parameter>
-        <parameter name="keypass">wso2carbon</parameter>
-    </transport>
-</transports>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/mime.types
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/mime.types b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/mime.types
deleted file mode 100644
index 87ae7e8..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/mime.types
+++ /dev/null
@@ -1,727 +0,0 @@
-#
-# Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Media type for wsdl files. This is not defined in the original mime.types file.
-chemical/x-alchemy				alc
-application/andrew-inset			ez
-application/wsdl+xml				wsdl
-application/activemessage
-application/applefile
-application/atomicmail
-application/batch-SMTP
-application/beep+xml
-application/cals-1840
-application/commonground
-application/cu-seeme				cu
-application/cybercash
-application/dca-rft
-application/dec-dx
-application/docbook+xml
-application/dsptype				tsp
-application/dvcs
-application/edi-consent
-application/edi-x12
-application/edifact
-application/eshop
-application/font-tdpfr
-application/futuresplash			spl
-application/ghostview
-application/hta					hta
-application/http
-application/hyperstudio
-application/iges
-application/index
-application/index.cmd
-application/index.obj
-application/index.response
-application/index.vnd
-application/iotp
-application/ipp
-application/isup
-application/java-archive			jar
-application/java-serialized-object		ser
-application/java-vm				class
-application/mac-binhex40			hqx
-application/mac-compactpro			cpt
-application/macwriteii
-application/marc
-application/mathematica				nb
-application/mathematica-old
-application/msaccess				mdb
-application/msword				doc dot
-application/news-message-id
-application/news-transmission
-application/ocsp-request
-application/ocsp-response
-application/octet-stream			bin
-application/oda					oda
-application/ogg					ogg
-application/parityfec
-application/pdf					pdf
-application/pgp-encrypted
-application/pgp-keys				key
-application/pgp-signature			pgp
-application/pics-rules				prf
-application/pkcs10
-application/pkcs7-mime
-application/pkcs7-signature
-application/pkix-cert
-application/pkix-crl
-application/pkixcmp
-application/postscript				ps ai eps
-application/prs.alvestrand.titrax-sheet
-application/prs.cww
-application/prs.nprend
-application/qsig
-application/rar					rar
-application/rdf+xml				rdf
-application/remote-printing
-application/riscos
-application/rss+xml				rss
-application/rtf
-application/sdp
-application/set-payment
-application/set-payment-initiation
-application/set-registration
-application/set-registration-initiation
-application/sgml
-application/sgml-open-catalog
-application/sieve
-application/slate
-application/smil				smi smil
-application/timestamp-query
-application/timestamp-reply
-application/vemmi
-application/whoispp-query
-application/whoispp-response
-application/wita
-application/wordperfect				wpd
-application/wordperfect5.1			wp5
-application/x400-bp
-application/xhtml+xml				xhtml xht
-application/xml					xml xsl xslt jrxml
-application/xml-dtd
-application/xml-external-parsed-entity
-application/zip					zip
-application/vnd.3M.Post-it-Notes
-application/vnd.accpac.simply.aso
-application/vnd.accpac.simply.imp
-application/vnd.acucobol
-application/vnd.aether.imp
-application/vnd.anser-web-certificate-issue-initiation
-application/vnd.anser-web-funds-transfer-initiation
-application/vnd.audiograph
-application/vnd.bmi
-application/vnd.businessobjects
-application/vnd.canon-cpdl
-application/vnd.canon-lips
-application/vnd.cinderella			cdy
-application/vnd.claymore
-application/vnd.commerce-battelle
-application/vnd.commonspace
-application/vnd.comsocaller
-application/vnd.contact.cmsg
-application/vnd.cosmocaller
-application/vnd.ctc-posml
-application/vnd.cups-postscript
-application/vnd.cups-raster
-application/vnd.cups-raw
-application/vnd.cybank
-application/vnd.dna
-application/vnd.dpgraph
-application/vnd.dxr
-application/vnd.ecdis-update
-application/vnd.ecowin.chart
-application/vnd.ecowin.filerequest
-application/vnd.ecowin.fileupdate
-application/vnd.ecowin.series
-application/vnd.ecowin.seriesrequest
-application/vnd.ecowin.seriesupdate
-application/vnd.enliven
-application/vnd.epson.esf
-application/vnd.epson.msf
-application/vnd.epson.quickanime
-application/vnd.epson.salt
-application/vnd.epson.ssf
-application/vnd.ericsson.quickcall
-application/vnd.eudora.data
-application/vnd.fdf
-application/vnd.ffsns
-application/vnd.flographit
-application/vnd.framemaker
-application/vnd.fsc.weblaunch
-application/vnd.fujitsu.oasys
-application/vnd.fujitsu.oasys2
-application/vnd.fujitsu.oasys3
-application/vnd.fujitsu.oasysgp
-application/vnd.fujitsu.oasysprs
-application/vnd.fujixerox.ddd
-application/vnd.fujixerox.docuworks
-application/vnd.fujixerox.docuworks.binder
-application/vnd.fut-misnet
-application/vnd.grafeq
-application/vnd.groove-account
-application/vnd.groove-identity-message
-application/vnd.groove-injector
-application/vnd.groove-tool-message
-application/vnd.groove-tool-template
-application/vnd.groove-vcard
-application/vnd.hhe.lesson-player
-application/vnd.hp-HPGL
-application/vnd.hp-PCL
-application/vnd.hp-PCLXL
-application/vnd.hp-hpid
-application/vnd.hp-hps
-application/vnd.httphone
-application/vnd.hzn-3d-crossword
-application/vnd.ibm.MiniPay
-application/vnd.ibm.afplinedata
-application/vnd.ibm.modcap
-application/vnd.informix-visionary
-application/vnd.intercon.formnet
-application/vnd.intertrust.digibox
-application/vnd.intertrust.nncp
-application/vnd.intu.qbo
-application/vnd.intu.qfx
-application/vnd.irepository.package+xml
-application/vnd.is-xpr
-application/vnd.japannet-directory-service
-application/vnd.japannet-jpnstore-wakeup
-application/vnd.japannet-payment-wakeup
-application/vnd.japannet-registration
-application/vnd.japannet-registration-wakeup
-application/vnd.japannet-setstore-wakeup
-application/vnd.japannet-verification
-application/vnd.japannet-verification-wakeup
-application/vnd.koan
-application/vnd.lotus-1-2-3
-application/vnd.lotus-approach
-application/vnd.lotus-freelance
-application/vnd.lotus-notes
-application/vnd.lotus-organizer
-application/vnd.lotus-screencam
-application/vnd.lotus-wordpro
-application/vnd.mcd
-application/vnd.mediastation.cdkey
-application/vnd.meridian-slingshot
-application/vnd.mif
-application/vnd.minisoft-hp3000-save
-application/vnd.mitsubishi.misty-guard.trustweb
-application/vnd.mobius.daf
-application/vnd.mobius.dis
-application/vnd.mobius.msl
-application/vnd.mobius.plc
-application/vnd.mobius.txf
-application/vnd.motorola.flexsuite
-application/vnd.motorola.flexsuite.adsi
-application/vnd.motorola.flexsuite.fis
-application/vnd.motorola.flexsuite.gotap
-application/vnd.motorola.flexsuite.kmr
-application/vnd.motorola.flexsuite.ttc
-application/vnd.motorola.flexsuite.wem
-application/vnd.mozilla.xul+xml			xul
-application/vnd.ms-artgalry
-application/vnd.ms-asf
-application/vnd.ms-excel			xls xlb xlt
-application/vnd.ms-lrm
-application/vnd.ms-pki.seccat			cat
-application/vnd.ms-pki.stl			stl
-application/vnd.ms-powerpoint			ppt pps
-application/vnd.ms-project
-application/vnd.ms-tnef
-application/vnd.ms-works
-application/vnd.mseq
-application/vnd.msign
-application/vnd.music-niff
-application/vnd.musician
-application/vnd.netfpx
-application/vnd.noblenet-directory
-application/vnd.noblenet-sealer
-application/vnd.noblenet-web
-application/vnd.novadigm.EDM
-application/vnd.novadigm.EDX
-application/vnd.novadigm.EXT
-application/vnd.oasis.opendocument.chart	odc
-application/vnd.oasis.opendocument.database	odb
-application/vnd.oasis.opendocument.formula	odf
-application/vnd.oasis.opendocument.graphics	odg
-application/vnd.oasis.opendocument.graphics-template otg
-application/vnd.oasis.opendocument.image	odi
-application/vnd.oasis.opendocument.presentation	odp
-application/vnd.oasis.opendocument.presentation-template otp
-application/vnd.oasis.opendocument.spreadsheet	ods
-application/vnd.oasis.opendocument.spreadsheet-template ots
-application/vnd.oasis.opendocument.text		odt
-application/vnd.oasis.opendocument.text-master	odm
-application/vnd.oasis.opendocument.text-template ott
-application/vnd.oasis.opendocument.text-web	oth
-application/vnd.osa.netdeploy
-application/vnd.palm
-application/vnd.pg.format
-application/vnd.pg.osasli
-application/vnd.powerbuilder6
-application/vnd.powerbuilder6-s
-application/vnd.powerbuilder7
-application/vnd.powerbuilder7-s
-application/vnd.powerbuilder75
-application/vnd.powerbuilder75-s
-application/vnd.previewsystems.box
-application/vnd.publishare-delta-tree
-application/vnd.pvi.ptid1
-application/vnd.pwg-xhtml-print+xml
-application/vnd.rapid
-application/vnd.rim.cod				cod
-application/vnd.s3sms
-application/vnd.seemail
-application/vnd.shana.informed.formdata
-application/vnd.shana.informed.formtemplate
-application/vnd.shana.informed.interchange
-application/vnd.shana.informed.package
-application/vnd.smaf				mmf
-application/vnd.sss-cod
-application/vnd.sss-dtf
-application/vnd.sss-ntf
-application/vnd.stardivision.calc		sdc
-application/vnd.stardivision.draw		sda
-application/vnd.stardivision.impress		sdd sdp
-application/vnd.stardivision.math		smf
-application/vnd.stardivision.writer		sdw vor
-application/vnd.stardivision.writer-global	sgl
-application/vnd.street-stream
-application/vnd.sun.xml.calc			sxc
-application/vnd.sun.xml.calc.template		stc
-application/vnd.sun.xml.draw			sxd
-application/vnd.sun.xml.draw.template		std
-application/vnd.sun.xml.impress			sxi
-application/vnd.sun.xml.impress.template	sti
-application/vnd.sun.xml.math			sxm
-application/vnd.sun.xml.writer			sxw
-application/vnd.sun.xml.writer.global		sxg
-application/vnd.sun.xml.writer.template		stw
-application/vnd.svd
-application/vnd.swiftview-ics
-application/vnd.symbian.install			sis
-application/vnd.triscape.mxs
-application/vnd.trueapp
-application/vnd.truedoc
-application/vnd.tve-trigger
-application/vnd.ufdl
-application/vnd.uplanet.alert
-application/vnd.uplanet.alert-wbxml
-application/vnd.uplanet.bearer-choice
-application/vnd.uplanet.bearer-choice-wbxml
-application/vnd.uplanet.cacheop
-application/vnd.uplanet.cacheop-wbxml
-application/vnd.uplanet.channel
-application/vnd.uplanet.channel-wbxml
-application/vnd.uplanet.list
-application/vnd.uplanet.list-wbxml
-application/vnd.uplanet.listcmd
-application/vnd.uplanet.listcmd-wbxml
-application/vnd.uplanet.signal
-application/vnd.vcx
-application/vnd.vectorworks
-application/vnd.vidsoft.vidconference
-application/vnd.visio				vsd
-application/vnd.vividence.scriptfile
-application/vnd.wap.sic
-application/vnd.wap.slc
-application/vnd.wap.wbxml			wbxml
-application/vnd.wap.wmlc			wmlc
-application/vnd.wap.wmlscriptc			wmlsc
-application/vnd.webturbo
-application/vnd.wrq-hp3000-labelled
-application/vnd.wso2.endpoint
-application/vnd.wso2.governance-archive		gar
-application/vnd.wso2-hyperlink
-application/vnd.wt.stf
-application/vnd.xara
-application/vnd.xfdl
-application/vnd.yellowriver-custom-menu
-application/x-123				wk
-application/x-abiword				abw
-application/x-apple-diskimage			dmg
-application/x-bcpio				bcpio
-application/x-bittorrent			torrent
-application/x-cdf				cdf
-application/x-cdlink				vcd
-application/x-chess-pgn				pgn
-application/x-core
-application/x-cpio				cpio
-application/x-csh				csh
-application/x-debian-package			deb udeb
-application/x-director				dcr dir dxr
-application/x-dms				dms
-application/x-doom				wad
-application/x-dvi				dvi
-application/x-executable
-application/x-flac				flac
-application/x-font				pfa pfb gsf pcf pcf.Z
-application/x-freemind				mm
-application/x-futuresplash			spl
-application/x-gnumeric				gnumeric
-application/x-go-sgf				sgf
-application/x-graphing-calculator		gcf
-application/x-gtar				gtar tgz taz
-application/x-hdf				hdf
-application/x-httpd-php				phtml pht php
-application/x-httpd-php-source			phps
-application/x-httpd-php3			php3
-application/x-httpd-php3-preprocessed		php3p
-application/x-httpd-php4			php4
-application/x-httpd-eruby			rhtml
-application/x-ica				ica
-application/x-internet-signup			ins isp
-application/x-iphone				iii
-application/x-iso9660-image			iso
-application/x-java-applet
-application/x-java-bean
-application/x-java-jnlp-file			jnlp
-application/x-javascript			js
-application/x-jmol				jmz
-application/x-kchart				chrt
-application/x-kdelnk
-application/x-killustrator			kil
-application/x-koan				skp skd skt skm
-application/x-kpresenter			kpr kpt
-application/x-kspread				ksp
-application/x-kword				kwd kwt
-application/x-latex				latex
-application/x-lha				lha
-application/x-lzh				lzh
-application/x-lzx				lzx
-application/x-maker				frm maker frame fm fb book fbdoc
-application/x-mif				mif
-application/x-ms-wmd				wmd
-application/x-ms-wmz				wmz
-application/x-msdos-program			com exe bat dll
-application/x-msi				msi
-application/x-netcdf				nc
-application/x-ns-proxy-autoconfig		pac
-application/x-nwc				nwc
-application/x-object				o
-application/x-oz-application			oza
-application/x-pkcs7-certreqresp			p7r
-application/x-pkcs7-crl				crl
-application/x-python-code			pyc pyo
-application/x-quicktimeplayer			qtl
-application/x-redhat-package-manager		rpm
-application/x-rx
-application/x-sh				sh
-application/x-shar				shar
-application/x-shellscript
-application/x-shockwave-flash			swf swfl
-application/x-stuffit				sit
-application/x-sv4cpio				sv4cpio
-application/x-sv4crc				sv4crc
-application/x-tar				tar
-application/x-tcl				tcl
-application/x-tex-gf				gf
-application/x-tex-pk				pk
-application/x-texinfo				texinfo texi
-application/x-trash				~ % bak old sik
-application/x-troff				t tr roff
-application/x-troff-man				man
-application/x-troff-me				me
-application/x-troff-ms				ms
-application/x-ustar				ustar
-application/x-videolan
-application/x-wais-source			src
-application/x-wingz				wz
-application/x-x509-ca-cert			crt
-application/x-xcf				xcf
-application/x-xfig				fig
-application/x-xpinstall				xpi
-application/x-xsd+xml				xsd
-
-audio/32kadpcm
-audio/basic					au snd
-audio/g.722.1
-audio/l16
-audio/midi					mid midi kar
-audio/mp4a-latm
-audio/mpa-robust
-audio/mpeg					mpga mpega mp2 mp3 m4a
-audio/mpegurl					m3u
-audio/parityfec
-audio/prs.sid					sid
-audio/telephone-event
-audio/tone
-audio/vnd.cisco.nse
-audio/vnd.cns.anp1
-audio/vnd.cns.inf1
-audio/vnd.digital-winds
-audio/vnd.everad.plj
-audio/vnd.lucent.voice
-audio/vnd.nortel.vbk
-audio/vnd.nuera.ecelp4800
-audio/vnd.nuera.ecelp7470
-audio/vnd.nuera.ecelp9600
-audio/vnd.octel.sbc
-audio/vnd.qcelp
-audio/vnd.rhetorex.32kadpcm
-audio/vnd.vmx.cvsd
-audio/x-aiff					aif aiff aifc
-audio/x-gsm					gsm
-audio/x-mpegurl					m3u
-audio/x-ms-wma					wma
-audio/x-ms-wax					wax
-audio/x-pn-realaudio-plugin
-audio/x-pn-realaudio				ra rm ram
-audio/x-realaudio				ra
-audio/x-scpls					pls
-audio/x-sd2					sd2
-audio/x-wav					wav
-
-chemical/x-alchemy				alc
-chemical/x-cache				cac cache
-chemical/x-cache-csf				csf
-chemical/x-cactvs-binary			cbin cascii ctab
-chemical/x-cdx					cdx
-chemical/x-cerius				cer
-chemical/x-chem3d				c3d
-chemical/x-chemdraw				chm
-chemical/x-cif					cif
-chemical/x-cmdf					cmdf
-chemical/x-cml					cml
-chemical/x-compass				cpa
-chemical/x-crossfire				bsd
-chemical/x-csml					csml csm
-chemical/x-ctx					ctx
-chemical/x-cxf					cxf cef
-#chemical/x-daylight-smiles			smi
-chemical/x-embl-dl-nucleotide			emb embl
-chemical/x-galactic-spc				spc
-chemical/x-gamess-input				inp gam gamin
-chemical/x-gaussian-checkpoint			fch fchk
-chemical/x-gaussian-cube			cub
-chemical/x-gaussian-input			gau gjc gjf
-chemical/x-gaussian-log				gal
-chemical/x-gcg8-sequence			gcg
-chemical/x-genbank				gen
-chemical/x-hin					hin
-chemical/x-isostar				istr ist
-chemical/x-jcamp-dx				jdx dx
-chemical/x-kinemage				kin
-chemical/x-macmolecule				mcm
-chemical/x-macromodel-input			mmd mmod
-chemical/x-mdl-molfile				mol
-chemical/x-mdl-rdfile				rd
-chemical/x-mdl-rxnfile				rxn
-chemical/x-mdl-sdfile				sd sdf
-chemical/x-mdl-tgf				tgf
-#chemical/x-mif					mif
-chemical/x-mmcif				mcif
-chemical/x-mol2					mol2
-chemical/x-molconn-Z				b
-chemical/x-mopac-graph				gpt
-chemical/x-mopac-input				mop mopcrt mpc dat zmt
-chemical/x-mopac-out				moo
-chemical/x-mopac-vib				mvb
-chemical/x-ncbi-asn1				asn
-chemical/x-ncbi-asn1-ascii			prt ent
-chemical/x-ncbi-asn1-binary			val aso
-chemical/x-ncbi-asn1-spec			asn
-chemical/x-pdb					pdb ent
-chemical/x-rosdal				ros
-chemical/x-swissprot				sw
-chemical/x-vamas-iso14976			vms
-chemical/x-vmd					vmd
-chemical/x-xtel					xtel
-chemical/x-xyz					xyz
-
-image/cgm
-image/g3fax
-image/gif					gif
-image/ief					ief
-image/jpeg					jpeg jpg jpe
-image/naplps
-image/pcx					pcx
-image/png					png
-image/prs.btif
-image/prs.pti
-image/svg+xml					svg svgz
-image/tiff					tiff tif
-image/vnd.cns.inf2
-image/vnd.djvu					djvu djv
-image/vnd.dwg
-image/vnd.dxf
-image/vnd.fastbidsheet
-image/vnd.fpx
-image/vnd.fst
-image/vnd.fujixerox.edmics-mmr
-image/vnd.fujixerox.edmics-rlc
-image/vnd.mix
-image/vnd.net-fpx
-image/vnd.svf
-image/vnd.wap.wbmp				wbmp
-image/vnd.xiff
-image/x-cmu-raster				ras
-image/x-coreldraw				cdr
-image/x-coreldrawpattern			pat
-image/x-coreldrawtemplate			cdt
-image/x-corelphotopaint				cpt
-image/x-icon					ico
-image/x-jg					art
-image/x-jng					jng
-image/x-ms-bmp					bmp
-image/x-photoshop				psd
-image/x-portable-anymap				pnm
-image/x-portable-bitmap				pbm
-image/x-portable-graymap			pgm
-image/x-portable-pixmap				ppm
-image/x-rgb					rgb
-image/x-xbitmap					xbm
-image/x-xpixmap					xpm
-image/x-xwindowdump				xwd
-
-inode/chardevice
-inode/blockdevice
-inode/directory-locked
-inode/directory
-inode/fifo
-inode/socket
-
-message/delivery-status
-message/disposition-notification
-message/external-body
-message/http
-message/s-http
-message/news
-message/partial
-message/rfc822
-
-model/iges					igs iges
-model/mesh					msh mesh silo
-model/vnd.dwf
-model/vnd.flatland.3dml
-model/vnd.gdl
-model/vnd.gs-gdl
-model/vnd.gtw
-model/vnd.mts
-model/vnd.vtu
-model/vrml					wrl vrml
-
-multipart/alternative
-multipart/appledouble
-multipart/byteranges
-multipart/digest
-multipart/encrypted
-multipart/form-data
-multipart/header-set
-multipart/mixed
-multipart/parallel
-multipart/related
-multipart/report
-multipart/signed
-multipart/voice-message
-
-text/calendar					ics icz
-text/comma-separated-values			csv
-text/css					css
-text/directory
-text/english
-text/enriched
-text/h323					323
-text/html					html htm shtml
-text/iuls					uls
-text/mathml					mml
-text/parityfec
-text/plain					asc txt text diff pot
-text/prs.lines.tag
-text/rfc822-headers
-text/richtext					rtx
-text/rtf					rtf
-text/scriptlet					sct wsc
-text/t140
-text/texmacs					tm ts
-text/tab-separated-values			tsv
-text/uri-list
-text/vnd.abc
-text/vnd.curl
-text/vnd.DMClientScript
-text/vnd.flatland.3dml
-text/vnd.fly
-text/vnd.fmi.flexstor
-text/vnd.in3d.3dml
-text/vnd.in3d.spot
-text/vnd.IPTC.NewsML
-text/vnd.IPTC.NITF
-text/vnd.latex-z
-text/vnd.motorola.reflex
-text/vnd.ms-mediapackage
-text/vnd.sun.j2me.app-descriptor		jad
-text/vnd.wap.si
-text/vnd.wap.sl
-text/vnd.wap.wml				wml
-text/vnd.wap.wmlscript				wmls
-text/x-bibtex					bib
-text/x-boo					boo
-text/x-c++hdr					h++ hpp hxx hh
-text/x-c++src					c++ cpp cxx cc
-text/x-chdr					h
-text/x-component				htc
-text/x-crontab
-text/x-csh					csh
-text/x-csrc					c
-text/x-dsrc					d
-text/x-haskell					hs
-text/x-java					java
-text/x-literate-haskell				lhs
-text/x-makefile
-text/x-moc					moc
-text/x-pascal					p pas
-text/x-pcs-gcd					gcd
-text/x-perl					pl pm
-text/x-python					py
-text/x-server-parsed-html
-text/x-setext					etx
-text/x-sh					sh
-text/x-tcl					tcl tk
-text/x-tex					tex ltx sty cls
-text/x-vcalendar				vcs
-text/x-vcard					vcf
-
-video/dl					dl
-video/dv					dif dv
-video/fli					fli
-video/gl					gl
-video/mpeg					mpeg mpg mpe
-video/mp4					mp4
-video/quicktime					qt mov
-video/mp4v-es
-video/parityfec
-video/pointer
-video/vnd.fvt
-video/vnd.motorola.video
-video/vnd.motorola.videop
-video/vnd.mpegurl				mxu
-video/vnd.mts
-video/vnd.nokia.interleaved-multimedia
-video/vnd.vivo
-video/x-la-asf					lsf lsx
-video/x-mng					mng
-video/x-ms-asf					asf asx
-video/x-ms-wm					wm
-video/x-ms-wmv					wmv
-video/x-ms-wmx					wmx
-video/x-ms-wvx					wvx
-video/x-msvideo					avi
-video/x-sgi-movie				movie
-
-x-conference/x-cooltalk				ice
-
-x-world/x-vrml					vrm vrml wrl

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/node/registry.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/node/registry.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/node/registry.xml
deleted file mode 100644
index 07ef69a..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/node/registry.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<!--
-  ~ Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<wso2registry>
-
-    <currentDBConfig>wso2registry</currentDBConfig>
-    <readOnly>false</readOnly>
-    <registryRoot>/</registryRoot>
-
-    <dbConfig name="wso2registry">
-        <url>jdbc:h2:tcp://localhost/~/test</url>
-        <userName>sa</userName>
-        <password></password>
-        <driverName>org.h2.Driver</driverName>
-        <maxActive>50</maxActive>
-        <maxWait>60000</maxWait>
-        <minIdle>5</minIdle>
-    </dbConfig>
-
-   <!--<handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.apache.synapse</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.apache.esb</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.apache.axis2</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.apache.wsas</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.WSDLMediaTypeHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/wsdl+xml</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.XSDMediaTypeHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/x-xsd+xml</property>
-        </filter>
-    </handler> -->
-
-    
-    <versionResourcesOnChange>true</versionResourcesOnChange>
-
-    <!-- NOTE: You can edit the options under "StaticConfiguration" only before the
-     startup. -->
-    <staticConfiguration>
-        <versioningProperties>true</versioningProperties>
-        <versioningComments>true</versioningComments>
-        <versioningTags>true</versioningTags>
-        <versioningRatings>true</versioningRatings>
-    </staticConfiguration>
-</wso2registry>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/node/user-mgt.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/node/user-mgt.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/node/user-mgt.xml
deleted file mode 100644
index 4a3dbf0..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/node/user-mgt.xml
+++ /dev/null
@@ -1,105 +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.
- -->
-<UserManager>
-	<Realm>
-		<Configuration>
-			<AdminRole>admin</AdminRole>
-			<AdminUser>
-				<UserName>admin</UserName>
-				<Password>admin</Password>
-			</AdminUser>
-			<EveryOneRoleName>everyone</EveryOneRoleName> <!-- By default users in thsi role sees the registry root -->
-			<ReadOnly>false</ReadOnly>
-			<MaxUserNameListLength>500</MaxUserNameListLength>
-			<Property name="url">jdbc:h2:tcp://localhost/~/test</Property>
-            <Property name="userName">sa</Property>
-            <Property name="password"></Property>
-            <Property name="driverName">org.h2.Driver</Property>
-            <Property name="maxActive">50</Property>
-            <Property name="maxWait">60000</Property>
-            <Property name="minIdle">5</Property>
-        </Configuration>
-        <UserStoreManager
-            class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
-            <Property name="SelectUserSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-	    <Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>
-            <Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>
-            <Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>
-            <Property name="GetUserProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-	        <Property name="GetUsersWithDefaultPasswordsSQL">SELECT UM_USER_NAME FROM UM_USER WHERE WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="UserNameUniqueAcrossTenantsSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
-            <Property name="GetUserIDFromUserNameSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetTenantIDFromUserNameSQL">SELECT UM_TENANT_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
-            <Property name="PasswordDigest">SHA-256</Property>
-            <Property name="StoreSaltedPassword">true</Property>
-            <Property name="UserNameUniqueAcrossTenants">false</Property>
-            <!-- writing sqls follow-->
-            <Property name="AddUserSQL">INSERT INTO UM_USER (UM_USER_NAME, UM_USER_PASSWORD, UM_SALT_VALUE, UM_REQUIRE_CHANGE, UM_CHANGED_TIME, UM_TENANT_ID) VALUES (?, ?, ?, ?, ?, ?)</Property>
-	    <Property name="AddRoleSQL">INSERT INTO UM_ROLE (UM_ROLE_NAME, UM_TENANT_ID) VALUES (?, ?)</Property>
-            <Property name="AddUserToRoleSQL">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?), ?)</Property>
-            <Property name="RemoveUserFromRoleSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="AddRoleToUserSQL">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?)</Property>
-            <Property name="RemoveRoleFromUserSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="DeleteRoleSQL">DELETE FROM UM_ROLE WHERE UM_ROLE_NAME = ? AND UM_TENANT_ID=?</Property>
-            <Property name="OnDeleteRoleRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="OnDeleteUserRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="OnDeleteUserRemoveUserAttributeSQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="DeleteUserSQL">DELETE FROM UM_USER WHERE UM_USER_NAME = ? AND UM_TENANT_ID=?</Property>
-            <Property name="UpdateUserPasswordSQL">UPDATE UM_USER SET UM_USER_PASSWORD= ?, UM_SALT_VALUE=?, UM_REQUIRE_CHANGE=?, UM_CHANGED_TIME=? WHERE UM_USER_NAME= ? AND UM_TENANT_ID=?</Property>
-	    <Property name="AddUserPropertySQL">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?, ?, ?, ?)</Property>
-            <Property name="UpdateUserPropertySQL">UPDATE UM_USER_ATTRIBUTE SET UM_ATTR_VALUE=? WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
-            <Property name="DeleteUserPropertySQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
-        </UserStoreManager>
-  <!--  <UserStoreManager
-            class="org.wso2.carbon.user.core.actdir.ActDirUserStoreManager">
-            <Property name="ConnectionURL">ldap://10.100.1.122:389</Property>
-            <Property name="ConnectionName">cn=Administrator,cn=users,dc=wso2,dc=lk</Property>
-            <Property name="ConnectionPassword">admin123</Property>
-            <Property name="UserSearchBase">dc=wso2,dc=lk</Property>
-            <Property name="FilterTenantsForUsers"></Property>
-       </UserStoreManager> -->
-        <!-- UserStoreManager
-            class="org.wso2.carbon.user.core.ldap.LDAPUserStoreManager">
-            <Property name="ConnectionURL">ldap://localhost:10389</Property>
-            <Property name="ConnectionName">uid=admin,ou=system</Property>
-            <Property name="ConnectionPassword">admin123</Property>
-            <Property name="UserSearchBase">ou=system</Property>
-             <Property name="UserNameSearchFilter">(&amp;(objectClass=person)(mail=?@{domain}))</Property>
-            <Property name="UserNameAttribute">mail</Property>
-        </UserStoreManager -->
-        <AuthorizationManager
-            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager"></AuthorizationManager>
-    </Realm>
-    <SystemPermission>
-        <Permission>login</Permission>
-        <Permission>manage-configuration</Permission>
-        <Permission>manage-security</Permission>
-        <Permission>upload-services</Permission>
-        <Permission>manage-services</Permission>
-        <Permission>manage-lc-configuration</Permission>
-        <Permission>manage-mediation</Permission>
-        <Permission>monitor-system</Permission>
-        <Permission>delegate-identity</Permission>
-    </SystemPermission>
-</UserManager>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/ports-config.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/ports-config.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/ports-config.xml
deleted file mode 100644
index dd4da8d..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/ports-config.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<!--
-  ~ Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<portsConfig>
-    <range>
-   	<start>49150</start>
-        <end>65535</end>
-    </range>
-    <Instance1>
-        <nioports>
-            <http>5443</http>
-            <https>5444</https>
-        </nioports>
-        <mgtports>
-            <http>6443</http>
-            <https>6444</https>
-        </mgtports>
-    </Instance1>
-    <Instance2>
-        <nioports>
-            <http>5445</http>
-            <https>5446</https>
-        </nioports>
-        <mgtports>
-            <http>6445</http>
-            <https>6446</https>
-        </mgtports>
-    </Instance2>
-    <Instance3>
-        <nioports>
-            <http>5447</http>
-            <https>5448</https>
-        </nioports>
-        <mgtports>
-            <http>6447</http>
-            <https>6448</https>
-        </mgtports>
-         
-    </Instance3>
-</portsConfig>
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/registry.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/registry.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/registry.xml
deleted file mode 100644
index e444de5..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/registry.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<!--
-  ~ Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<wso2registry>
-
-    <currentDBConfig>wso2registry</currentDBConfig>
-    <readOnly>false</readOnly>
-    <registryRoot>/</registryRoot>
-
-    <dbConfig name="wso2registry">
-        <url>jdbc:h2:repository/database/WSO2CARBON_DB</url>
-        <userName>wso2carbon</userName>
-        <password>wso2carbon</password>
-        <driverName>org.h2.Driver</driverName>
-        <maxActive>50</maxActive>
-        <maxWait>60000</maxWait>
-        <minIdle>5</minIdle>
-    </dbConfig>
-
-   <!--<handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.apache.synapse</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.apache.esb</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.apache.axis2</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.apache.wsas</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.WSDLMediaTypeHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/wsdl+xml</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.XSDMediaTypeHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/x-xsd+xml</property>
-        </filter>
-    </handler> -->
-
-    <!--remoteInstance url="https://localhost:9443/registry">
-        <id>instanceid</id>
-        <username>username</username>
-        <password>password</password>
-    </remoteInstance-->
-
-    <!--remoteInstance url="https://localhost:9443/registry">
-        <id>instanceid</id>
-        <dbConfig>wso2registry</dbConfig>
-        <readOnly>false</readOnly>
-        <registryRoot>/</registryRoot>
-    </remoteInstance-->
-
-    <!--mount path="/_system/config" overwrite="true|false|virtual">
-        <instanceId>instanceid</instanceId>
-        <targetPath>/_system/nodes</targetPath>
-    </mount-->
-
-    
-    <versionResourcesOnChange>true</versionResourcesOnChange>
-
-    <!-- NOTE: You can edit the options under "StaticConfiguration" only before the
-     startup. -->
-    <staticConfiguration>
-        <versioningProperties>true</versioningProperties>
-        <versioningComments>true</versioningComments>
-        <versioningTags>true</versioningTags>
-        <versioningRatings>true</versioningRatings>
-    </staticConfiguration>
-</wso2registry>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/secret-conf.properties
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/secret-conf.properties b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/secret-conf.properties
deleted file mode 100644
index b8ad7ed..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/secret-conf.properties
+++ /dev/null
@@ -1,37 +0,0 @@
-#############################################################################
-## Security Configuration
-#############################################################################
-## The following property specifies a global password provider implementation
-## which will be used globally if not overriden in specific configurations
-##carbon.secretProvider=<any implementation of org.apache.synapse.commons.security.secret.SecretCallbackHandler>
-##Examples:
-##carbon.secretProvider=org.apache.synapse.commons.security.secret.handler.SecretManagerSecretCallbackHandler
-##carbon.secretProvider=org.apache.synapse.commons.security.secret.handler.JMXSecretCallbackHandler
-##carbon.secretProvider=org.apache.synapse.commons.security.secret.handler.JlineSecretCallbackHandler
-##carbon.secretProvider=org.apache.synapse.commons.security.secret.handler.JBossEncryptionSecretCallbackHandler
-#
-##Secret Repositories configuration
-#
-#secretRepositories=file
-#secretRepositories.file.provider=org.apache.synapse.commons.security.secret.repository.filebased.FileBaseSecretRepositoryProvider
-#secretRepositories.file.location=cipher-text.properties
-#
-##KeyStores configurations
-#
-#keystore.identity.location=resources/security/wso2carbon.jks
-#keystore.identity.type=JKS
-#keystore.identity.alias=wso2carbon
-#keystore.identity.store.password=wso2carbon
-##keystore.identity.store.secretProvider=<any implementation of org.apache.synapse.commons.security.secret.SecretCallbackHandler>
-#keystore.identity.key.password=wso2carbon
-##keystore.identity.key.secretProvider=<any implementation of org.apache.synapse.commons.security.secret.SecretCallbackHandler>
-##keystore.identity.parameters=enableHostnameVerifier=false;keyStoreCertificateFilePath=/home/esb.cer
-#
-#keystore.trust.location=resources/security/client-truststore.jks
-#keystore.trust.type=JKS
-#keystore.trust.alias=wso2carbon
-#keystore.trust.store.password=wso2carbon
-##keystore.trust.store.secretProvider=<any implementation of org.apache.synapse.commons.security.secret.SecretCallbackHandler>
-#
-#
-#

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/synapse.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/synapse.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/synapse.xml
deleted file mode 100644
index 2a2c73e..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/synapse.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~  Copyright (c) 2009, 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.
-  -->
-
-<!-- An empty flat synapse configuration shipped with the WSO2 ESB -->
-<definitions xmlns="http://ws.apache.org/ns/synapse">
-    
-    <task class="org.wso2.carbon.multiple.instance.endpoint.mgt.autoscale.LocalLoadAnalyzerTask" name="LocalLoadAnalyzer">
-        <property name="maxAppInstances" value="10"/>
-        <property name="minAppInstances" value="1"/>
-        <trigger interval="5"/>
-    </task>
-</definitions>
-<!-- You can add any flat sequences, endpoints, etc.. to this synapse.xml file if you do
-    *not* want to keep the artifacts in several files -->

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-config1.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-config1.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-config1.xml
deleted file mode 100644
index 7529fe9..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-config1.xml
+++ /dev/null
@@ -1,47 +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.
- -->
-<throttlingConfig xmlns="http://wso2.com/carbon/multitenancy/throttling/config">
-	<tasks>
-		<task>
-			<parameters>
-				<parameter name="interval">15</parameter>
-			</parameters>
-			<dataProviders>
-				<dataProvider
-					class="org.wso2.stratos.throttling.manager.dataproviders.BandwidthDataProvider">
-				</dataProvider>
-				<!--
-					<dataProvider
-					class="org.wso2.stratos.throttling.manager.dataproviders.BillingDataProvider">
-					</dataProvider>
-				-->
-				<dataProvider
-					class="org.wso2.stratos.throttling.manager.dataproviders.DBContentVolumeDataProvider">
-				</dataProvider>
-				<dataProvider
-					class="org.wso2.stratos.throttling.test.utils.CustomDataProvider">
-				</dataProvider>
-				<!--
-					<dataProvider
-					class="org.wso2.stratos.throttling.manager.dataproviders.UsersCountDataProvider">
-					</dataProvider>
-				-->
-			</dataProviders>
-		</task>
-	</tasks>
-</throttlingConfig>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-config2.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-config2.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-config2.xml
deleted file mode 100644
index 7529fe9..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-config2.xml
+++ /dev/null
@@ -1,47 +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.
- -->
-<throttlingConfig xmlns="http://wso2.com/carbon/multitenancy/throttling/config">
-	<tasks>
-		<task>
-			<parameters>
-				<parameter name="interval">15</parameter>
-			</parameters>
-			<dataProviders>
-				<dataProvider
-					class="org.wso2.stratos.throttling.manager.dataproviders.BandwidthDataProvider">
-				</dataProvider>
-				<!--
-					<dataProvider
-					class="org.wso2.stratos.throttling.manager.dataproviders.BillingDataProvider">
-					</dataProvider>
-				-->
-				<dataProvider
-					class="org.wso2.stratos.throttling.manager.dataproviders.DBContentVolumeDataProvider">
-				</dataProvider>
-				<dataProvider
-					class="org.wso2.stratos.throttling.test.utils.CustomDataProvider">
-				</dataProvider>
-				<!--
-					<dataProvider
-					class="org.wso2.stratos.throttling.manager.dataproviders.UsersCountDataProvider">
-					</dataProvider>
-				-->
-			</dataProviders>
-		</task>
-	</tasks>
-</throttlingConfig>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-config3.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-config3.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-config3.xml
deleted file mode 100644
index 7529fe9..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-config3.xml
+++ /dev/null
@@ -1,47 +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.
- -->
-<throttlingConfig xmlns="http://wso2.com/carbon/multitenancy/throttling/config">
-	<tasks>
-		<task>
-			<parameters>
-				<parameter name="interval">15</parameter>
-			</parameters>
-			<dataProviders>
-				<dataProvider
-					class="org.wso2.stratos.throttling.manager.dataproviders.BandwidthDataProvider">
-				</dataProvider>
-				<!--
-					<dataProvider
-					class="org.wso2.stratos.throttling.manager.dataproviders.BillingDataProvider">
-					</dataProvider>
-				-->
-				<dataProvider
-					class="org.wso2.stratos.throttling.manager.dataproviders.DBContentVolumeDataProvider">
-				</dataProvider>
-				<dataProvider
-					class="org.wso2.stratos.throttling.test.utils.CustomDataProvider">
-				</dataProvider>
-				<!--
-					<dataProvider
-					class="org.wso2.stratos.throttling.manager.dataproviders.UsersCountDataProvider">
-					</dataProvider>
-				-->
-			</dataProviders>
-		</task>
-	</tasks>
-</throttlingConfig>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-rules1.drl
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-rules1.drl b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-rules1.drl
deleted file mode 100644
index d187c17..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-rules1.drl
+++ /dev/null
@@ -1,60 +0,0 @@
-import org.wso2.stratos.throttling.manager.dataobjects.*;
-import org.wso2.stratos.billing.mgt.dataobjects.*;
-import org.wso2.stratos.common.constants.*;
-
-
-rule clearRestrictions
-when
-$dataContext : ThrottlingDataContext();
-eval($dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY) < 8)
-
-then
-
-ThrottlingAccessValidation validation = $dataContext.getAccessValidation();
-validation.setTenantBlocked(StratosConstants.THROTTLING_IN_DATA_ACTION,
-            false, null);
-
-end
-
-
-rule restrictFileSize
-when
-$dataContext : ThrottlingDataContext();
-eval($dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY) > 8 &&
-                            $dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY)  < 10)
-
-then
-
-ThrottlingAccessValidation validation = $dataContext.getAccessValidation();
-validation.setTenantBlocked(StratosConstants.THROTTLING_IN_DATA_ACTION,
-            true, "Your data is big. Bigger than 8");
-
-end
-
-rule stranageTest1Rule
-when
-$package: MultitenancyPackage(name == "test1")
-$dataContext : ThrottlingDataContext()
-eval($dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY)  > 15 &&
-            $dataContext.getDataObject(ThrottlingDataEntryConstants.PACKAGE) == $package)
-
-then
-
-ThrottlingAccessValidation validation = $dataContext.getAccessValidation();
-validation.setTenantBlocked(StratosConstants.THROTTLING_IN_DATA_ACTION,
-            true, "the strange condition for test1 is met");
-
-end
-
-rule strangeTest2Rule
-when
-$package: MultitenancyPackage(name == "test2")
-$dataContext : ThrottlingDataContext()
-eval($dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY)  > 15 &&
-            $dataContext.getDataObject(ThrottlingDataEntryConstants.PACKAGE) == $package)
-then
-ThrottlingAccessValidation validation = $dataContext.getAccessValidation();
-validation.setTenantBlocked(StratosConstants.THROTTLING_IN_DATA_ACTION,
-            true, "the strange condition for test2 is met");
-
-end

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-rules2.drl
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-rules2.drl b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-rules2.drl
deleted file mode 100644
index 0b8804e..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-rules2.drl
+++ /dev/null
@@ -1,18 +0,0 @@
-import org.wso2.stratos.throttling.manager.dataobjects.*;
-import org.wso2.stratos.common.constants.*;
-
-rule restrictBandwidth
-when
-
-$dataContext : ThrottlingDataContext()
-eval($dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_INCOMING_BANDWIDTH) > 12)
-
-then
-
-ThrottlingAccessValidation validation = $dataContext.getAccessValidation();
-long tenantIncomingBandwidth = $dataContext.getDataLong(
-		ThrottlingDataEntryConstants.TENANT_INCOMING_BANDWIDTH);
-validation.setTenantBlocked(StratosConstants.THROTTLING_IN_DATA_ACTION, true,
-		"Your incoming bw is big. Bigger than 12. your value: " + tenantIncomingBandwidth);
-
-end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-rules3.drl
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-rules3.drl b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-rules3.drl
deleted file mode 100644
index 481d903..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/throttling-rules3.drl
+++ /dev/null
@@ -1,17 +0,0 @@
-import org.wso2.stratos.throttling.manager.dataobjects.*;
-import org.wso2.stratos.common.constants.*;
-
-rule restrictCapacity
-when
-
-$dataContext : ThrottlingDataContext()
-eval($dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY) > 12)
-
-then
-
-ThrottlingAccessValidation validation = $dataContext.getAccessValidation();
-long tenantCapacity = $dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY);
-validation.setTenantBlocked(StratosConstants.THROTTLING_IN_DATA_ACTION, true,
-            "Your resource volume is big. Bigger than 12. your value: " + tenantCapacity);
-
-end
\ No newline at end of file


[08/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/WebAppRequestListener.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/WebAppRequestListener.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/WebAppRequestListener.java
deleted file mode 100644
index ba48f55..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/listeners/WebAppRequestListener.java
+++ /dev/null
@@ -1,179 +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.throttling.agent.listeners;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.base.MultitenantConstants;
-import org.wso2.carbon.context.CarbonContext;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.throttling.agent.ThrottlingAgent;
-import org.wso2.carbon.throttling.agent.cache.TenantThrottlingInfo;
-import org.wso2.carbon.throttling.agent.cache.ThrottlingActionInfo;
-import org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve;
-import org.wso2.carbon.user.api.UserStoreException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class WebAppRequestListener implements CarbonTomcatValve {
-
-    private static final Log log = LogFactory.getLog(WebAppRequestListener.class);
-
-    private static final Pattern servicesURLPattern = Pattern.compile("\\/services\\/t\\/(.*?)\\/");
-    private static final Pattern webAppsURLPattern = Pattern.compile("\\/t\\/(.*?)\\/webapps\\/");
-
-    private static final String CONTEXT_SERVICES = "services";
-    private static final String CONTEXT_WEBAPPS = "webapps";
-
-    private ThrottlingAgent throttlingAgent;
-
-    public WebAppRequestListener(ThrottlingAgent throttlingAgent) {
-        this.throttlingAgent = throttlingAgent;
-    }
-
-    public void invoke(HttpServletRequest request, HttpServletResponse response) {
-        String requestURI = request.getRequestURI();
-        String tenantDomainName = CarbonContext.getCurrentContext().
-                                  getTenantDomain();
-        String urlContext = getContext(requestURI);
-        if (tenantDomainName != null && urlContext != null) {
-            try {
-                int tenantId = throttlingAgent.getRealmService().getTenantManager().
-                        getTenantId(tenantDomainName);
-                if (tenantId <= 0) {
-                    //Allow to proceed
-                } else {
-                    if (!throttlingAgent.getRealmService().getTenantManager().getTenant(tenantId).
-                            isActive()) {
-                        //Check weather activated tenant or not
-                        String msg = "You are sending request to a deactivated tenant. for Domain: "
-                                     + tenantDomainName;
-                        log.error(msg);
-                        try {
-                            response.sendError(403, msg);
-                        } catch (IOException e) {
-                            String message = "Error in sending throttling rule violation message by an inactive tenant." +
-                                             " Tenant Domain: " + tenantDomainName;
-                            log.error(message, e);
-                        }
-                    } else {
-                        //check weather request come to webapps
-                        if (CONTEXT_WEBAPPS.equals(urlContext)) {
-                            //if tenant is active we will throttle other parameters such as bandwidth in/out
-                            try {
-                                TenantThrottlingInfo throttlingInfo =
-                                        throttlingAgent.getThrottlingInfoCache().
-                                                getTenantThrottlingInfo(tenantId);
-                                if (throttlingInfo != null) {
-                                    String[] actions =
-                                            new String[]{StratosConstants.THROTTLING_WEBAPP_IN_BANDWIDTH_ACTION,
-                                                         StratosConstants.THROTTLING_WEBAPP_OUT_BANDWIDTH_ACTION};
-                                    ThrottlingActionInfo actionInfo;
-
-                                    actionInfo = throttlingInfo.getThrottlingActionInfo(actions);
-                                    if (actionInfo != null && actionInfo.isBlocked()) {
-                                        String blockedMsg = actionInfo.getMessage();
-                                        String msg = "This action is blocked. Reason: "
-                                                     + blockedMsg;
-                                        log.error(msg);
-                                        response.sendError(509, msg);
-                                    }
-                                }
-                            } catch (Exception ex) {
-                                String msg = "Error in sending throttling rule violation message." +
-                                             " Tenant Domain: " + tenantDomainName;
-                                log.error(msg, ex);
-                                return;
-                            }
-                        } else if (CONTEXT_SERVICES.equals(urlContext)) {
-                            try {
-                                TenantThrottlingInfo throttlingInfo =
-                                        throttlingAgent.getThrottlingInfoCache().
-                                                getTenantThrottlingInfo(tenantId);
-                                if (throttlingInfo != null) {
-                                    String[] actions =
-                                            new String[]{StratosConstants.THROTTLING_SERVICE_IN_BANDWIDTH_ACTION,
-                                                         StratosConstants.THROTTLING_SERVICE_OUT_BANDWIDTH_ACTION};
-                                    ThrottlingActionInfo actionInfo;
-
-                                    actionInfo = throttlingInfo.getThrottlingActionInfo(actions);
-                                    if (actionInfo != null && actionInfo.isBlocked()) {
-                                        String blockedMsg = actionInfo.getMessage();
-                                        String msg = "This action is blocked. Reason: " +
-                                                     blockedMsg;
-                                        log.error(msg);
-                                        response.sendError(509, msg);
-                                    }
-                                }
-                            } catch (Exception ex) {
-                                String msg = "Error in sending throttling rule violation message." +
-                                             " Tenant Domain: " + tenantDomainName;
-                                log.error(msg, ex);
-                            }
-                        }
-
-                    }
-                }
-            } catch (UserStoreException e) {
-                String msg = "Error in getting tenant id to evaluate throttling rule. " +
-                             "Tenant Domain: " + tenantDomainName;
-                log.error(msg, e);
-            }
-
-        }
-    }
-
-    /**
-     * Extract tenant domain from request url
-     *
-     * @return tenant domain
-     */
-    public String getTenantName(String requestUrl) {
-        Matcher matcher = servicesURLPattern.matcher(requestUrl);
-        if (matcher.find()) {
-            return matcher.group(1);
-        }
-
-        matcher = webAppsURLPattern.matcher(requestUrl);
-        if (matcher.find()) {
-            return matcher.group(1);
-        }
-
-        return MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
-    }
-
-    /**
-     * Extract context from the request url
-     *
-     * @return context string
-     */
-    public String getContext(String requestUrl) {
-        if (requestUrl.contains("/services") && requestUrl.contains("/t")) {
-            return CONTEXT_SERVICES;
-        }
-
-        if (requestUrl.contains("/t") && requestUrl.contains("/webapps")) {
-            return CONTEXT_WEBAPPS;
-        }
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationException.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationException.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationException.java
deleted file mode 100644
index 9d6be14..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationException.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.agent.validation;
-
-public class ValidationException extends Exception {
-    public ValidationException(String msg, Exception e) {
-        super(msg, e);
-    }
-    public ValidationException(String msg) {
-        super(msg);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationInfo.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationInfo.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationInfo.java
deleted file mode 100644
index 1f2de60..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationInfo.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.agent.validation;
-
-public class ValidationInfo {
-	boolean isActionBlocked;
-	String blockedActionMsg;
-	
-	public ValidationInfo(){
-	    isActionBlocked = false;
-	}
-	
-	public boolean isActionBlocked() {
-		return isActionBlocked;
-	}
-	public void setActionBlocked(boolean isBlocked) {
-		this.isActionBlocked = isBlocked;
-	}
-	public String getBlockedActionMsg() {
-		return blockedActionMsg;
-	}
-	public void setBlockedActionMsg(String blockedMsg) {
-		this.blockedActionMsg = blockedMsg;
-	}
-	
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationInfoRetriever.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationInfoRetriever.java b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationInfoRetriever.java
deleted file mode 100644
index 0fc5066..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationInfoRetriever.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.agent.validation;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.registry.core.RegistryConstants;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.stratos.common.util.MeteringAccessValidationUtils;
-
-public class ValidationInfoRetriever {
-    private static final Log log = LogFactory.getLog(ValidationInfoRetriever.class);
-    UserRegistry governanceSystemRegistry;
-    
-    public ValidationInfoRetriever(UserRegistry governanceSystemRegistry) {
-        this.governanceSystemRegistry = governanceSystemRegistry;
-    }
-
-    public ValidationInfo getValidationInfo(String action, int tenantId) throws ValidationException {
-        ValidationInfo validationInfo = new ValidationInfo();
-        Resource validationInfoResource = getResource(tenantId);
-        if(validationInfoResource == null){
-            //this means, the user is allowed to proceed
-            return validationInfo;
-        }
-        
-        // first get the validation info for all actions
-        checkAction(StratosConstants.THROTTLING_ALL_ACTION, validationInfoResource, validationInfo);
-        if (validationInfo.isActionBlocked()) {
-            return validationInfo;
-        }
-        checkAction(action, validationInfoResource, validationInfo);
-        return validationInfo;
-    }
-    
-    public ValidationInfo getValidationInfo(String[] actions, int tenantId) throws ValidationException {
-        ValidationInfo validationInfo = new ValidationInfo();
-        Resource validationInfoResource = getResource(tenantId);
-        if(validationInfoResource == null){
-            //this means, the user is allowed to proceed
-            return validationInfo;
-        }
-        
-     // first get the validation info for all actions
-        checkAction(StratosConstants.THROTTLING_ALL_ACTION, validationInfoResource, validationInfo);
-        if (validationInfo.isActionBlocked()) {
-            return validationInfo;
-        }
-        
-        for(String action : actions){
-            checkAction(action, validationInfoResource, validationInfo);
-            if (validationInfo.isActionBlocked()) {
-                return validationInfo;
-            }
-        }
-        return validationInfo;
-    }
-    
-    private Resource getResource (int tenantId) throws ValidationException{
-     // first retrieve validation info for the tenant
-        String tenantValidationInfoResourcePath = 
-            StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
-                        RegistryConstants.PATH_SEPARATOR + tenantId;
-        Resource tenantValidationInfoResource = null;
-        try {
-            if (governanceSystemRegistry.resourceExists(tenantValidationInfoResourcePath)) {
-                tenantValidationInfoResource =
-                        governanceSystemRegistry.get(tenantValidationInfoResourcePath);
-            }
-        } catch (RegistryException e) {
-            String msg = "Error in getting the tenant validation info for tenant:" + tenantId;
-            log.error(msg, e);
-            throw new ValidationException(msg, e);
-        }
-        return tenantValidationInfoResource;
-    }
-
-    private void checkAction(String action, Resource tenantValidationInfoResource, 
-                             ValidationInfo validationInfo){
-        String blockActionStr =
-            tenantValidationInfoResource.getProperty(
-                    MeteringAccessValidationUtils.generateIsBlockedPropertyKey(action));
-
-        if ("true".equals(blockActionStr)) {
-            validationInfo.setActionBlocked(true);
-
-            String blockActionMsg =
-                tenantValidationInfoResource.getProperty(
-                        MeteringAccessValidationUtils.generateErrorMsgPropertyKey(action));
-            validationInfo.setBlockedActionMsg(blockActionMsg);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/resources/META-INF/module.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/resources/META-INF/module.xml b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/resources/META-INF/module.xml
deleted file mode 100644
index 145d965..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/resources/META-INF/module.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. licenses this file to you under the Apache License,
- ~ Version 2.0 (the "License"); you may not use this file except
- ~ in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~    http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied.  See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-<module name="usagethrottling" class="org.wso2.carbon.throttling.agent.listeners.ThrottlingModule">
-   <InFlow>
-        <handler name="InFlowUsageThrottlingHandler"
-                 class="org.wso2.carbon.throttling.agent.listeners.ServiceRequestListener">
-        <order phase="OpPhase" after="AuthorizationHandler"/>
-        </handler>
-   </InFlow>
-
-   <InFaultFlow>
-        <handler name="FaultInFlowUsageThrottlingHandler"
-                 class="org.wso2.carbon.throttling.agent.listeners.ServiceRequestListener">
-        <order phase="OpPhase" after="AuthorizationHandler"/>
-        </handler>
-   </InFaultFlow>
-  <parameter name="adminModule" locked="true">true</parameter>
-</module>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/resources/MultitenancyThrottlingService.wsdl
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/resources/MultitenancyThrottlingService.wsdl b/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/resources/MultitenancyThrottlingService.wsdl
deleted file mode 100644
index a652030..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.agent/2.1.0/src/main/resources/MultitenancyThrottlingService.wsdl
+++ /dev/null
@@ -1,82 +0,0 @@
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://services.manager.throttling.carbon.wso2.org" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://services.manager.throttling.carbon.wso2.org">
-    <wsdl:documentation>MultitenancyThrottlingService</wsdl:documentation>
-    <wsdl:types>
-        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.manager.throttling.carbon.wso2.org">
-            <xs:element name="executeThrottlingRulesException">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="executeThrottlingRulesException" nillable="true" type="ns:Exception" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:complexType name="Exception">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string" />
-                </xs:sequence>
-            </xs:complexType>
-            <xs:element name="executeThrottlingRules">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="tenantId" type="xs:int" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-        </xs:schema>
-    </wsdl:types>
-    <wsdl:message name="executeThrottlingRulesRequest">
-        <wsdl:part name="parameters" element="ns:executeThrottlingRules" />
-    </wsdl:message>
-    <wsdl:message name="executeThrottlingRulesException">
-        <wsdl:part name="parameters" element="ns:executeThrottlingRulesException" />
-    </wsdl:message>
-    <wsdl:portType name="MultitenancyThrottlingServicePortType">
-        <wsdl:operation name="executeThrottlingRules">
-            <wsdl:input message="ns:executeThrottlingRulesRequest" wsaw:Action="urn:executeThrottlingRules" />
-            <wsdl:fault message="ns:executeThrottlingRulesException" name="executeThrottlingRulesException" wsaw:Action="urn:executeThrottlingRulesexecuteThrottlingRulesException" />
-        </wsdl:operation>
-    </wsdl:portType>
-    <wsdl:binding name="MultitenancyThrottlingServiceSoap11Binding" type="ns:MultitenancyThrottlingServicePortType">
-        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
-        <wsdl:operation name="executeThrottlingRules">
-            <soap:operation soapAction="urn:executeThrottlingRules" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:fault name="executeThrottlingRulesException">
-                <soap:fault use="literal" name="executeThrottlingRulesException" />
-            </wsdl:fault>
-        </wsdl:operation>
-    </wsdl:binding>
-    <wsdl:binding name="MultitenancyThrottlingServiceSoap12Binding" type="ns:MultitenancyThrottlingServicePortType">
-        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
-        <wsdl:operation name="executeThrottlingRules">
-            <soap12:operation soapAction="urn:executeThrottlingRules" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:fault name="executeThrottlingRulesException">
-                <soap12:fault use="literal" name="executeThrottlingRulesException" />
-            </wsdl:fault>
-        </wsdl:operation>
-    </wsdl:binding>
-    <wsdl:binding name="MultitenancyThrottlingServiceHttpBinding" type="ns:MultitenancyThrottlingServicePortType">
-        <http:binding verb="POST" />
-        <wsdl:operation name="executeThrottlingRules">
-            <http:operation location="executeThrottlingRules" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-        </wsdl:operation>
-    </wsdl:binding>
-    <wsdl:service name="MultitenancyThrottlingService">
-        <wsdl:port name="MultitenancyThrottlingServiceHttpsSoap11Endpoint" binding="ns:MultitenancyThrottlingServiceSoap11Binding">
-            <soap:address location="https://192.168.1.100:9443/services/MultitenancyThrottlingService.MultitenancyThrottlingServiceHttpsSoap11Endpoint/" />
-        </wsdl:port>
-        <wsdl:port name="MultitenancyThrottlingServiceHttpsSoap12Endpoint" binding="ns:MultitenancyThrottlingServiceSoap12Binding">
-            <soap12:address location="https://192.168.1.100:9443/services/MultitenancyThrottlingService.MultitenancyThrottlingServiceHttpsSoap12Endpoint/" />
-        </wsdl:port>
-        <wsdl:port name="MultitenancyThrottlingServiceHttpsEndpoint" binding="ns:MultitenancyThrottlingServiceHttpBinding">
-            <http:address location="https://192.168.1.100:9443/services/MultitenancyThrottlingService.MultitenancyThrottlingServiceHttpsEndpoint/" />
-        </wsdl:port>
-    </wsdl:service>
-</wsdl:definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/pom.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/pom.xml
deleted file mode 100644
index 9fb038f..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/pom.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-<!--
-# Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-  -->
-<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>throttling-parent</artifactId>
-        <version>2.1.0</version>
-<relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.wso2.carbon.throttling.manager</artifactId>
-    <version>2.1.0</version>
-    <packaging>bundle</packaging>
-    <name>WSO2 Stratos - Throttling Manager</name>
-
-    <build>
-
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-            </plugin>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-surefire-plugin</artifactId>
-				<configuration>
-					<excludes>
-						<exclude>**/BaseTestCase.java</exclude>
-						<exclude>**/ThrottlingTest.java</exclude>
-					</excludes>
-				</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.throttling.manager.dataobjects,
-                        </Export-Package>
-                        <Private-Package>
-                            !org.wso2.carbon.throttling.manager.dataobjects,
-                            org.wso2.carbon.throttling.manager.*,
-                        </Private-Package>
-                        <!--<Require-Bundle>
-                            drools;visibility:=reexport
-                        </Require-Bundle>-->
-                        <Import-Package>
-                            org.wso2.carbon.rule.*,
-                            org.wso2.carbon.stratos.common.*,
-                            org.wso2.carbon.throttling.agent.*,
-                            org.wso2.carbon.billing.mgt.*,
-                            org.wso2.carbon.registry.core.*;version=1.0.1,
-                            org.wso2.carbon.registry.resource.*,
-                            org.quartz.*; version=2.1.1,
-                            !javax.xml.namespace,
-                            javax.xml.namespace; version=0.0.0,
-                            javax.servlet;version="${imp.pkg.version.javax.servlet}",
-                            javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
-                            org.apache.axiom.*; version="${axiom.osgi.version.range}",
-                            *;resolution:=optional
-                        </Import-Package>
-                        <DynamicImport-Package>*</DynamicImport-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.apache.axis2.wso2</groupId>
-            <artifactId>axis2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.utils</artifactId>
-            <version>4.1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.extensions</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.resource</artifactId>
-            <version>${carbon.platform.version}</version>
-        </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</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.billing.mgt</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.rule.kernel</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.rule.common</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.rule.backend</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.synapse</groupId>
-            <artifactId>synapse-tasks</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.synapse</groupId>
-            <artifactId>synapse-commons</artifactId>
-        </dependency>
-        <dependency>
-        	<groupId>org.wso2.carbon</groupId>
-        	<artifactId>org.wso2.carbon.throttling.agent</artifactId>
-            <version>2.1.0</version>
-        </dependency>
-        <dependency>
-        	<groupId>org.wso2.carbon</groupId>
-        	<artifactId>org.wso2.carbon.usage.agent</artifactId>
-        </dependency>
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/conf/ThrottlingConfiguration.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/conf/ThrottlingConfiguration.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/conf/ThrottlingConfiguration.java
deleted file mode 100644
index e2b5ca1..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/conf/ThrottlingConfiguration.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.conf;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.stratos.common.util.CommonUtil;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-import org.wso2.carbon.throttling.manager.tasks.Task;
-
-public class ThrottlingConfiguration {
-    private static final Log log = LogFactory.getLog(ThrottlingConfiguration.class);
-    private static final String CONFIG_NS = "http://wso2.com/carbon/multitenancy/usage-throttling-agent/config";
-    List<ThrottlingTaskConfiguration> throttlingTaskConfigs;
-    List<Task> tasks;
-
-    public ThrottlingConfiguration(String throttlingConfigFile) throws ThrottlingException {
-        try {
-            OMElement throttlingConfig =
-                    CommonUtil.buildOMElement(new FileInputStream(throttlingConfigFile));
-            deserialize(throttlingConfig);
-        } catch (FileNotFoundException e) {
-            String msg = "Unable to find the file: " + throttlingConfigFile + ".";
-            log.error(msg, e);
-            throw new ThrottlingException(msg, e);
-        } catch (Exception e) {
-            String msg = "Error in building the throttling config, config file: " +
-                            throttlingConfigFile + ".";
-            log.error(msg, e);
-            throw new ThrottlingException(msg, e);
-        }
-    }
-
-    public void deserialize(OMElement throttlingConfigEle) throws ThrottlingException {
-        OMElement throttlingManagerConfigs=null;
-        Iterator childElements = throttlingConfigEle.getChildElements();
-        while (childElements.hasNext()) {
-            Object configChildElement = childElements.next();
-
-            if (!(configChildElement instanceof OMElement)) {
-                continue;
-            }
-            OMElement configChildOMElement = (OMElement) configChildElement;
-            if (new QName(CONFIG_NS, "ThrottlingManagerTask", "").equals(configChildOMElement.getQName())) {
-               throttlingManagerConfigs=(OMElement)configChildElement;
-            }
-        }
-       // Iterator throttlingConfigChildIt = throttlingConfigEle.getChildElements();
-        Iterator throttlingConfigChildIt = throttlingManagerConfigs.getChildElements();
-        while (throttlingConfigChildIt.hasNext()) {
-            Object throttlingConfigChild = throttlingConfigChildIt.next();
-            if (!(throttlingConfigChild instanceof OMElement)) {
-                continue;
-            }
-            OMElement throttlingConfigChildEle = (OMElement) throttlingConfigChild;
-
-            if (new QName(CONFIG_NS, "tasks", "").equals(throttlingConfigChildEle.getQName())) {
-                throttlingTaskConfigs = new ArrayList<ThrottlingTaskConfiguration>();
-                tasks = new ArrayList<Task>();
-                Iterator tasksConfigChildIt = throttlingConfigChildEle.getChildElements();
-                while (tasksConfigChildIt.hasNext()) {
-                    Object taskConfigChild = tasksConfigChildIt.next();
-                    if (!(taskConfigChild instanceof OMElement)) {
-                        continue;
-                    }
-                    ThrottlingTaskConfiguration taskConfiguration =
-                            new ThrottlingTaskConfiguration((OMElement) taskConfigChild);
-                    throttlingTaskConfigs.add(taskConfiguration);
-                    tasks.add(taskConfiguration.getTask());
-                }
-            }
-        }
-    }
-
-	public List<ThrottlingTaskConfiguration> getThrottlingTaskConfigs() {
-		return throttlingTaskConfigs;
-	}
-
-	public List<Task> getThrottlingTasks() {
-		return tasks;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/conf/ThrottlingTaskConfiguration.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/conf/ThrottlingTaskConfiguration.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/conf/ThrottlingTaskConfiguration.java
deleted file mode 100644
index d60a8fb..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/conf/ThrottlingTaskConfiguration.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.conf;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-import org.wso2.carbon.throttling.manager.tasks.Task;
-
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-public class ThrottlingTaskConfiguration {
-	private static final Log log =
-	        LogFactory.getLog(ThrottlingTaskConfiguration.class);
-
-	private static final String CONFIG_NS =
-	        "http://wso2.com/carbon/multitenancy/usage-throttling-agent/config";
-	private static final String TASK_CONF_PARAMERTERS = "parameters";
-	private static final String TASK_CONF_DATA_PROVIDERS = "dataProviders";
-	private static final String TASK_CONF_PARAM_KEY = "parameter";
-	private static final String TASK_CONF_PARAM_NAME_KEY = "name";
-
-	public static final String INTERVAL_PARAM_KEY = "interval";
-	public static final String DELAY_PARAM_KEY = "delay";
-
-	Task task;
-	List<ThrottlingTaskDataProviderConfiguration> dataProviderConfigs;
-	Map<String, String> taskParameters;
-
-    public ThrottlingTaskConfiguration(OMElement taskConfigEle) throws ThrottlingException {
-        dataProviderConfigs = new ArrayList<ThrottlingTaskDataProviderConfiguration>();
-        serialize(taskConfigEle);
-    }
-
-    private void serialize(OMElement taskConfigEle) throws ThrottlingException {
-        Iterator taskConfigChildIt = taskConfigEle.getChildElements();
-
-        while (taskConfigChildIt.hasNext()) {
-            Object taskConfigChildObj = taskConfigChildIt.next();
-            if (!(taskConfigChildObj instanceof OMElement)) {
-                continue;
-            }
-            OMElement taskConfigChildEle = (OMElement) taskConfigChildObj;
-            if (taskConfigChildEle.getQName().equals(new QName(CONFIG_NS, TASK_CONF_PARAMERTERS))) {
-                Iterator parametersIt = taskConfigChildEle.getChildElements();
-
-                taskParameters = extractTaskParameters(parametersIt);
-            } else if (taskConfigChildEle.getQName().equals(
-                    new QName(CONFIG_NS, TASK_CONF_DATA_PROVIDERS))) {
-                Iterator handlerConfigIt = taskConfigChildEle.getChildElements();
-                while (handlerConfigIt.hasNext()) {
-                    Object handlerConfigObj = handlerConfigIt.next();
-                    if (!(handlerConfigObj instanceof OMElement)) {
-                        continue;
-                    }
-                    OMElement handlerConfigEle = (OMElement) handlerConfigObj;
-                    ThrottlingTaskDataProviderConfiguration handlerConfig =
-                            new ThrottlingTaskDataProviderConfiguration(handlerConfigEle);
-                    dataProviderConfigs.add(handlerConfig);
-                }
-            }
-        }
-
-        // create the task instance
-        task = new Task(taskParameters, dataProviderConfigs);
-
-    }
-
-	private static Map<String, String> extractTaskParameters(
-	        Iterator parameterIt) throws ThrottlingException {
-		Map<String, String> parameters = new HashMap<String, String>();
-		while (parameterIt.hasNext()) {
-			Object parameterObj = parameterIt.next();
-			if (!(parameterObj instanceof OMElement)) {
-				continue;
-			}
-			OMElement configChildEle = (OMElement) parameterObj;
-			if (!new QName(CONFIG_NS, TASK_CONF_PARAM_KEY, "")
-			        .equals(configChildEle.getQName())) {
-				continue;
-			}
-			String paramName =
-			        configChildEle.getAttributeValue(new QName(
-			                TASK_CONF_PARAM_NAME_KEY));
-			String paramValue = configChildEle.getText();
-			parameters.put(paramName, paramValue);
-		}
-		return parameters;
-	}
-
-	public List<ThrottlingTaskDataProviderConfiguration> getDataProviderConfigs() {
-		return dataProviderConfigs;
-	}
-
-	public Task getTask() {
-		return task;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/conf/ThrottlingTaskDataProviderConfiguration.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/conf/ThrottlingTaskDataProviderConfiguration.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/conf/ThrottlingTaskDataProviderConfiguration.java
deleted file mode 100644
index d7573aa..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/conf/ThrottlingTaskDataProviderConfiguration.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.conf;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.throttling.manager.dataproviders.DataProvider;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-import org.wso2.carbon.throttling.manager.utils.Util;
-
-import javax.xml.namespace.QName;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-public class ThrottlingTaskDataProviderConfiguration {
-	private static final Log log =
-	        LogFactory.getLog(ThrottlingTaskDataProviderConfiguration.class);
-
-	private static final String CONFIG_NS =
-	        "http://wso2.com/carbon/multitenancy/throttling/config";
-	private static final String HANDLER_CONF_PARAM_KEY = "parameter";
-	private static final String HANDLER_CLASS_ATTR = "class";
-	private static final String HANDLER_CONF_PARAM_NAME_KEY = "name";
-	private static final String HANDLER_SERVICE_ATTR = "service";
-
-	private String dataProviderServiceName;
-	private Map<String, String> dataProviderParameters;
-	private DataProvider dataProvider;
-	// to keep the task class that are available.
-	private Map<String, DataProvider> dataProviders;
-
-	public ThrottlingTaskDataProviderConfiguration(OMElement handlerConfigEle)
-            throws ThrottlingException {
-		serialize(handlerConfigEle);
-		dataProviders = new HashMap<String, DataProvider>();
-	}
-
-    private void serialize(OMElement handlerConfigEle) throws ThrottlingException {
-        Iterator handlerParameterChildIt = handlerConfigEle.getChildElements();
-        Map<String, String> parameters = extractParameters(handlerParameterChildIt);
-        // get the task class
-        String handlerClassName = handlerConfigEle.getAttributeValue(new QName(HANDLER_CLASS_ATTR));
-
-        if (handlerClassName == null) {
-            dataProviderServiceName =
-                    handlerConfigEle.getAttributeValue(new QName(HANDLER_SERVICE_ATTR));
-            dataProviderParameters = parameters;
-        } else {
-            dataProvider = (DataProvider) Util.constructObject(handlerClassName);
-            dataProvider.init(parameters);
-        }
-    }
-
-    private static Map<String, String> extractParameters(Iterator parameterIt)
-            throws ThrottlingException {
-        Map<String, String> parameters = new HashMap<String, String>();
-        while (parameterIt.hasNext()) {
-            Object parameterObj = parameterIt.next();
-            if (!(parameterObj instanceof OMElement)) {
-                continue;
-            }
-            OMElement configChildEle = (OMElement) parameterObj;
-            if (!new QName(CONFIG_NS, HANDLER_CONF_PARAM_KEY, "").equals(configChildEle.getQName())) {
-                continue;
-            }
-            String paramName =
-                    configChildEle.getAttributeValue(new QName(HANDLER_CONF_PARAM_NAME_KEY));
-            String paramValue = configChildEle.getText();
-            parameters.put(paramName, paramValue);
-        }
-        return parameters;
-    }
-
-	// get task have to be called to initialize tasks which are registered as
-	// OSGI services
-	public DataProvider getDataProvider() throws ThrottlingException {
-		if (dataProvider == null && dataProviderServiceName != null) {
-			dataProvider = dataProviders.get(dataProviderServiceName);
-			if (dataProvider == null) {
-				String msg =
-				        "The scheduler helper service: " +
-				                dataProviderServiceName + " is not loaded.";
-				log.error(msg);
-				throw new ThrottlingException(msg);
-			}
-			dataProvider.init(dataProviderParameters);
-		}
-		return dataProvider;
-	}
-
-	public void loadDataProviderService() throws ThrottlingException {
-		if (dataProvider == null && dataProviderServiceName != null) {
-			dataProvider = dataProviders.get(dataProviderServiceName);
-			if (dataProvider != null) {
-				dataProvider.init(dataProviderParameters);
-			}
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingAccessValidation.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingAccessValidation.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingAccessValidation.java
deleted file mode 100644
index 5ec0120..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingAccessValidation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.dataobjects;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-public class ThrottlingAccessValidation {
-
-    Map<String, Boolean> userBlockedActions = new HashMap<String, Boolean>();
-    Map<String, Boolean> tenantBlockedActions = new HashMap<String, Boolean>();
-    Map<String, String> userBlockedMsgs = new HashMap<String, String>();
-    Map<String, String> tenantBlockedMsgs = new HashMap<String, String>();
-
-    boolean persistValidationInfo = true;
-
-    public boolean isPersistValidationInfo() {
-        return persistValidationInfo;
-    }
-
-    public void setPersistValidationInfo(boolean persistValidationInfo) {
-        this.persistValidationInfo = persistValidationInfo;
-    }
-
-    public boolean isUserBlocked(String action) {
-        Boolean result = userBlockedActions.get(action);
-        return result == null? false: result;
-    }
-
-    public String getUserBlockedMsg(String action) {
-        return userBlockedMsgs.get(action);
-    }
-
-    public void setUserBlocked(String action, boolean block, String msg) {
-        userBlockedActions.put(action, block);
-        userBlockedMsgs.put(action, msg);
-    }
-
-    public boolean isTenantBlocked(String action) {
-        Boolean result = tenantBlockedActions.get(action);
-        return result == null? false: result;
-    }
-
-    public String getTenantBlockedMsg(String action) {
-        return tenantBlockedMsgs.get(action);
-    }
-
-    public void setTenantBlocked(String action, boolean block, String msg) {
-        tenantBlockedActions.put(action, block);
-        tenantBlockedMsgs.put(action, msg);
-    }
-
-    public Set<String> getActions() {
-    	return tenantBlockedActions.keySet();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingDataContext.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingDataContext.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingDataContext.java
deleted file mode 100644
index b8b1b2b..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingDataContext.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.dataobjects;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ThrottlingDataContext {
-    int tenantId;
-    String userName;
-    Map<String, ThrottlingDataEntry> data;
-    boolean async = false;
-    String taskName = null;
-
-    private ThrottlingAccessValidation accessValidation;
-    boolean processingComplete;
-
-    public ThrottlingDataContext(int tenantId) {
-        this.tenantId = tenantId;
-        this.data = new HashMap<String, ThrottlingDataEntry>();
-    }
-
-    public int getTenantId() {
-        return tenantId;
-    }
-
-    public void setTenantId(int tenantId) {
-        this.tenantId = tenantId;
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-
-    public ThrottlingAccessValidation getAccessValidation() {
-        return accessValidation;
-    }
-
-    public void setAccessValidation(ThrottlingAccessValidation accessValidation) {
-        this.accessValidation = accessValidation;
-    }
-
-    public boolean isProcessingComplete() {
-        return processingComplete;
-    }
-
-    public void setProcessingComplete(boolean processingComplete) {
-        this.processingComplete = processingComplete;
-    }
-
-    public Collection<ThrottlingDataEntry> getData() {
-        return data.values();
-    }
-
-    public void addDataString(String key, String value) {
-        ThrottlingDataEntry dataEntry = new ThrottlingDataEntry(key);
-        dataEntry.setStringValue(value);
-        data.put(key, dataEntry);
-    }
-
-    public void addDataLong(String key, long value) {
-        ThrottlingDataEntry dataEntry = new ThrottlingDataEntry(key);
-        dataEntry.setLongValue(value);
-        data.put(key, dataEntry);
-    }
-
-    public void addDataInt(String key, int value) {
-        ThrottlingDataEntry dataEntry = new ThrottlingDataEntry(key);
-        dataEntry.setIntValue(value);
-        data.put(key, dataEntry);
-    }
-
-    public void addDataObject(String key, Object value) {
-        ThrottlingDataEntry dataEntry = new ThrottlingDataEntry(key);
-        dataEntry.setObjectValue(value);
-        data.put(key, dataEntry);
-    }
-
-    public String getDataString(String key) {
-        ThrottlingDataEntry dataEntry = data.get(key);
-        if (dataEntry == null) {
-            return null;
-        }
-        return dataEntry.getStringValue();
-    }
-
-    public long getDataLong(String key) {
-        ThrottlingDataEntry dataEntry = data.get(key);
-        if (dataEntry == null) {
-            return 0;
-        }
-        return dataEntry.getLongValue();
-    }
-
-    public int getDataInt(String key) {
-        ThrottlingDataEntry dataEntry = data.get(key);
-        if (dataEntry == null) {
-            return 0;
-        }
-        return dataEntry.getIntValue();
-    }
-
-    public Object getDataObject(String key) {
-        ThrottlingDataEntry dataEntry = data.get(key);
-        if (dataEntry == null) {
-            return null;
-        }
-        return dataEntry.getObjectValue();
-    }
-
-    public boolean isAsync() {
-        return async;
-    }
-
-    public void setAsync(boolean async) {
-        this.async = async;
-    }
-
-    public String getTaskName() {
-        return taskName;
-    }
-
-    public void setTaskName(String taskName) {
-        this.taskName = taskName;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingDataEntry.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingDataEntry.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingDataEntry.java
deleted file mode 100644
index 3427dfd..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingDataEntry.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.dataobjects;
-
-public class ThrottlingDataEntry {
-    String key;
-    String stringValue;
-    int intValue;
-    long longValue;
-    Object objectValue;
-
-    // here we are not using enums, as pojo services may not support that.
-    // 1 - String, 2 - Int, 3 - long, 4 - object
-    int valueType;
-
-    public ThrottlingDataEntry(String key) {
-        this.key = key;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public void setKey(String key) {
-        this.key = key;
-    }
-
-    public String getStringValue() {
-        return stringValue;
-    }
-
-    public void setStringValue(String stringValue) {
-        this.stringValue = stringValue;
-        valueType = 1;
-    }
-
-    public int getIntValue() {
-        return intValue;
-    }
-
-    public void setIntValue(int intValue) {
-        this.intValue = intValue;
-        valueType = 2;
-    }
-
-    public long getLongValue() {
-        return longValue;
-    }
-
-    public void setLongValue(long longValue) {
-        this.longValue = longValue;
-        valueType = 3;
-    }
-
-    public Object getObjectValue() {
-        return objectValue;
-    }
-
-    public void setObjectValue(Object objectValue) {
-        this.objectValue = objectValue;
-        valueType = 4;
-    }
-
-    public int getValueType() {
-        return valueType;
-    }
-
-    public void setValueType(int valueType) {
-        this.valueType = valueType;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingDataEntryConstants.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingDataEntryConstants.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingDataEntryConstants.java
deleted file mode 100644
index 090bc15..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataobjects/ThrottlingDataEntryConstants.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.dataobjects;
-
-public class ThrottlingDataEntryConstants {
-
-    final public static String TENANT_INCOMING_BANDWIDTH = "tenantIncomingBandwidth";
-    final public static String TENANT_OUTGOING_BANDWIDTH = "tenantOutgoingBandwidth";
-
-    final public static String TENANT_CAPACITY = "tenantCapacity";
-    final public static String TENANT_HISTORY_CAPACITY = "tenantHistoryCapacity";
-
-    final public static String USERS_COUNT = "usersCount";
-
-    // some custom objects
-    final public static String CUSTOMER = "customer";
-    final public static String PACKAGE = "package";
-    final public static String USER_MANAGER = "userManager";
-    final public static String REGISTRY_INCOMING_BANDWIDTH = "registryIncomingBandwidth";
-    final public static String REGISTRY_OUTGOING_BANDWIDTH = "registryOutgoingBandwidth";
-    final public static String SERVICE_INCOMING_BANDWIDTH = "serviceIncomingBandwidth";
-    final public static String SERVICE_OUTGOING_BANDWIDTH = "serviceOutgoingBandwidth";
-    final public static String WEBAPP_INCOMING_BANDWIDTH = "webappIncomingBandwidth";
-    final public static String WEBAPP_OUTGOING_BANDWIDTH = "webappOutgoingBandwidth";
-    final public static String SERVICE_REQUEST_COUNT = "serviceRequestCount";
-    final public static String SERVICE_RESPONSE_COUNT = "serviceResponseCount";
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataproviders/BillingDataProvider.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataproviders/BillingDataProvider.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataproviders/BillingDataProvider.java
deleted file mode 100644
index 6966a6d..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataproviders/BillingDataProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.dataproviders;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.billing.core.dataobjects.Customer;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.billing.mgt.dataobjects.MultitenancyPackage;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataContext;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataEntryConstants;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-import org.wso2.carbon.throttling.manager.utils.Util;
-
-public class BillingDataProvider extends DataProvider {
-    private static Log log = LogFactory.getLog(BillingDataProvider.class);
-
-    
-    public void invoke(ThrottlingDataContext dataContext) throws ThrottlingException {
-        int tenantId = dataContext.getTenantId();
-        try {
-            Customer customer = Util.getCurrentBillingCustomer(tenantId);
-            dataContext.addDataObject(ThrottlingDataEntryConstants.CUSTOMER, customer);
-        } catch (RegistryException e) {
-            String msg = "Error in getting the current customer. tenant id: " + tenantId + ".";
-            log.error(msg, e);
-            throw new ThrottlingException(msg, e);
-        }
-        // getting the package
-        try {
-            MultitenancyPackage mtPackage = Util.getCurrentBillingPackage(tenantId);
-            dataContext.addDataObject(ThrottlingDataEntryConstants.PACKAGE, mtPackage);
-        } catch (RegistryException e) {
-            String msg = "Error in getting the multi-tenancy package. tenant id: " + tenantId + ".";
-            log.error(msg, e);
-            throw new ThrottlingException(msg, e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataproviders/DataProvider.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataproviders/DataProvider.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataproviders/DataProvider.java
deleted file mode 100644
index 313c97f..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataproviders/DataProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.dataproviders;
-
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataContext;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-
-import java.util.Map;
-
-public abstract class DataProvider {
-    Map<String, String> parameters;
-
-    public void init(Map<String, String> parameters) throws ThrottlingException {
-        this.parameters = parameters;
-    }
-
-    public Map<String, String> getParameters() {
-        return parameters;
-    }
-
-    public abstract void invoke(ThrottlingDataContext dataContext) throws ThrottlingException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataproviders/UsageDataProvider.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataproviders/UsageDataProvider.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataproviders/UsageDataProvider.java
deleted file mode 100644
index fdb54d9..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/dataproviders/UsageDataProvider.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Copyright (c) 2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.dataproviders;
-
-import java.util.Calendar;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataContext;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataEntryConstants;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-import org.wso2.carbon.throttling.manager.utils.Util;
-import org.wso2.carbon.usage.beans.BandwidthStatistics;
-import org.wso2.carbon.usage.beans.RequestStatistics;
-import org.wso2.carbon.usage.api.TenantUsageRetriever;
-import org.wso2.carbon.usage.beans.TenantUsage;
-
-/**
- *
- */
-public class UsageDataProvider extends DataProvider {
-    private static final Log log = LogFactory.getLog(UsageDataProvider.class);
-    
-    @Override
-    public void invoke(ThrottlingDataContext dataContext) throws ThrottlingException {
-        int tenantId = dataContext.getTenantId();
-        String userName = dataContext.getUserName();
-        String yearMonth = Util.getCurrentMonthString(Calendar.getInstance());
-        TenantUsageRetriever tenantUsageRetriever = Util.getTenantUsageRetriever();
-        
-        try {
-            TenantUsage usage = tenantUsageRetriever.getTenantUsage(tenantId, yearMonth);
-            
-            //Bandwidth usages
-            long tenantIncomingBandwidth = usage.getTotalIncomingBandwidth();
-            long tenantOutgoingBandwidth = usage.getTotalOutgoingBandwidth();
-            dataContext.addDataLong(ThrottlingDataEntryConstants.TENANT_INCOMING_BANDWIDTH,
-                    tenantIncomingBandwidth);
-            dataContext.addDataLong(ThrottlingDataEntryConstants.TENANT_OUTGOING_BANDWIDTH,
-                    tenantOutgoingBandwidth);
-            
-            //Registry space capacity
-            long currentTenantCapacity = usage.getRegistryContentCapacity();
-            long historyTenantCapacity = usage.getRegistryContentHistoryCapacity();
-            dataContext.addDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY,
-                    currentTenantCapacity);
-            dataContext.addDataLong(ThrottlingDataEntryConstants.TENANT_HISTORY_CAPACITY,
-                    historyTenantCapacity);
-            //Assigning registry bandwidths
-            BandwidthStatistics totalRgistryBW=usage.getTotalRegistryBandwidth();
-            dataContext.addDataLong(ThrottlingDataEntryConstants.REGISTRY_INCOMING_BANDWIDTH,
-                    totalRgistryBW.getIncomingBandwidth());
-            dataContext.addDataLong(ThrottlingDataEntryConstants.REGISTRY_OUTGOING_BANDWIDTH,
-                    totalRgistryBW.getOutgoingBandwidth());
-
-            //Assigning service bandwidths
-            BandwidthStatistics serviceBWStatistic=usage.getTotalServiceBandwidth();
-            dataContext.addDataLong(ThrottlingDataEntryConstants.SERVICE_INCOMING_BANDWIDTH,
-                    serviceBWStatistic.getIncomingBandwidth());
-            dataContext.addDataLong(ThrottlingDataEntryConstants.SERVICE_OUTGOING_BANDWIDTH,
-                    serviceBWStatistic.getOutgoingBandwidth());
-            
-            //Assigning webapp bandwidths
-            BandwidthStatistics webappBWStatistic = usage.getTotalWebappBandwidth();
-            dataContext.addDataLong(ThrottlingDataEntryConstants.WEBAPP_INCOMING_BANDWIDTH, 
-                    webappBWStatistic.getIncomingBandwidth());
-            dataContext.addDataLong(ThrottlingDataEntryConstants.WEBAPP_OUTGOING_BANDWIDTH, 
-                    webappBWStatistic.getOutgoingBandwidth());
-            
-            //Assigning service requests and response
-            RequestStatistics requestStat = usage.getTotalRequestStatistics();
-            dataContext.addDataLong(ThrottlingDataEntryConstants.SERVICE_REQUEST_COUNT, 
-                    requestStat.getRequestCount());
-            dataContext.addDataLong(ThrottlingDataEntryConstants.SERVICE_RESPONSE_COUNT, 
-                    requestStat.getResponseCount());
-            
-            //Get number of users
-            int usersCount = usage.getNumberOfUsers();
-            dataContext.addDataInt(ThrottlingDataEntryConstants.USERS_COUNT, usersCount);
-
-        } catch (Exception e) {
-            String msg = "Error in retrieving Usage information. " + "tenant id: " + tenantId
-                    + ", user name: " + userName + ".";
-            log.error(msg, e);
-            throw new ThrottlingException(msg, e);
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/exception/ThrottlingException.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/exception/ThrottlingException.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/exception/ThrottlingException.java
deleted file mode 100644
index 39a695c..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/exception/ThrottlingException.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.exception;
-
-public class ThrottlingException extends Exception{
-    public ThrottlingException(String msg, Exception e) {
-        super(msg, e);
-    }
-    public ThrottlingException(String msg) {
-        super(msg);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/internal/ThrottlingManagerServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/internal/ThrottlingManagerServiceComponent.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/internal/ThrottlingManagerServiceComponent.java
deleted file mode 100644
index 7f0b6b5..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/internal/ThrottlingManagerServiceComponent.java
+++ /dev/null
@@ -1,129 +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.throttling.manager.internal;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.osgi.service.component.ComponentContext;
-import org.wso2.carbon.billing.core.BillingManager;
-import org.wso2.carbon.registry.core.service.RegistryService;
-import org.wso2.carbon.rule.kernel.config.RuleEngineConfigService;
-import org.wso2.carbon.user.core.service.RealmService;
-import org.wso2.carbon.billing.mgt.api.MultitenancyBillingInfo;
-import org.wso2.carbon.throttling.manager.utils.Util;
-import org.wso2.carbon.usage.api.TenantUsageRetriever;
-
-/**
- * @scr.component name="org.wso2.carbon.throttling.manager"
- * 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="billingManager.service"
- * interface="org.wso2.carbon.billing.core.BillingManager" cardinality="1..1"
- * policy="dynamic" bind="setBillingManager" unbind="unsetBillingManager"
- * @scr.reference name="rule.engine.config.server.component"
- * interface="org.wso2.carbon.rule.kernel.config.RuleEngineConfigService"
- * cardinality="1..1"
- * policy="dynamic" bind="setRuleEngineConfigService"
- * unbind="unsetRuleEngineConfigService"
- * @scr.reference name="metering.service"
- * interface="org.wso2.carbon.usage.api.TenantUsageRetriever" cardinality="1..1"
- * policy="dynamic" bind="setTenantUsageRetriever" unbind="unsetTenantUsageRetriever"
- * @scr.reference name="org.wso2.carbon.billing.mgt.api.MultitenancyBillingInfo"
- * interface="org.wso2.carbon.billing.mgt.api.MultitenancyBillingInfo" cardinality="1..1"
- * policy="dynamic" bind="setMultitenancyBillingInfo" unbind="unsetMultitenancyBillingInfo"
- */
-public class ThrottlingManagerServiceComponent {
-    private static Log log = LogFactory.getLog(ThrottlingManagerServiceComponent.class);
-
-    protected void activate(ComponentContext context) {
-        try {
-            Util.setBundleContext(context.getBundleContext());
-            Util.loadThrottlingRules();
-            Util.registerThrottlingRuleInvoker();
-            Util.initializeThrottling();
-            log.debug(" Multitenancy Throttling Manager bundle is activated ");
-        } catch (Throwable e) {
-            log.error(" Multitenancy Throttling Manager bundle failed activating ", e);
-        }
-    }
-
-    protected void deactivate(ComponentContext context) {
-        log.debug("******* Multitenancy Throttling Manager bundle 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 setBillingManager(BillingManager billingManager) {
-        log.debug("Receiving billingManager service");
-        Util.setBillingManager(billingManager);
-    }
-
-    protected void unsetBillingManager(BillingManager billingManager) {
-        log.debug("Halting billingManager service");
-        Util.setBillingManager(null);
-    }
-
-    protected void setRuleEngineConfigService(RuleEngineConfigService ruleEngineConfigService) {
-        Util.setRuleEngineConfigService(ruleEngineConfigService);
-    }
-
-    protected void unsetRuleEngineConfigService(RuleEngineConfigService ruleEngineConfigService) {
-        // we are not dynamically removing schedule helpers
-    }
-
-    protected void setTenantUsageRetriever(TenantUsageRetriever tenantUsageRetriever) {
-        log.debug("Setting Tenant Usage Retriever service");
-        Util.setTenantUsageRetriever(tenantUsageRetriever);
-    }
-
-    protected void unsetTenantUsageRetriever(TenantUsageRetriever tenantUsageRetriever) {
-        log.debug("Unsetting Tenant Usage Retriever service");
-        Util.setBillingManager(null);
-    }
-
-    protected void setMultitenancyBillingInfo(MultitenancyBillingInfo mtBillingInfo) {
-        log.debug("Setting MT billing info service");
-        Util.setMultitenancyBillingInfo(mtBillingInfo);
-    }
-
-    protected void unsetMultitenancyBillingInfo(MultitenancyBillingInfo mtBillingInfo) {
-        log.debug("Unsetting MT billing info service");
-        Util.setMultitenancyBillingInfo(null);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/rules/KnowledgeBaseManager.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/rules/KnowledgeBaseManager.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/rules/KnowledgeBaseManager.java
deleted file mode 100644
index a7d0c40..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/rules/KnowledgeBaseManager.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.rules;
-
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataContext;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataEntry;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-import org.wso2.carbon.throttling.manager.tasks.Task;
-import org.wso2.carbon.throttling.manager.validation.ValidationInfoManager;
-
-public class KnowledgeBaseManager {
-    private static final Log log = LogFactory.getLog(KnowledgeBaseManager.class);
-
-    public static ThrottlingDataContext feedKnowledgeBase(int tenantId, Task task,
-            List<Object> knowledgeBase) throws ThrottlingException {
-        // initialize the throttling context
-        ThrottlingDataContext throttlingDataContext = new ThrottlingDataContext(tenantId);
-
-        // prepare data from data providers
-        try {
-            task.prepareData(throttlingDataContext);
-        } catch (ThrottlingException e) {
-            String msg = "Error in preparing throttling data for tenant: " + tenantId + ".";
-            log.error(msg, e);
-            throw new ThrottlingException(msg, e);
-        }
-
-        // add data entries with object types separately
-        for (ThrottlingDataEntry dataEntry : throttlingDataContext.getData()) {
-            if (dataEntry.getValueType() == 4) {
-                Object object = dataEntry.getObjectValue();
-                if (object != null) {
-                    knowledgeBase.add(object);
-                }
-            }
-        }
-        // load the access validation data
-        try {
-            ValidationInfoManager.loadValidationDetails(throttlingDataContext);
-        } catch (ThrottlingException e) {
-            String msg = "Error in loading validation details. tenant id: " + tenantId + ".";
-            log.error(msg, e);
-            throw new ThrottlingException(msg, e);
-        }
-
-        // add metering data context
-        knowledgeBase.add(throttlingDataContext);
-        // add access validation information
-        knowledgeBase.add(throttlingDataContext.getAccessValidation());
-
-        return throttlingDataContext;
-    }
-}


[13/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/mysql.sql
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/mysql.sql b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/mysql.sql
new file mode 100644
index 0000000..5b9b234
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/mysql.sql
@@ -0,0 +1,370 @@
+CREATE TABLE IF NOT EXISTS REG_CLUSTER_LOCK (
+             REG_LOCK_NAME VARCHAR (20),
+             REG_LOCK_STATUS VARCHAR (20),
+             REG_LOCKED_TIME TIMESTAMP,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (REG_LOCK_NAME)
+)ENGINE INNODB;
+
+CREATE TABLE IF NOT EXISTS REG_LOG (
+             REG_LOG_ID INTEGER AUTO_INCREMENT,
+             REG_PATH VARCHAR (750),
+             REG_USER_ID VARCHAR (31) NOT NULL,
+             REG_LOGGED_TIME TIMESTAMP NOT NULL,
+             REG_ACTION INTEGER NOT NULL,
+             REG_ACTION_DATA VARCHAR (500),
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID)
+)ENGINE INNODB;
+
+-- The REG_PATH_VALUE should be less than 767 bytes, and hence was fixed at 750.
+-- See CARBON-5917.
+
+CREATE TABLE IF NOT EXISTS REG_PATH(
+             REG_PATH_ID INTEGER NOT NULL AUTO_INCREMENT,
+             REG_PATH_VALUE VARCHAR(750) NOT NULL,
+             REG_PATH_PARENT_ID INTEGER,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID)
+)ENGINE INNODB;
+
+CREATE INDEX REG_PATH_IND_BY_PATH_VALUE USING HASH ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID);
+CREATE INDEX REG_PATH_IND_BY_PATH_PARENT_ID USING HASH ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID);
+
+CREATE TABLE IF NOT EXISTS REG_CONTENT (
+             REG_CONTENT_ID INTEGER NOT NULL AUTO_INCREMENT,
+             REG_CONTENT_DATA LONGBLOB,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
+)ENGINE INNODB;
+
+CREATE TABLE IF NOT EXISTS REG_CONTENT_HISTORY (
+             REG_CONTENT_ID INTEGER NOT NULL,
+             REG_CONTENT_DATA LONGBLOB,
+             REG_DELETED   SMALLINT,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
+)ENGINE INNODB;
+
+CREATE TABLE IF NOT EXISTS REG_RESOURCE (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR(256),
+            REG_VERSION         INTEGER NOT NULL AUTO_INCREMENT,
+            REG_MEDIA_TYPE      VARCHAR(500),
+            REG_CREATOR         VARCHAR(31) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR(31),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
+)ENGINE INNODB;
+
+ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_IND_BY_NAME USING HASH ON REG_RESOURCE(REG_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
+
+CREATE TABLE IF NOT EXISTS REG_RESOURCE_HISTORY (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR(256),
+            REG_VERSION         INTEGER NOT NULL,
+            REG_MEDIA_TYPE      VARCHAR(500),
+            REG_CREATOR         VARCHAR(31) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR(31),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_DELETED         SMALLINT,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
+)ENGINE INNODB;
+
+ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME USING HASH ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
+
+CREATE TABLE IF NOT EXISTS REG_COMMENT (
+            REG_ID        INTEGER NOT NULL AUTO_INCREMENT,
+            REG_COMMENT_TEXT      VARCHAR(500) NOT NULL,
+            REG_USER_ID           VARCHAR(31) NOT NULL,
+            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID)
+)ENGINE INNODB;
+
+CREATE TABLE IF NOT EXISTS REG_RESOURCE_COMMENT (
+            REG_COMMENT_ID          INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+)ENGINE INNODB;
+
+ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION USING HASH ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID);
+
+CREATE TABLE IF NOT EXISTS REG_RATING (
+            REG_ID     INTEGER NOT NULL AUTO_INCREMENT,
+            REG_RATING        INTEGER NOT NULL,
+            REG_USER_ID       VARCHAR(31) NOT NULL,
+            REG_RATED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID)
+)ENGINE INNODB;
+
+CREATE TABLE IF NOT EXISTS REG_RESOURCE_RATING (
+            REG_RATING_ID           INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+)ENGINE INNODB;
+
+ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION USING HASH ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID);
+
+
+CREATE TABLE IF NOT EXISTS REG_TAG (
+            REG_ID         INTEGER NOT NULL AUTO_INCREMENT,
+            REG_TAG_NAME       VARCHAR(500) NOT NULL,
+            REG_USER_ID        VARCHAR(31) NOT NULL,
+            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID)
+)ENGINE INNODB;
+
+CREATE TABLE IF NOT EXISTS REG_RESOURCE_TAG (
+            REG_TAG_ID              INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+)ENGINE INNODB;
+
+ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION USING HASH ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID);
+
+CREATE TABLE IF NOT EXISTS REG_PROPERTY (
+            REG_ID         INTEGER NOT NULL AUTO_INCREMENT,
+            REG_NAME       VARCHAR(100) NOT NULL,
+            REG_VALUE        VARCHAR(1000),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID)
+)ENGINE INNODB;
+
+CREATE TABLE IF NOT EXISTS REG_RESOURCE_PROPERTY (
+            REG_PROPERTY_ID         INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR(256),
+            REG_TENANT_ID INTEGER DEFAULT 0
+)ENGINE INNODB;
+
+ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION USING HASH ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID);
+
+-- CREATE TABLE IF NOT EXISTS REG_ASSOCIATIONS (
+-- SRC_PATH_ID     INTEGER,
+-- SRC_RESOURCE_NAME    VARCHAR(256),
+-- SRC_VERSION     INTEGER,
+-- TGT_PATH_ID     INTEGER,
+-- TGT_RESOURCE_NAME    VARCHAR(256),
+-- TGT_VERSION     INTEGER
+-- )ENGINE INNODB;
+-- 
+-- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_SRC_PATH_ID FOREIGN KEY (SRC_PATH_ID) REFERENCES REG_PATH (PATH_ID);
+-- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_TGT_PATH_ID FOREIGN KEY (TGT_PATH_ID) REFERENCES REG_PATH (PATH_ID);
+-- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_VERSION ON REG_ASSOCIATIONS(SRC_VERSION);
+-- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_VERSION ON REG_ASSOCIATIONS(TGT_VERSION);
+-- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_RESOURCE_NAME ON REG_ASSOCIATIONS(SRC_RESOURCE_NAME);
+-- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_RESOURCE_NAME ON REG_ASSOCIATIONS(TGT_RESOURCE_NAME);
+
+
+
+CREATE TABLE IF NOT EXISTS REG_ASSOCIATION (
+            REG_ASSOCIATION_ID INTEGER AUTO_INCREMENT,
+            REG_SOURCEPATH VARCHAR (750) NOT NULL,
+            REG_TARGETPATH VARCHAR (750) NOT NULL,
+            REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID)
+)ENGINE INNODB;
+
+CREATE TABLE IF NOT EXISTS REG_SNAPSHOT (
+            REG_SNAPSHOT_ID     INTEGER NOT NULL AUTO_INCREMENT,
+            REG_PATH_ID            INTEGER NOT NULL,
+            REG_RESOURCE_NAME      VARCHAR(255),
+            REG_RESOURCE_VIDS     LONGBLOB NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID)
+)ENGINE INNODB;
+
+CREATE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
+
+ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
+
+
+-- ################################
+-- USER MANAGER TABLES
+-- ################################
+
+CREATE TABLE UM_TENANT (
+			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+	    UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
+            UM_EMAIL VARCHAR(255),
+            UM_ACTIVE BOOLEAN DEFAULT FALSE,
+			PRIMARY KEY (UM_ID),
+			UNIQUE(UM_DOMAIN_NAME));
+
+CREATE TABLE UM_USER ( 
+             UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
+             UM_USER_NAME VARCHAR(255) NOT NULL, 
+             UM_USER_PASSWORD VARCHAR(255) NOT NULL,
+             UM_SALT_VALUE VARCHAR(31),
+             UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE,
+             UM_CHANGED_TIME TIMESTAMP NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             PRIMARY KEY (UM_ID, UM_TENANT_ID), 
+             UNIQUE(UM_USER_NAME, UM_TENANT_ID)
+)ENGINE INNODB; 
+
+CREATE TABLE UM_ROLE ( 
+             UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
+             UM_ROLE_NAME VARCHAR(255) NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,  
+             PRIMARY KEY (UM_ID, UM_TENANT_ID),
+             UNIQUE(UM_ROLE_NAME, UM_TENANT_ID) 
+)ENGINE INNODB;
+
+CREATE TABLE UM_PERMISSION ( 
+             UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
+             UM_RESOURCE_ID VARCHAR(255) NOT NULL, 
+             UM_ACTION VARCHAR(255) NOT NULL, 
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)ENGINE INNODB; 
+
+CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION 
+                    ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID); 
+
+CREATE TABLE UM_ROLE_PERMISSION ( 
+             UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
+             UM_PERMISSION_ID INTEGER NOT NULL, 
+             UM_ROLE_NAME VARCHAR(255) NOT NULL,
+             UM_IS_ALLOWED SMALLINT NOT NULL, 
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID), 
+             PRIMARY KEY (UM_ID, UM_TENANT_ID) 
+)ENGINE INNODB; 
+
+-- REMOVED UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID) 
+CREATE TABLE UM_USER_PERMISSION ( 
+             UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
+             UM_PERMISSION_ID INTEGER NOT NULL, 
+             UM_USER_NAME VARCHAR(255) NOT NULL,
+             UM_IS_ALLOWED SMALLINT NOT NULL,          
+             UM_TENANT_ID INTEGER DEFAULT 0, 
+             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID), 
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)ENGINE INNODB;
+
+-- REMOVED UNIQUE (UM_PERMISSION_ID, UM_USER_ID) 
+CREATE TABLE UM_USER_ROLE ( 
+             UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
+             UM_ROLE_ID INTEGER NOT NULL, 
+             UM_USER_ID INTEGER NOT NULL,
+             UM_TENANT_ID INTEGER DEFAULT 0,  
+             UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID), 
+             FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID), 
+             FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), 
+             PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)ENGINE INNODB; 
+
+
+CREATE TABLE UM_USER_ATTRIBUTE ( 
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
+            UM_ATTR_NAME VARCHAR(255) NOT NULL, 
+            UM_ATTR_VALUE VARCHAR(1024), 
+            UM_PROFILE_ID VARCHAR(255), 
+            UM_USER_ID INTEGER, 
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)ENGINE INNODB; 
+
+
+
+CREATE TABLE UM_DIALECT( 
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
+            UM_DIALECT_URI VARCHAR(255) NOT NULL, 
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)ENGINE INNODB; 
+
+CREATE TABLE UM_CLAIM( 
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
+            UM_DIALECT_ID INTEGER NOT NULL, 
+            UM_CLAIM_URI VARCHAR(255) NOT NULL, 
+            UM_DISPLAY_TAG VARCHAR(255), 
+            UM_DESCRIPTION VARCHAR(255), 
+            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
+            UM_REG_EX VARCHAR(255), 
+            UM_SUPPORTED SMALLINT, 
+            UM_REQUIRED SMALLINT, 
+            UM_DISPLAY_ORDER INTEGER,
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID), 
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)ENGINE INNODB; 
+
+CREATE TABLE UM_PROFILE_CONFIG( 
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
+            UM_DIALECT_ID INTEGER NOT NULL, 
+            UM_PROFILE_NAME VARCHAR(255), 
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)ENGINE INNODB; 
+    
+CREATE TABLE UM_CLAIM_BEHAVIOR( 
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
+            UM_PROFILE_ID INTEGER, 
+            UM_CLAIM_ID INTEGER, 
+            UM_BEHAVIOUR SMALLINT, 
+            UM_TENANT_ID INTEGER DEFAULT 0, 
+            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID), 
+            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)ENGINE INNODB; 
+
+CREATE TABLE UM_HYBRID_ROLE(
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+            UM_ROLE_NAME VARCHAR(255),
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)ENGINE INNODB;
+
+CREATE TABLE UM_HYBRID_USER_ROLE(
+            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
+            UM_USER_NAME VARCHAR(255),
+            UM_ROLE_ID INTEGER NOT NULL,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
+            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)ENGINE INNODB;
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/oracle.sql
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/oracle.sql b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/oracle.sql
new file mode 100644
index 0000000..e7cc68f
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/oracle.sql
@@ -0,0 +1,644 @@
+CREATE TABLE REG_CLUSTER_LOCK (
+             REG_LOCK_NAME VARCHAR2(20),
+             REG_LOCK_STATUS VARCHAR2(20),
+             REG_LOCKED_TIME TIMESTAMP,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CLUSTER_LOCK PRIMARY KEY (REG_LOCK_NAME))
+/
+CREATE TABLE REG_LOG (
+             REG_LOG_ID INTEGER,
+             REG_PATH VARCHAR2(2000),
+             REG_USER_ID VARCHAR2(31) NOT NULL,
+             REG_LOGGED_TIME TIMESTAMP  NOT NULL,
+             REG_ACTION INTEGER NOT NULL,
+             REG_ACTION_DATA VARCHAR2(500),
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_LOG PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_LOG_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER REG_LOG_TRIGGER
+                    BEFORE INSERT
+                    ON REG_LOG
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_LOG_SEQUENCE.nextval INTO :NEW.REG_LOG_ID FROM dual;
+           		   END;
+/	         
+
+CREATE TABLE REG_PATH(
+             REG_PATH_ID INTEGER NULL,
+	         REG_PATH_VALUE VARCHAR2(2000) NOT NULL,
+             REG_PATH_PARENT_ID INTEGER,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID))
+/
+CREATE INDEX REG_PATH_IND_BY_PATH_VALUE ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID)
+/
+CREATE INDEX REG_PATH_IND_BY_PARENT_ID ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID)
+/
+CREATE SEQUENCE REG_PATH_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER REG_PATH_TRIGGER
+                    BEFORE INSERT
+                    ON REG_PATH
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_PATH_SEQUENCE.nextval INTO :NEW.REG_PATH_ID FROM dual;
+ 			   END;
+/                   
+
+CREATE TABLE REG_CONTENT (
+             REG_CONTENT_ID INTEGER,
+             REG_CONTENT_DATA BLOB,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_CONTENT_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER REG_CONTENT_TRIGGER
+                    BEFORE INSERT
+                    ON REG_CONTENT
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_CONTENT_SEQUENCE.nextval INTO :NEW.REG_CONTENT_ID FROM dual;
+ 			   END;
+/                   
+
+CREATE TABLE REG_CONTENT_HISTORY (
+             REG_CONTENT_ID INTEGER NOT NULL,
+             REG_CONTENT_DATA BLOB,
+             REG_DELETED   SMALLINT,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID))
+/
+CREATE TABLE REG_RESOURCE (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR2(256),
+            REG_VERSION         INTEGER,
+            REG_MEDIA_TYPE      VARCHAR2(500),
+            REG_CREATOR         VARCHAR2(31) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR2(31),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR2(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT FK_REG_RES_PATH FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),         
+            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_RESOURCE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER REG_RESOURCE_TRIGGER
+                    BEFORE INSERT
+                    ON REG_RESOURCE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_RESOURCE_SEQUENCE.nextval INTO :NEW.REG_VERSION FROM dual;
+ 			   END;
+/                   
+
+CREATE INDEX REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME, REG_TENANT_ID)
+/
+CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID)
+/
+CREATE TABLE REG_RESOURCE_HISTORY (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR2(256),
+            REG_VERSION         INTEGER NOT NULL,
+            REG_MEDIA_TYPE      VARCHAR2(500),
+            REG_CREATOR         VARCHAR2(31) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR2(31),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR2(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_DELETED         SMALLINT,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
+            FOREIGN KEY (REG_CONTENT_ID,REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID,REG_TENANT_ID),            
+            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID))
+/
+CREATE INDEX REG_RES_HIST_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID)
+/
+CREATE INDEX REG_RES_HIST_IND_BY_PATH_ID ON REG_RESOURCE_HISTORY(REG_PATH_ID, REG_NAME, REG_TENANT_ID)
+/
+CREATE TABLE REG_COMMENT (
+            REG_ID        INTEGER,
+            REG_COMMENT_TEXT      VARCHAR2(500) NOT NULL,
+            REG_USER_ID           VARCHAR2(31) NOT NULL,
+            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_COMMENT_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER REG_COMMENT_TRIGGER
+                    BEFORE INSERT
+                    ON REG_COMMENT
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_COMMENT_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
+ 			   END;
+/                   
+
+CREATE TABLE REG_RESOURCE_COMMENT (
+            REG_COMMENT_ID          INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR2(256),
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
+            FOREIGN KEY (REG_COMMENT_ID,REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID,REG_TENANT_ID),            
+            REG_TENANT_ID INTEGER DEFAULT 0) 
+/
+CREATE INDEX REG_RES_COMM_BY_PATH_ID ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
+/
+CREATE INDEX REG_RES_COMM_BY_VERSION ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID)
+/
+CREATE TABLE REG_RATING (
+            REG_ID     INTEGER,
+            REG_RATING        INTEGER NOT NULL,
+            REG_USER_ID       VARCHAR2(31) NOT NULL,
+            REG_RATED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_RATING_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER REG_RATING_TRIGGER
+                    BEFORE INSERT
+                    ON REG_RATING
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_RATING_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
+                     END;
+/
+				
+CREATE TABLE REG_RESOURCE_RATING (
+            REG_RATING_ID           INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR2(256),
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
+            FOREIGN KEY (REG_RATING_ID,REG_TENANT_ID) REFERENCES REG_RATING (REG_ID,REG_TENANT_ID),           
+            REG_TENANT_ID INTEGER DEFAULT 0)
+/
+CREATE INDEX REG_RATING_IND_BY_PATH_ID ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
+/
+CREATE INDEX REG_RATING_IND_BY_VERSION ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID)
+/
+CREATE TABLE REG_TAG (
+            REG_ID         INTEGER,
+            REG_TAG_NAME       VARCHAR2(500) NOT NULL,
+            REG_USER_ID        VARCHAR2(31) NOT NULL,
+            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_TAG_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER REG_TAG_TRIGGER
+                    BEFORE INSERT
+                    ON REG_TAG
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_TAG_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
+                     END;
+/  
+			
+
+CREATE TABLE REG_RESOURCE_TAG (
+            REG_TAG_ID              INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR2(256),
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
+            FOREIGN KEY (REG_TAG_ID,REG_TENANT_ID) REFERENCES REG_TAG (REG_ID,REG_TENANT_ID),            
+            REG_TENANT_ID INTEGER DEFAULT 0)
+/
+CREATE INDEX REG_TAG_IND_BY_PATH_ID ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
+/
+CREATE INDEX REG_TAG_IND_BY_VERSION ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID)
+/
+CREATE TABLE REG_PROPERTY (
+            REG_ID         INTEGER,
+            REG_NAME       VARCHAR2(100) NOT NULL,
+            REG_VALUE        VARCHAR2(1000),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_PROPERTY_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER REG_PROPERTY_TRIGGER
+                    BEFORE INSERT
+                    ON REG_PROPERTY
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_PROPERTY_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
+ 			   END;
+/                   
+
+CREATE TABLE REG_RESOURCE_PROPERTY (
+            REG_PROPERTY_ID         INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR2(256),
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
+            FOREIGN KEY (REG_PROPERTY_ID,REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID,REG_TENANT_ID),           
+            REG_TENANT_ID INTEGER DEFAULT 0)
+/
+CREATE INDEX REG_RESC_PROP_BY_VERN_PROPID ON REG_RESOURCE_PROPERTY(REG_PROPERTY_ID,REG_VERSION, REG_TENANT_ID)
+/
+CREATE INDEX REG_RESC_PROP_BY_VERN_PATHNAME ON REG_RESOURCE_PROPERTY(REG_PROPERTY_ID,REG_PATH_ID,REG_RESOURCE_NAME, REG_TENANT_ID)
+/
+CREATE TABLE REG_ASSOCIATION (
+            REG_ASSOCIATION_ID INTEGER,
+            REG_SOURCEPATH VARCHAR2 (2000) NOT NULL,
+            REG_TARGETPATH VARCHAR2 (2000) NOT NULL,
+            REG_ASSOCIATION_TYPE VARCHAR2 (2000) NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_ASSOCIATION PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_ASSOCIATION_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER REG_ASSOCIATION_TRIGGER
+                    BEFORE INSERT
+                    ON REG_ASSOCIATION
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_ASSOCIATION_SEQUENCE.nextval INTO :NEW.REG_ASSOCIATION_ID FROM dual;
+ 			   END;
+/                   
+
+CREATE TABLE REG_SNAPSHOT (
+            REG_SNAPSHOT_ID     INTEGER,
+            REG_PATH_ID            INTEGER NOT NULL,
+            REG_RESOURCE_NAME      VARCHAR2(256),
+            REG_RESOURCE_VIDS     BLOB NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
+            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID))
+/
+CREATE INDEX REG_SNAPSHOT_PATH_ID ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
+/
+CREATE SEQUENCE REG_SNAPSHOT_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER REG_SNAPSHOT_TRIGGER
+                    BEFORE INSERT
+                    ON REG_SNAPSHOT
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_SNAPSHOT_SEQUENCE.nextval INTO :NEW.REG_SNAPSHOT_ID FROM dual;
+                     END;
+/
+/
+CREATE TABLE UM_TENANT (
+                    UM_ID INTEGER,
+                    UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
+                    UM_EMAIL VARCHAR(255),
+                    UM_ACTIVE NUMBER(1) DEFAULT 0,
+                    PRIMARY KEY (UM_ID),
+                    UNIQUE(UM_DOMAIN_NAME))
+/
+CREATE SEQUENCE UM_TENANT_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_TENANT_TRIGGER
+		            BEFORE INSERT
+                    ON UM_TENANT
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                     SELECT UM_TENANT_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+                    END;
+/
+CREATE TABLE UM_USER (
+                    UM_ID INTEGER,
+                    UM_USER_NAME VARCHAR2(255) NOT NULL,
+                    UM_USER_PASSWORD VARCHAR2(255) NOT NULL,
+                    UM_SALT_VALUE VARCHAR(31),
+                    UM_REQUIRE_CHANGE NUMBER(1) DEFAULT 0,
+                    UM_CHANGED_TIME TIMESTAMP NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID),
+                    UNIQUE(UM_USER_NAME, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_USER_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_USER_TRIGGER
+		            BEFORE INSERT
+                    ON UM_USER
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                     SELECT UM_USER_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+                    END;
+/
+		
+CREATE TABLE UM_USER_ATTRIBUTE (
+                    UM_ID INTEGER,
+                    UM_ATTR_NAME VARCHAR2(255) NOT NULL,
+                    UM_ATTR_VALUE VARCHAR2(255),
+                    UM_PROFILE_ID VARCHAR(255),
+                    UM_USER_ID INTEGER,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_USER_ATTRIBUTE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_USER_ATTRIBUTE_TRIGGER
+                    BEFORE INSERT
+                    ON UM_USER_ATTRIBUTE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_USER_ATTRIBUTE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+ 			  END;
+/                   
+
+CREATE TABLE UM_ROLE (
+                    UM_ID INTEGER,
+                    UM_ROLE_NAME VARCHAR2(255) NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID),
+                    UNIQUE(UM_ROLE_NAME, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_ROLE_TRIGGER
+                    BEFORE INSERT
+                    ON UM_ROLE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                     SELECT UM_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+ 			  END;
+/             
+
+CREATE TABLE UM_PERMISSION (
+                    UM_ID INTEGER,
+                    UM_RESOURCE_ID VARCHAR2(255) NOT NULL,
+                    UM_ACTION VARCHAR2(255) NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_PERMISSION_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_PERMISSION_TRIGGER
+                    BEFORE INSERT
+                    ON UM_PERMISSION
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                     SELECT UM_PERMISSION_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+                    END;
+/   
+
+CREATE TABLE UM_ROLE_PERMISSION (
+		            UM_ID INTEGER,
+                    UM_PERMISSION_ID INTEGER NOT NULL,
+                    UM_ROLE_NAME VARCHAR(255) NOT NULL,
+                    UM_IS_ALLOWED SMALLINT NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID),
+                    FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE  CASCADE,
+                    --FOREIGN KEY (UM_ROLE_ID) REFERENCES UM_ROLE(UM_ID) ON DELETE CASCADE,                    
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_ROLE_PERMISSION_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_ROLE_PERMISSION_TRIGGER
+		            BEFORE INSERT
+                    ON UM_ROLE_PERMISSION
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_ROLE_PERMISSION_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+ 			  END;
+/                   
+
+CREATE TABLE UM_USER_PERMISSION (
+		            UM_ID INTEGER,
+		            UM_PERMISSION_ID INTEGER NOT NULL,
+                    UM_USER_NAME VARCHAR(255) NOT NULL,
+                    UM_IS_ALLOWED SMALLINT NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    UNIQUE (UM_PERMISSION_ID, UM_USER_NAME, UM_TENANT_ID),
+                    FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
+                    --FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID) ON DELETE CASCADE,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_USER_PERMISSION_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_USER_PERMISSION_TRIGGER
+		            BEFORE INSERT
+		            ON UM_USER_PERMISSION
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_USER_PERMISSION_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+ 			  END;
+/                   
+
+CREATE TABLE UM_USER_ROLE (
+		            UM_ID INTEGER,
+                    UM_ROLE_ID INTEGER NOT NULL,
+                    UM_USER_ID INTEGER NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID),
+                    FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
+                    FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_USER_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_USER_ROLE_TRIGGER
+                    BEFORE INSERT
+                    ON UM_USER_ROLE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+ 	                   SELECT UM_USER_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+                    END;
+/
+
+CREATE TABLE HYBRID_ROLE (
+                    UM_ID INTEGER,
+                    UM_ROLE_ID VARCHAR(255) NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID),
+                    UNIQUE(UM_ROLE_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE HYBRID_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER HYBRID_ROLE_TRIGGER
+                    BEFORE INSERT
+                    ON HYBRID_ROLE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT HYBRID_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+                    END;
+/  
+			
+CREATE TABLE HYBRID_USER_ROLE (
+                    UM_ID INTEGER,
+                    UM_USER_ID VARCHAR(255),
+                    UM_ROLE_ID VARCHAR(255) NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE HYBRID_USER_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER HYBRID_USER_ROLE_TRIGGER
+                    BEFORE INSERT
+                    ON HYBRID_USER_ROLE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT HYBRID_USER_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+			  END;
+/                    
+
+CREATE TABLE UM_DIALECT(
+            UM_ID INTEGER, 
+            UM_DIALECT_URI VARCHAR(255) NOT NULL,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)
+/
+CREATE SEQUENCE UM_DIALECT_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_DIALECT_TRIGGER
+                    BEFORE INSERT
+                    ON UM_DIALECT
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_DIALECT_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+  			  END;
+/                  
+
+CREATE TABLE UM_CLAIM(
+            UM_ID INTEGER, 
+            UM_DIALECT_ID INTEGER NOT NULL, 
+            UM_CLAIM_URI VARCHAR(255) NOT NULL, 
+            UM_DISPLAY_TAG VARCHAR(255), 
+            UM_DESCRIPTION VARCHAR(255), 
+            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
+            UM_REG_EX VARCHAR(255), 
+            UM_SUPPORTED SMALLINT, 
+            UM_REQUIRED SMALLINT, 
+            UM_DISPLAY_ORDER INTEGER,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID),
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)
+/
+CREATE SEQUENCE UM_CLAIM_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_CLAIM_TRIGGER
+                    BEFORE INSERT
+                    ON UM_CLAIM
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+	                SELECT UM_CLAIM_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+      		  END;
+/              
+
+CREATE TABLE UM_PROFILE_CONFIG(
+            UM_ID INTEGER, 
+            UM_DIALECT_ID INTEGER, 
+            UM_PROFILE_NAME VARCHAR(255), 
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)
+/
+CREATE SEQUENCE UM_PROFILE_CONFIG_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_PROFILE_CONFIG_TRIGGER
+                    BEFORE INSERT
+                    ON UM_PROFILE_CONFIG
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_PROFILE_CONFIG_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+                    END;
+/
+    
+CREATE TABLE UM_CLAIM_BEHAVIOR(
+            UM_ID INTEGER, 
+            UM_PROFILE_ID INTEGER, 
+            UM_CLAIM_ID INTEGER, 
+            UM_BEHAVIOUR SMALLINT,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID), 
+            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)
+/
+CREATE SEQUENCE UM_CLAIM_BEHAVIOR_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_CLAIM_BEHAVIOR_TRIGGER
+                    BEFORE INSERT
+                    ON UM_CLAIM_BEHAVIOR
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_CLAIM_BEHAVIOR_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+ 			  END;
+/                   
+
+CREATE TABLE UM_HYBRID_ROLE(
+            UM_ID INTEGER NOT NULL,
+            UM_ROLE_NAME VARCHAR(255),
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)
+/
+CREATE SEQUENCE UM_HYBRID_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_HYBRID_ROLE_TRIGGER
+                    BEFORE INSERT
+                    ON UM_HYBRID_ROLE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_HYBRID_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+              END;
+/
+CREATE TABLE UM_HYBRID_USER_ROLE(
+            UM_ID INTEGER NOT NULL,
+            UM_USER_NAME VARCHAR(255),
+            UM_ROLE_ID INTEGER NOT NULL,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
+            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)
+/
+CREATE SEQUENCE UM_HYBRID_USER_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE OR REPLACE TRIGGER UM_HYBRID_USER_ROLE_TRIGGER
+                    BEFORE INSERT
+                    ON UM_HYBRID_USER_ROLE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_HYBRID_USER_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+              END;
+/

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/oracle_rac.sql
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/oracle_rac.sql b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/oracle_rac.sql
new file mode 100644
index 0000000..4bdffd1
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/dbscripts/oracle_rac.sql
@@ -0,0 +1,644 @@
+CREATE TABLE REG_CLUSTER_LOCK (
+             REG_LOCK_NAME VARCHAR2(20),
+             REG_LOCK_STATUS VARCHAR2(20),
+             REG_LOCKED_TIME TIMESTAMP,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CLUSTER_LOCK PRIMARY KEY (REG_LOCK_NAME))
+/
+CREATE TABLE REG_LOG (
+             REG_LOG_ID INTEGER,
+             REG_PATH VARCHAR2(2000),
+             REG_USER_ID VARCHAR2(31) NOT NULL,
+             REG_LOGGED_TIME TIMESTAMP  NOT NULL,
+             REG_ACTION INTEGER NOT NULL,
+             REG_ACTION_DATA VARCHAR2(500),
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_LOG PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_LOG_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER REG_LOG_TRIGGER
+                    BEFORE INSERT
+                    ON REG_LOG
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_LOG_SEQUENCE.nextval INTO :NEW.REG_LOG_ID FROM dual;
+           		   END;
+/	         
+
+CREATE TABLE REG_PATH(
+             REG_PATH_ID INTEGER NULL,
+	         REG_PATH_VALUE VARCHAR2(2000) NOT NULL,
+             REG_PATH_PARENT_ID INTEGER,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID))
+/
+CREATE INDEX REG_PATH_IND_BY_PATH_VALUE ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID)
+/
+CREATE INDEX REG_PATH_IND_BY_PARENT_ID ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID)
+/
+CREATE SEQUENCE REG_PATH_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER REG_PATH_TRIGGER
+                    BEFORE INSERT
+                    ON REG_PATH
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_PATH_SEQUENCE.nextval INTO :NEW.REG_PATH_ID FROM dual;
+ 			   END;
+/                   
+
+CREATE TABLE REG_CONTENT (
+             REG_CONTENT_ID INTEGER,
+             REG_CONTENT_DATA BLOB,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_CONTENT_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER REG_CONTENT_TRIGGER
+                    BEFORE INSERT
+                    ON REG_CONTENT
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_CONTENT_SEQUENCE.nextval INTO :NEW.REG_CONTENT_ID FROM dual;
+ 			   END;
+/                   
+
+CREATE TABLE REG_CONTENT_HISTORY (
+             REG_CONTENT_ID INTEGER NOT NULL,
+             REG_CONTENT_DATA BLOB,
+             REG_DELETED   SMALLINT,
+             REG_TENANT_ID INTEGER DEFAULT 0,
+             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID))
+/
+CREATE TABLE REG_RESOURCE (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR2(256),
+            REG_VERSION         INTEGER,
+            REG_MEDIA_TYPE      VARCHAR2(500),
+            REG_CREATOR         VARCHAR2(31) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR2(31),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR2(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),          
+            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_RESOURCE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER REG_RESOURCE_TRIGGER
+                    BEFORE INSERT
+                    ON REG_RESOURCE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_RESOURCE_SEQUENCE.nextval INTO :NEW.REG_VERSION FROM dual;
+ 			   END;
+/                   
+
+CREATE INDEX REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME, REG_TENANT_ID)
+/
+CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID)
+/
+CREATE TABLE REG_RESOURCE_HISTORY (
+            REG_PATH_ID         INTEGER NOT NULL,
+            REG_NAME            VARCHAR2(256),
+            REG_VERSION         INTEGER NOT NULL,
+            REG_MEDIA_TYPE      VARCHAR2(500),
+            REG_CREATOR         VARCHAR2(31) NOT NULL,
+            REG_CREATED_TIME    TIMESTAMP NOT NULL,
+            REG_LAST_UPDATOR    VARCHAR2(31),
+            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
+            REG_DESCRIPTION     VARCHAR2(1000),
+            REG_CONTENT_ID      INTEGER,
+            REG_DELETED         SMALLINT,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
+            FOREIGN KEY (REG_CONTENT_ID,REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID,REG_TENANT_ID),            
+            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID))
+/
+CREATE INDEX REG_RES_HIST_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID)
+/
+CREATE INDEX REG_RES_HIST_IND_BY_PATH_ID ON REG_RESOURCE_HISTORY(REG_PATH_ID, REG_NAME, REG_TENANT_ID)
+/
+CREATE TABLE REG_COMMENT (
+            REG_ID        INTEGER,
+            REG_COMMENT_TEXT      VARCHAR2(500) NOT NULL,
+            REG_USER_ID           VARCHAR2(31) NOT NULL,
+            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_COMMENT_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER REG_COMMENT_TRIGGER
+                    BEFORE INSERT
+                    ON REG_COMMENT
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_COMMENT_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
+ 			   END;
+/                   
+
+CREATE TABLE REG_RESOURCE_COMMENT (
+            REG_COMMENT_ID          INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR2(256),
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
+            FOREIGN KEY (REG_COMMENT_ID,REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID,REG_TENANT_ID),            
+            REG_TENANT_ID INTEGER DEFAULT 0) 
+/
+CREATE INDEX REG_RES_COMM_BY_PATH_ID ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
+/
+CREATE INDEX REG_RES_COMM_BY_VERSION ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID)
+/
+CREATE TABLE REG_RATING (
+            REG_ID     INTEGER,
+            REG_RATING        INTEGER NOT NULL,
+            REG_USER_ID       VARCHAR2(31) NOT NULL,
+            REG_RATED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_RATING_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER REG_RATING_TRIGGER
+                    BEFORE INSERT
+                    ON REG_RATING
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_RATING_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
+                     END;
+/
+				
+CREATE TABLE REG_RESOURCE_RATING (
+            REG_RATING_ID           INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR2(256),
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
+            FOREIGN KEY (REG_RATING_ID,REG_TENANT_ID) REFERENCES REG_RATING (REG_ID,REG_TENANT_ID),           
+            REG_TENANT_ID INTEGER DEFAULT 0)
+/
+CREATE INDEX REG_RATING_IND_BY_PATH_ID ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
+/
+CREATE INDEX REG_RATING_IND_BY_VERSION ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID)
+/
+CREATE TABLE REG_TAG (
+            REG_ID         INTEGER,
+            REG_TAG_NAME       VARCHAR2(500) NOT NULL,
+            REG_USER_ID        VARCHAR2(31) NOT NULL,
+            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_TAG_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER REG_TAG_TRIGGER
+                    BEFORE INSERT
+                    ON REG_TAG
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_TAG_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
+                     END;
+/  
+			
+
+CREATE TABLE REG_RESOURCE_TAG (
+            REG_TAG_ID              INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR2(256),
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
+            FOREIGN KEY (REG_TAG_ID,REG_TENANT_ID) REFERENCES REG_TAG (REG_ID,REG_TENANT_ID),            
+            REG_TENANT_ID INTEGER DEFAULT 0)
+/
+CREATE INDEX REG_TAG_IND_BY_PATH_ID ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
+/
+CREATE INDEX REG_TAG_IND_BY_VERSION ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID)
+/
+CREATE TABLE REG_PROPERTY (
+            REG_ID         INTEGER,
+            REG_NAME       VARCHAR2(100) NOT NULL,
+            REG_VALUE        VARCHAR2(1000),
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_PROPERTY_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER REG_PROPERTY_TRIGGER
+                    BEFORE INSERT
+                    ON REG_PROPERTY
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_PROPERTY_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
+ 			   END;
+/                   
+
+CREATE TABLE REG_RESOURCE_PROPERTY (
+            REG_PROPERTY_ID         INTEGER NOT NULL,
+            REG_VERSION             INTEGER,
+            REG_PATH_ID             INTEGER,
+            REG_RESOURCE_NAME       VARCHAR2(256),
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
+            FOREIGN KEY (REG_PROPERTY_ID,REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID,REG_TENANT_ID),           
+            REG_TENANT_ID INTEGER DEFAULT 0)
+/
+CREATE INDEX REG_RESC_PROP_BY_VERN_PROPID ON REG_RESOURCE_PROPERTY(REG_PROPERTY_ID,REG_VERSION, REG_TENANT_ID)
+/
+CREATE INDEX REG_RESC_PROP_BY_VERN_PATHNAME ON REG_RESOURCE_PROPERTY(REG_PROPERTY_ID,REG_PATH_ID,REG_RESOURCE_NAME, REG_TENANT_ID)
+/
+CREATE TABLE REG_ASSOCIATION (
+            REG_ASSOCIATION_ID INTEGER,
+            REG_SOURCEPATH VARCHAR2 (2000) NOT NULL,
+            REG_TARGETPATH VARCHAR2 (2000) NOT NULL,
+            REG_ASSOCIATION_TYPE VARCHAR2 (2000) NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            CONSTRAINT PK_REG_ASSOCIATION PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID))
+/
+CREATE SEQUENCE REG_ASSOCIATION_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER REG_ASSOCIATION_TRIGGER
+                    BEFORE INSERT
+                    ON REG_ASSOCIATION
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_ASSOCIATION_SEQUENCE.nextval INTO :NEW.REG_ASSOCIATION_ID FROM dual;
+ 			   END;
+/                   
+
+CREATE TABLE REG_SNAPSHOT (
+            REG_SNAPSHOT_ID     INTEGER,
+            REG_PATH_ID            INTEGER NOT NULL,
+            REG_RESOURCE_NAME      VARCHAR2(256),
+            REG_RESOURCE_VIDS     BLOB NOT NULL,
+            REG_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
+            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID))
+/
+CREATE INDEX REG_SNAPSHOT_PATH_ID ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
+/
+CREATE SEQUENCE REG_SNAPSHOT_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER REG_SNAPSHOT_TRIGGER
+                    BEFORE INSERT
+                    ON REG_SNAPSHOT
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                     BEGIN
+                       SELECT REG_SNAPSHOT_SEQUENCE.nextval INTO :NEW.REG_SNAPSHOT_ID FROM dual;
+                     END;
+/
+/
+CREATE TABLE UM_TENANT (
+                    UM_ID INTEGER,
+                    UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
+                    UM_EMAIL VARCHAR(255),
+                    UM_ACTIVE NUMBER(1) DEFAULT 0,
+                    PRIMARY KEY (UM_ID),
+                    UNIQUE(UM_DOMAIN_NAME))
+/
+CREATE SEQUENCE UM_TENANT_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_TENANT_TRIGGER
+		            BEFORE INSERT
+                    ON UM_TENANT
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                     SELECT UM_TENANT_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+                    END;
+/
+CREATE TABLE UM_USER (
+                    UM_ID INTEGER,
+                    UM_USER_NAME VARCHAR2(255) NOT NULL,
+                    UM_USER_PASSWORD VARCHAR2(255) NOT NULL,
+                    UM_SALT_VALUE VARCHAR(31),
+                    UM_REQUIRE_CHANGE NUMBER(1) DEFAULT 0,
+                    UM_CHANGED_TIME TIMESTAMP NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID),
+                    UNIQUE(UM_USER_NAME, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_USER_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_USER_TRIGGER
+		            BEFORE INSERT
+                    ON UM_USER
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                     SELECT UM_USER_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+                    END;
+/
+		
+CREATE TABLE UM_USER_ATTRIBUTE (
+                    UM_ID INTEGER,
+                    UM_ATTR_NAME VARCHAR2(255) NOT NULL,
+                    UM_ATTR_VALUE VARCHAR2(255),
+                    UM_PROFILE_ID VARCHAR(255),
+                    UM_USER_ID INTEGER,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_USER_ATTRIBUTE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_USER_ATTRIBUTE_TRIGGER
+                    BEFORE INSERT
+                    ON UM_USER_ATTRIBUTE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_USER_ATTRIBUTE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+ 			  END;
+/                   
+
+CREATE TABLE UM_ROLE (
+                    UM_ID INTEGER,
+                    UM_ROLE_NAME VARCHAR2(255) NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID),
+                    UNIQUE(UM_ROLE_NAME, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_ROLE_TRIGGER
+                    BEFORE INSERT
+                    ON UM_ROLE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                     SELECT UM_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+ 			  END;
+/             
+
+CREATE TABLE UM_PERMISSION (
+                    UM_ID INTEGER,
+                    UM_RESOURCE_ID VARCHAR2(255) NOT NULL,
+                    UM_ACTION VARCHAR2(255) NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_PERMISSION_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_PERMISSION_TRIGGER
+                    BEFORE INSERT
+                    ON UM_PERMISSION
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                     SELECT UM_PERMISSION_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+                    END;
+/   
+
+CREATE TABLE UM_ROLE_PERMISSION (
+		            UM_ID INTEGER,
+                    UM_PERMISSION_ID INTEGER NOT NULL,
+                    UM_ROLE_NAME VARCHAR(255) NOT NULL,
+                    UM_IS_ALLOWED SMALLINT NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID),
+                    FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE  CASCADE,
+                    --FOREIGN KEY (UM_ROLE_ID) REFERENCES UM_ROLE(UM_ID) ON DELETE CASCADE,                    
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_ROLE_PERMISSION_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_ROLE_PERMISSION_TRIGGER
+		            BEFORE INSERT
+                    ON UM_ROLE_PERMISSION
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_ROLE_PERMISSION_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+ 			  END;
+/                   
+
+CREATE TABLE UM_USER_PERMISSION (
+		            UM_ID INTEGER,
+		            UM_PERMISSION_ID INTEGER NOT NULL,
+                    UM_USER_NAME VARCHAR(255) NOT NULL,
+                    UM_IS_ALLOWED SMALLINT NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    UNIQUE (UM_PERMISSION_ID, UM_USER_NAME, UM_TENANT_ID),
+                    FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
+                    --FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID) ON DELETE CASCADE,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_USER_PERMISSION_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_USER_PERMISSION_TRIGGER
+		            BEFORE INSERT
+		            ON UM_USER_PERMISSION
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_USER_PERMISSION_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+ 			  END;
+/                   
+
+CREATE TABLE UM_USER_ROLE (
+		            UM_ID INTEGER,
+                    UM_ROLE_ID INTEGER NOT NULL,
+                    UM_USER_ID INTEGER NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID),
+                    FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
+                    FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE UM_USER_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_USER_ROLE_TRIGGER
+                    BEFORE INSERT
+                    ON UM_USER_ROLE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+ 	                   SELECT UM_USER_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+                    END;
+/
+
+CREATE TABLE HYBRID_ROLE (
+                    UM_ID INTEGER,
+                    UM_ROLE_ID VARCHAR(255) NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID),
+                    UNIQUE(UM_ROLE_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE HYBRID_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER HYBRID_ROLE_TRIGGER
+                    BEFORE INSERT
+                    ON HYBRID_ROLE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT HYBRID_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+                    END;
+/  
+			
+CREATE TABLE HYBRID_USER_ROLE (
+                    UM_ID INTEGER,
+                    UM_USER_ID VARCHAR(255),
+                    UM_ROLE_ID VARCHAR(255) NOT NULL,
+                    UM_TENANT_ID INTEGER DEFAULT 0,
+                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
+/
+CREATE SEQUENCE HYBRID_USER_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER HYBRID_USER_ROLE_TRIGGER
+                    BEFORE INSERT
+                    ON HYBRID_USER_ROLE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT HYBRID_USER_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+			  END;
+/                    
+
+CREATE TABLE UM_DIALECT(
+            UM_ID INTEGER, 
+            UM_DIALECT_URI VARCHAR(255) NOT NULL,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)
+/
+CREATE SEQUENCE UM_DIALECT_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_DIALECT_TRIGGER
+                    BEFORE INSERT
+                    ON UM_DIALECT
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_DIALECT_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+  			  END;
+/                  
+
+CREATE TABLE UM_CLAIM(
+            UM_ID INTEGER, 
+            UM_DIALECT_ID INTEGER NOT NULL, 
+            UM_CLAIM_URI VARCHAR(255) NOT NULL, 
+            UM_DISPLAY_TAG VARCHAR(255), 
+            UM_DESCRIPTION VARCHAR(255), 
+            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
+            UM_REG_EX VARCHAR(255), 
+            UM_SUPPORTED SMALLINT, 
+            UM_REQUIRED SMALLINT, 
+            UM_DISPLAY_ORDER INTEGER,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID),
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)
+/
+CREATE SEQUENCE UM_CLAIM_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_CLAIM_TRIGGER
+                    BEFORE INSERT
+                    ON UM_CLAIM
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+	                SELECT UM_CLAIM_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+      		  END;
+/              
+
+CREATE TABLE UM_PROFILE_CONFIG(
+            UM_ID INTEGER, 
+            UM_DIALECT_ID INTEGER, 
+            UM_PROFILE_NAME VARCHAR(255), 
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)
+/
+CREATE SEQUENCE UM_PROFILE_CONFIG_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_PROFILE_CONFIG_TRIGGER
+                    BEFORE INSERT
+                    ON UM_PROFILE_CONFIG
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_PROFILE_CONFIG_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+                    END;
+/
+    
+CREATE TABLE UM_CLAIM_BEHAVIOR(
+            UM_ID INTEGER, 
+            UM_PROFILE_ID INTEGER, 
+            UM_CLAIM_ID INTEGER, 
+            UM_BEHAVIOUR SMALLINT,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID), 
+            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID), 
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)
+/
+CREATE SEQUENCE UM_CLAIM_BEHAVIOR_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_CLAIM_BEHAVIOR_TRIGGER
+                    BEFORE INSERT
+                    ON UM_CLAIM_BEHAVIOR
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_CLAIM_BEHAVIOR_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+ 			  END;
+/                   
+
+CREATE TABLE UM_HYBRID_ROLE(
+            UM_ID INTEGER NOT NULL,
+            UM_ROLE_NAME VARCHAR(255),
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)
+/
+CREATE SEQUENCE UM_HYBRID_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_HYBRID_ROLE_TRIGGER
+                    BEFORE INSERT
+                    ON UM_HYBRID_ROLE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_HYBRID_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+              END;
+/
+CREATE TABLE UM_HYBRID_USER_ROLE(
+            UM_ID INTEGER NOT NULL,
+            UM_USER_NAME VARCHAR(255),
+            UM_ROLE_ID INTEGER NOT NULL,
+            UM_TENANT_ID INTEGER DEFAULT 0,
+            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
+            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
+            PRIMARY KEY (UM_ID, UM_TENANT_ID)
+)
+/
+CREATE SEQUENCE UM_HYBRID_USER_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
+/
+CREATE OR REPLACE TRIGGER UM_HYBRID_USER_ROLE_TRIGGER
+                    BEFORE INSERT
+                    ON UM_HYBRID_USER_ROLE
+                    REFERENCING NEW AS NEW
+                    FOR EACH ROW
+                    BEGIN
+                    SELECT UM_HYBRID_USER_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
+              END;
+/


[16/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/WebAppRequestListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/WebAppRequestListener.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/WebAppRequestListener.java
new file mode 100644
index 0000000..cd7fec9
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/WebAppRequestListener.java
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.agent.listeners;
+
+import org.apache.stratos.throttling.agent.cache.ThrottlingActionInfo;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.base.MultitenantConstants;
+import org.wso2.carbon.context.CarbonContext;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.apache.stratos.throttling.agent.ThrottlingAgent;
+import org.apache.stratos.throttling.agent.cache.TenantThrottlingInfo;
+import org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve;
+import org.wso2.carbon.user.api.UserStoreException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class WebAppRequestListener implements CarbonTomcatValve {
+
+    private static final Log log = LogFactory.getLog(WebAppRequestListener.class);
+
+    private static final Pattern servicesURLPattern = Pattern.compile("\\/services\\/t\\/(.*?)\\/");
+    private static final Pattern webAppsURLPattern = Pattern.compile("\\/t\\/(.*?)\\/webapps\\/");
+
+    private static final String CONTEXT_SERVICES = "services";
+    private static final String CONTEXT_WEBAPPS = "webapps";
+
+    private ThrottlingAgent throttlingAgent;
+
+    public WebAppRequestListener(ThrottlingAgent throttlingAgent) {
+        this.throttlingAgent = throttlingAgent;
+    }
+
+    public void invoke(HttpServletRequest request, HttpServletResponse response) {
+        String requestURI = request.getRequestURI();
+        String tenantDomainName = CarbonContext.getCurrentContext().
+                                  getTenantDomain();
+        String urlContext = getContext(requestURI);
+        if (tenantDomainName != null && urlContext != null) {
+            try {
+                int tenantId = throttlingAgent.getRealmService().getTenantManager().
+                        getTenantId(tenantDomainName);
+                if (tenantId <= 0) {
+                    //Allow to proceed
+                } else {
+                    if (!throttlingAgent.getRealmService().getTenantManager().getTenant(tenantId).
+                            isActive()) {
+                        //Check weather activated tenant or not
+                        String msg = "You are sending request to a deactivated tenant. for Domain: "
+                                     + tenantDomainName;
+                        log.error(msg);
+                        try {
+                            response.sendError(403, msg);
+                        } catch (IOException e) {
+                            String message = "Error in sending throttling rule violation message by an inactive tenant." +
+                                             " Tenant Domain: " + tenantDomainName;
+                            log.error(message, e);
+                        }
+                    } else {
+                        //check weather request come to webapps
+                        if (CONTEXT_WEBAPPS.equals(urlContext)) {
+                            //if tenant is active we will throttle other parameters such as bandwidth in/out
+                            try {
+                                TenantThrottlingInfo throttlingInfo =
+                                        throttlingAgent.getThrottlingInfoCache().
+                                                getTenantThrottlingInfo(tenantId);
+                                if (throttlingInfo != null) {
+                                    String[] actions =
+                                            new String[]{StratosConstants.THROTTLING_WEBAPP_IN_BANDWIDTH_ACTION,
+                                                         StratosConstants.THROTTLING_WEBAPP_OUT_BANDWIDTH_ACTION};
+                                    ThrottlingActionInfo actionInfo;
+
+                                    actionInfo = throttlingInfo.getThrottlingActionInfo(actions);
+                                    if (actionInfo != null && actionInfo.isBlocked()) {
+                                        String blockedMsg = actionInfo.getMessage();
+                                        String msg = "This action is blocked. Reason: "
+                                                     + blockedMsg;
+                                        log.error(msg);
+                                        response.sendError(509, msg);
+                                    }
+                                }
+                            } catch (Exception ex) {
+                                String msg = "Error in sending throttling rule violation message." +
+                                             " Tenant Domain: " + tenantDomainName;
+                                log.error(msg, ex);
+                                return;
+                            }
+                        } else if (CONTEXT_SERVICES.equals(urlContext)) {
+                            try {
+                                TenantThrottlingInfo throttlingInfo =
+                                        throttlingAgent.getThrottlingInfoCache().
+                                                getTenantThrottlingInfo(tenantId);
+                                if (throttlingInfo != null) {
+                                    String[] actions =
+                                            new String[]{StratosConstants.THROTTLING_SERVICE_IN_BANDWIDTH_ACTION,
+                                                         StratosConstants.THROTTLING_SERVICE_OUT_BANDWIDTH_ACTION};
+                                    ThrottlingActionInfo actionInfo;
+
+                                    actionInfo = throttlingInfo.getThrottlingActionInfo(actions);
+                                    if (actionInfo != null && actionInfo.isBlocked()) {
+                                        String blockedMsg = actionInfo.getMessage();
+                                        String msg = "This action is blocked. Reason: " +
+                                                     blockedMsg;
+                                        log.error(msg);
+                                        response.sendError(509, msg);
+                                    }
+                                }
+                            } catch (Exception ex) {
+                                String msg = "Error in sending throttling rule violation message." +
+                                             " Tenant Domain: " + tenantDomainName;
+                                log.error(msg, ex);
+                            }
+                        }
+
+                    }
+                }
+            } catch (UserStoreException e) {
+                String msg = "Error in getting tenant id to evaluate throttling rule. " +
+                             "Tenant Domain: " + tenantDomainName;
+                log.error(msg, e);
+            }
+
+        }
+    }
+
+    /**
+     * Extract tenant domain from request url
+     *
+     * @return tenant domain
+     */
+    public String getTenantName(String requestUrl) {
+        Matcher matcher = servicesURLPattern.matcher(requestUrl);
+        if (matcher.find()) {
+            return matcher.group(1);
+        }
+
+        matcher = webAppsURLPattern.matcher(requestUrl);
+        if (matcher.find()) {
+            return matcher.group(1);
+        }
+
+        return MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
+    }
+
+    /**
+     * Extract context from the request url
+     *
+     * @return context string
+     */
+    public String getContext(String requestUrl) {
+        if (requestUrl.contains("/services") && requestUrl.contains("/t")) {
+            return CONTEXT_SERVICES;
+        }
+
+        if (requestUrl.contains("/t") && requestUrl.contains("/webapps")) {
+            return CONTEXT_WEBAPPS;
+        }
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/validation/ValidationException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/validation/ValidationException.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/validation/ValidationException.java
new file mode 100644
index 0000000..f0f8737
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/validation/ValidationException.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.agent.validation;
+
+public class ValidationException extends Exception {
+    public ValidationException(String msg, Exception e) {
+        super(msg, e);
+    }
+    public ValidationException(String msg) {
+        super(msg);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/validation/ValidationInfo.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/validation/ValidationInfo.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/validation/ValidationInfo.java
new file mode 100644
index 0000000..d313e28
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/validation/ValidationInfo.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.agent.validation;
+
+public class ValidationInfo {
+	boolean isActionBlocked;
+	String blockedActionMsg;
+	
+	public ValidationInfo(){
+	    isActionBlocked = false;
+	}
+	
+	public boolean isActionBlocked() {
+		return isActionBlocked;
+	}
+	public void setActionBlocked(boolean isBlocked) {
+		this.isActionBlocked = isBlocked;
+	}
+	public String getBlockedActionMsg() {
+		return blockedActionMsg;
+	}
+	public void setBlockedActionMsg(String blockedMsg) {
+		this.blockedActionMsg = blockedMsg;
+	}
+	
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/validation/ValidationInfoRetriever.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/validation/ValidationInfoRetriever.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/validation/ValidationInfoRetriever.java
new file mode 100644
index 0000000..b65b1c5
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/validation/ValidationInfoRetriever.java
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.agent.validation;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.apache.stratos.common.util.MeteringAccessValidationUtils;
+
+public class ValidationInfoRetriever {
+    private static final Log log = LogFactory.getLog(ValidationInfoRetriever.class);
+    UserRegistry governanceSystemRegistry;
+    
+    public ValidationInfoRetriever(UserRegistry governanceSystemRegistry) {
+        this.governanceSystemRegistry = governanceSystemRegistry;
+    }
+
+    public ValidationInfo getValidationInfo(String action, int tenantId) throws ValidationException {
+        ValidationInfo validationInfo = new ValidationInfo();
+        Resource validationInfoResource = getResource(tenantId);
+        if(validationInfoResource == null){
+            //this means, the user is allowed to proceed
+            return validationInfo;
+        }
+        
+        // first get the validation info for all actions
+        checkAction(StratosConstants.THROTTLING_ALL_ACTION, validationInfoResource, validationInfo);
+        if (validationInfo.isActionBlocked()) {
+            return validationInfo;
+        }
+        checkAction(action, validationInfoResource, validationInfo);
+        return validationInfo;
+    }
+    
+    public ValidationInfo getValidationInfo(String[] actions, int tenantId) throws ValidationException {
+        ValidationInfo validationInfo = new ValidationInfo();
+        Resource validationInfoResource = getResource(tenantId);
+        if(validationInfoResource == null){
+            //this means, the user is allowed to proceed
+            return validationInfo;
+        }
+        
+     // first get the validation info for all actions
+        checkAction(StratosConstants.THROTTLING_ALL_ACTION, validationInfoResource, validationInfo);
+        if (validationInfo.isActionBlocked()) {
+            return validationInfo;
+        }
+        
+        for(String action : actions){
+            checkAction(action, validationInfoResource, validationInfo);
+            if (validationInfo.isActionBlocked()) {
+                return validationInfo;
+            }
+        }
+        return validationInfo;
+    }
+    
+    private Resource getResource (int tenantId) throws ValidationException{
+     // first retrieve validation info for the tenant
+        String tenantValidationInfoResourcePath = 
+            StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
+                        RegistryConstants.PATH_SEPARATOR + tenantId;
+        Resource tenantValidationInfoResource = null;
+        try {
+            if (governanceSystemRegistry.resourceExists(tenantValidationInfoResourcePath)) {
+                tenantValidationInfoResource =
+                        governanceSystemRegistry.get(tenantValidationInfoResourcePath);
+            }
+        } catch (RegistryException e) {
+            String msg = "Error in getting the tenant validation info for tenant:" + tenantId;
+            log.error(msg, e);
+            throw new ValidationException(msg, e);
+        }
+        return tenantValidationInfoResource;
+    }
+
+    private void checkAction(String action, Resource tenantValidationInfoResource, 
+                             ValidationInfo validationInfo){
+        String blockActionStr =
+            tenantValidationInfoResource.getProperty(
+                    MeteringAccessValidationUtils.generateIsBlockedPropertyKey(action));
+
+        if ("true".equals(blockActionStr)) {
+            validationInfo.setActionBlocked(true);
+
+            String blockActionMsg =
+                tenantValidationInfoResource.getProperty(
+                        MeteringAccessValidationUtils.generateErrorMsgPropertyKey(action));
+            validationInfo.setBlockedActionMsg(blockActionMsg);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/resources/META-INF/module.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/resources/META-INF/module.xml b/components/org.apache.stratos.throttling.agent/src/main/resources/META-INF/module.xml
new file mode 100644
index 0000000..dcf21af
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/resources/META-INF/module.xml
@@ -0,0 +1,34 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<module name="usagethrottling" class="org.apache.stratos.throttling.agent.listeners.ThrottlingModule">
+   <InFlow>
+        <handler name="InFlowUsageThrottlingHandler"
+                 class="org.apache.stratos.throttling.agent.listeners.ServiceRequestListener">
+        <order phase="OpPhase" after="AuthorizationHandler"/>
+        </handler>
+   </InFlow>
+
+   <InFaultFlow>
+        <handler name="FaultInFlowUsageThrottlingHandler"
+                 class="org.apache.stratos.throttling.agent.listeners.ServiceRequestListener">
+        <order phase="OpPhase" after="AuthorizationHandler"/>
+        </handler>
+   </InFaultFlow>
+  <parameter name="adminModule" locked="true">true</parameter>
+</module>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/resources/MultitenancyThrottlingService.wsdl
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/resources/MultitenancyThrottlingService.wsdl b/components/org.apache.stratos.throttling.agent/src/main/resources/MultitenancyThrottlingService.wsdl
new file mode 100644
index 0000000..a652030
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/resources/MultitenancyThrottlingService.wsdl
@@ -0,0 +1,82 @@
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://services.manager.throttling.carbon.wso2.org" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://services.manager.throttling.carbon.wso2.org">
+    <wsdl:documentation>MultitenancyThrottlingService</wsdl:documentation>
+    <wsdl:types>
+        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.manager.throttling.carbon.wso2.org">
+            <xs:element name="executeThrottlingRulesException">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="executeThrottlingRulesException" nillable="true" type="ns:Exception" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:complexType name="Exception">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string" />
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="executeThrottlingRules">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="tenantId" type="xs:int" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:schema>
+    </wsdl:types>
+    <wsdl:message name="executeThrottlingRulesRequest">
+        <wsdl:part name="parameters" element="ns:executeThrottlingRules" />
+    </wsdl:message>
+    <wsdl:message name="executeThrottlingRulesException">
+        <wsdl:part name="parameters" element="ns:executeThrottlingRulesException" />
+    </wsdl:message>
+    <wsdl:portType name="MultitenancyThrottlingServicePortType">
+        <wsdl:operation name="executeThrottlingRules">
+            <wsdl:input message="ns:executeThrottlingRulesRequest" wsaw:Action="urn:executeThrottlingRules" />
+            <wsdl:fault message="ns:executeThrottlingRulesException" name="executeThrottlingRulesException" wsaw:Action="urn:executeThrottlingRulesexecuteThrottlingRulesException" />
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="MultitenancyThrottlingServiceSoap11Binding" type="ns:MultitenancyThrottlingServicePortType">
+        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+        <wsdl:operation name="executeThrottlingRules">
+            <soap:operation soapAction="urn:executeThrottlingRules" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:fault name="executeThrottlingRulesException">
+                <soap:fault use="literal" name="executeThrottlingRulesException" />
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="MultitenancyThrottlingServiceSoap12Binding" type="ns:MultitenancyThrottlingServicePortType">
+        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+        <wsdl:operation name="executeThrottlingRules">
+            <soap12:operation soapAction="urn:executeThrottlingRules" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:fault name="executeThrottlingRulesException">
+                <soap12:fault use="literal" name="executeThrottlingRulesException" />
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="MultitenancyThrottlingServiceHttpBinding" type="ns:MultitenancyThrottlingServicePortType">
+        <http:binding verb="POST" />
+        <wsdl:operation name="executeThrottlingRules">
+            <http:operation location="executeThrottlingRules" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:input>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="MultitenancyThrottlingService">
+        <wsdl:port name="MultitenancyThrottlingServiceHttpsSoap11Endpoint" binding="ns:MultitenancyThrottlingServiceSoap11Binding">
+            <soap:address location="https://192.168.1.100:9443/services/MultitenancyThrottlingService.MultitenancyThrottlingServiceHttpsSoap11Endpoint/" />
+        </wsdl:port>
+        <wsdl:port name="MultitenancyThrottlingServiceHttpsSoap12Endpoint" binding="ns:MultitenancyThrottlingServiceSoap12Binding">
+            <soap12:address location="https://192.168.1.100:9443/services/MultitenancyThrottlingService.MultitenancyThrottlingServiceHttpsSoap12Endpoint/" />
+        </wsdl:port>
+        <wsdl:port name="MultitenancyThrottlingServiceHttpsEndpoint" binding="ns:MultitenancyThrottlingServiceHttpBinding">
+            <http:address location="https://192.168.1.100:9443/services/MultitenancyThrottlingService.MultitenancyThrottlingServiceHttpsEndpoint/" />
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/pom.xml b/components/org.apache.stratos.throttling.manager/pom.xml
new file mode 100644
index 0000000..0855d5a
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/pom.xml
@@ -0,0 +1,177 @@
+<!-- 
+  #  Licensed to the Apache Software Foundation (ASF) under one
+  #  or more contributor license agreements.  See the NOTICE file
+  #  distributed with this work for additional information
+  #  regarding copyright ownership.  The ASF licenses this file
+  #  to you under the Apache License, Version 2.0 (the
+  #  "License"); you may not use this file except in compliance
+  #  with the License.  You may obtain a copy of the License at
+  #  
+  #  http://www.apache.org/licenses/LICENSE-2.0
+  #  
+  #  Unless required by applicable law or agreed to in writing,
+  #  software distributed under the License is distributed on an
+  #  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  #  KIND, either express or implied.  See the License for the
+  #  specific language governing permissions and limitations
+  #  under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>stratos-components-parent</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.apache.stratos.throttling.manager</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache Stratos - Throttling Manager</name>
+
+    <build>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<configuration>
+					<excludes>
+						<exclude>**/BaseTestCase.java</exclude>
+						<exclude>**/ThrottlingTest.java</exclude>
+					</excludes>
+				</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.apache.stratos.throttling.manager.dataobjects,
+                        </Export-Package>
+                        <Private-Package>
+                            !org.apache.stratos.throttling.manager.dataobjects,
+                            org.apache.stratos.throttling.manager.*,
+                        </Private-Package>
+                        <!--<Require-Bundle>
+                            drools;visibility:=reexport
+                        </Require-Bundle>-->
+                        <Import-Package>
+                            org.wso2.carbon.rule.*,
+                            org.apache.stratos.common.*,
+                            org.apahce.throttling.agent.*,
+                            org.wso2.carbon.billing.mgt.*,
+                            org.wso2.carbon.registry.core.*;version=1.0.1,
+                            org.wso2.carbon.registry.resource.*,
+                            org.quartz.*; version=2.1.1,
+                            !javax.xml.namespace,
+                            javax.xml.namespace; version=0.0.0,
+                            javax.servlet;version="${imp.pkg.version.javax.servlet}",
+                            javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
+                            org.apache.axiom.*; version="${axiom.osgi.version.range}",
+                            *;resolution:=optional
+                        </Import-Package>
+                        <DynamicImport-Package>*</DynamicImport-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.axis2.wso2</groupId>
+            <artifactId>axis2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.utils</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.extensions</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.resource</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.common</artifactId>
+	    <version>${apache.stratos.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.usage</artifactId>
+            <version>${apache.stratos.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.billing.mgt</artifactId>
+ 	    <version>2.1.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.rule.kernel</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.rule.common</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.rule.backend</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.synapse</groupId>
+            <artifactId>synapse-tasks</artifactId>
+ 	    <version>2.1.1-wso2v4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.synapse</groupId>
+            <artifactId>synapse-commons</artifactId>
+	    <version>2.1.1-wso2v4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.throttling.agent</artifactId>
+            <version>${apache.stratos.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.usage.agent</artifactId>
+            <version>${apache.stratos.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/conf/ThrottlingConfiguration.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/conf/ThrottlingConfiguration.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/conf/ThrottlingConfiguration.java
new file mode 100644
index 0000000..2c43fa4
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/conf/ThrottlingConfiguration.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.conf;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+import org.apache.stratos.throttling.manager.tasks.Task;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.util.CommonUtil;
+
+public class ThrottlingConfiguration {
+    private static final Log log = LogFactory.getLog(ThrottlingConfiguration.class);
+    private static final String CONFIG_NS = "http://wso2.com/carbon/multitenancy/usage-throttling-agent/config";
+    List<ThrottlingTaskConfiguration> throttlingTaskConfigs;
+    List<Task> tasks;
+
+    public ThrottlingConfiguration(String throttlingConfigFile) throws ThrottlingException {
+        try {
+            OMElement throttlingConfig =
+                    CommonUtil.buildOMElement(new FileInputStream(throttlingConfigFile));
+            deserialize(throttlingConfig);
+        } catch (FileNotFoundException e) {
+            String msg = "Unable to find the file: " + throttlingConfigFile + ".";
+            log.error(msg, e);
+            throw new ThrottlingException(msg, e);
+        } catch (Exception e) {
+            String msg = "Error in building the throttling config, config file: " +
+                            throttlingConfigFile + ".";
+            log.error(msg, e);
+            throw new ThrottlingException(msg, e);
+        }
+    }
+
+    public void deserialize(OMElement throttlingConfigEle) throws ThrottlingException {
+        OMElement throttlingManagerConfigs=null;
+        Iterator childElements = throttlingConfigEle.getChildElements();
+        while (childElements.hasNext()) {
+            Object configChildElement = childElements.next();
+
+            if (!(configChildElement instanceof OMElement)) {
+                continue;
+            }
+            OMElement configChildOMElement = (OMElement) configChildElement;
+            if (new QName(CONFIG_NS, "ThrottlingManagerTask", "").equals(configChildOMElement.getQName())) {
+               throttlingManagerConfigs=(OMElement)configChildElement;
+            }
+        }
+       // Iterator throttlingConfigChildIt = throttlingConfigEle.getChildElements();
+        Iterator throttlingConfigChildIt = throttlingManagerConfigs.getChildElements();
+        while (throttlingConfigChildIt.hasNext()) {
+            Object throttlingConfigChild = throttlingConfigChildIt.next();
+            if (!(throttlingConfigChild instanceof OMElement)) {
+                continue;
+            }
+            OMElement throttlingConfigChildEle = (OMElement) throttlingConfigChild;
+
+            if (new QName(CONFIG_NS, "tasks", "").equals(throttlingConfigChildEle.getQName())) {
+                throttlingTaskConfigs = new ArrayList<ThrottlingTaskConfiguration>();
+                tasks = new ArrayList<Task>();
+                Iterator tasksConfigChildIt = throttlingConfigChildEle.getChildElements();
+                while (tasksConfigChildIt.hasNext()) {
+                    Object taskConfigChild = tasksConfigChildIt.next();
+                    if (!(taskConfigChild instanceof OMElement)) {
+                        continue;
+                    }
+                    ThrottlingTaskConfiguration taskConfiguration =
+                            new ThrottlingTaskConfiguration((OMElement) taskConfigChild);
+                    throttlingTaskConfigs.add(taskConfiguration);
+                    tasks.add(taskConfiguration.getTask());
+                }
+            }
+        }
+    }
+
+	public List<ThrottlingTaskConfiguration> getThrottlingTaskConfigs() {
+		return throttlingTaskConfigs;
+	}
+
+	public List<Task> getThrottlingTasks() {
+		return tasks;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/conf/ThrottlingTaskConfiguration.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/conf/ThrottlingTaskConfiguration.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/conf/ThrottlingTaskConfiguration.java
new file mode 100644
index 0000000..553881b
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/conf/ThrottlingTaskConfiguration.java
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.conf;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+import org.apache.stratos.throttling.manager.tasks.Task;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+public class ThrottlingTaskConfiguration {
+	private static final Log log =
+	        LogFactory.getLog(ThrottlingTaskConfiguration.class);
+
+	private static final String CONFIG_NS =
+	        "http://wso2.com/carbon/multitenancy/usage-throttling-agent/config";
+	private static final String TASK_CONF_PARAMERTERS = "parameters";
+	private static final String TASK_CONF_DATA_PROVIDERS = "dataProviders";
+	private static final String TASK_CONF_PARAM_KEY = "parameter";
+	private static final String TASK_CONF_PARAM_NAME_KEY = "name";
+
+	public static final String INTERVAL_PARAM_KEY = "interval";
+	public static final String DELAY_PARAM_KEY = "delay";
+
+	Task task;
+	List<ThrottlingTaskDataProviderConfiguration> dataProviderConfigs;
+	Map<String, String> taskParameters;
+
+    public ThrottlingTaskConfiguration(OMElement taskConfigEle) throws ThrottlingException {
+        dataProviderConfigs = new ArrayList<ThrottlingTaskDataProviderConfiguration>();
+        serialize(taskConfigEle);
+    }
+
+    private void serialize(OMElement taskConfigEle) throws ThrottlingException {
+        Iterator taskConfigChildIt = taskConfigEle.getChildElements();
+
+        while (taskConfigChildIt.hasNext()) {
+            Object taskConfigChildObj = taskConfigChildIt.next();
+            if (!(taskConfigChildObj instanceof OMElement)) {
+                continue;
+            }
+            OMElement taskConfigChildEle = (OMElement) taskConfigChildObj;
+            if (taskConfigChildEle.getQName().equals(new QName(CONFIG_NS, TASK_CONF_PARAMERTERS))) {
+                Iterator parametersIt = taskConfigChildEle.getChildElements();
+
+                taskParameters = extractTaskParameters(parametersIt);
+            } else if (taskConfigChildEle.getQName().equals(
+                    new QName(CONFIG_NS, TASK_CONF_DATA_PROVIDERS))) {
+                Iterator handlerConfigIt = taskConfigChildEle.getChildElements();
+                while (handlerConfigIt.hasNext()) {
+                    Object handlerConfigObj = handlerConfigIt.next();
+                    if (!(handlerConfigObj instanceof OMElement)) {
+                        continue;
+                    }
+                    OMElement handlerConfigEle = (OMElement) handlerConfigObj;
+                    ThrottlingTaskDataProviderConfiguration handlerConfig =
+                            new ThrottlingTaskDataProviderConfiguration(handlerConfigEle);
+                    dataProviderConfigs.add(handlerConfig);
+                }
+            }
+        }
+
+        // create the task instance
+        task = new Task(taskParameters, dataProviderConfigs);
+
+    }
+
+	private static Map<String, String> extractTaskParameters(
+	        Iterator parameterIt) throws ThrottlingException {
+		Map<String, String> parameters = new HashMap<String, String>();
+		while (parameterIt.hasNext()) {
+			Object parameterObj = parameterIt.next();
+			if (!(parameterObj instanceof OMElement)) {
+				continue;
+			}
+			OMElement configChildEle = (OMElement) parameterObj;
+			if (!new QName(CONFIG_NS, TASK_CONF_PARAM_KEY, "")
+			        .equals(configChildEle.getQName())) {
+				continue;
+			}
+			String paramName =
+			        configChildEle.getAttributeValue(new QName(
+			                TASK_CONF_PARAM_NAME_KEY));
+			String paramValue = configChildEle.getText();
+			parameters.put(paramName, paramValue);
+		}
+		return parameters;
+	}
+
+	public List<ThrottlingTaskDataProviderConfiguration> getDataProviderConfigs() {
+		return dataProviderConfigs;
+	}
+
+	public Task getTask() {
+		return task;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/conf/ThrottlingTaskDataProviderConfiguration.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/conf/ThrottlingTaskDataProviderConfiguration.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/conf/ThrottlingTaskDataProviderConfiguration.java
new file mode 100644
index 0000000..5187e2b
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/conf/ThrottlingTaskDataProviderConfiguration.java
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.conf;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.stratos.throttling.manager.dataproviders.DataProvider;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+import org.apache.stratos.throttling.manager.utils.Util;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+public class ThrottlingTaskDataProviderConfiguration {
+	private static final Log log =
+	        LogFactory.getLog(ThrottlingTaskDataProviderConfiguration.class);
+
+	private static final String CONFIG_NS =
+	        "http://wso2.com/carbon/multitenancy/throttling/config";
+	private static final String HANDLER_CONF_PARAM_KEY = "parameter";
+	private static final String HANDLER_CLASS_ATTR = "class";
+	private static final String HANDLER_CONF_PARAM_NAME_KEY = "name";
+	private static final String HANDLER_SERVICE_ATTR = "service";
+
+	private String dataProviderServiceName;
+	private Map<String, String> dataProviderParameters;
+	private DataProvider dataProvider;
+	// to keep the task class that are available.
+	private Map<String, DataProvider> dataProviders;
+
+	public ThrottlingTaskDataProviderConfiguration(OMElement handlerConfigEle)
+            throws ThrottlingException {
+		serialize(handlerConfigEle);
+		dataProviders = new HashMap<String, DataProvider>();
+	}
+
+    private void serialize(OMElement handlerConfigEle) throws ThrottlingException {
+        Iterator handlerParameterChildIt = handlerConfigEle.getChildElements();
+        Map<String, String> parameters = extractParameters(handlerParameterChildIt);
+        // get the task class
+        String handlerClassName = handlerConfigEle.getAttributeValue(new QName(HANDLER_CLASS_ATTR));
+
+        if (handlerClassName == null) {
+            dataProviderServiceName =
+                    handlerConfigEle.getAttributeValue(new QName(HANDLER_SERVICE_ATTR));
+            dataProviderParameters = parameters;
+        } else {
+            dataProvider = (DataProvider) Util.constructObject(handlerClassName);
+            dataProvider.init(parameters);
+        }
+    }
+
+    private static Map<String, String> extractParameters(Iterator parameterIt)
+            throws ThrottlingException {
+        Map<String, String> parameters = new HashMap<String, String>();
+        while (parameterIt.hasNext()) {
+            Object parameterObj = parameterIt.next();
+            if (!(parameterObj instanceof OMElement)) {
+                continue;
+            }
+            OMElement configChildEle = (OMElement) parameterObj;
+            if (!new QName(CONFIG_NS, HANDLER_CONF_PARAM_KEY, "").equals(configChildEle.getQName())) {
+                continue;
+            }
+            String paramName =
+                    configChildEle.getAttributeValue(new QName(HANDLER_CONF_PARAM_NAME_KEY));
+            String paramValue = configChildEle.getText();
+            parameters.put(paramName, paramValue);
+        }
+        return parameters;
+    }
+
+	// get task have to be called to initialize tasks which are registered as
+	// OSGI services
+	public DataProvider getDataProvider() throws ThrottlingException {
+		if (dataProvider == null && dataProviderServiceName != null) {
+			dataProvider = dataProviders.get(dataProviderServiceName);
+			if (dataProvider == null) {
+				String msg =
+				        "The scheduler helper service: " +
+				                dataProviderServiceName + " is not loaded.";
+				log.error(msg);
+				throw new ThrottlingException(msg);
+			}
+			dataProvider.init(dataProviderParameters);
+		}
+		return dataProvider;
+	}
+
+	public void loadDataProviderService() throws ThrottlingException {
+		if (dataProvider == null && dataProviderServiceName != null) {
+			dataProvider = dataProviders.get(dataProviderServiceName);
+			if (dataProvider != null) {
+				dataProvider.init(dataProviderParameters);
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingAccessValidation.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingAccessValidation.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingAccessValidation.java
new file mode 100644
index 0000000..0721dd4
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingAccessValidation.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.dataobjects;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+public class ThrottlingAccessValidation {
+
+    Map<String, Boolean> userBlockedActions = new HashMap<String, Boolean>();
+    Map<String, Boolean> tenantBlockedActions = new HashMap<String, Boolean>();
+    Map<String, String> userBlockedMsgs = new HashMap<String, String>();
+    Map<String, String> tenantBlockedMsgs = new HashMap<String, String>();
+
+    boolean persistValidationInfo = true;
+
+    public boolean isPersistValidationInfo() {
+        return persistValidationInfo;
+    }
+
+    public void setPersistValidationInfo(boolean persistValidationInfo) {
+        this.persistValidationInfo = persistValidationInfo;
+    }
+
+    public boolean isUserBlocked(String action) {
+        Boolean result = userBlockedActions.get(action);
+        return result == null? false: result;
+    }
+
+    public String getUserBlockedMsg(String action) {
+        return userBlockedMsgs.get(action);
+    }
+
+    public void setUserBlocked(String action, boolean block, String msg) {
+        userBlockedActions.put(action, block);
+        userBlockedMsgs.put(action, msg);
+    }
+
+    public boolean isTenantBlocked(String action) {
+        Boolean result = tenantBlockedActions.get(action);
+        return result == null? false: result;
+    }
+
+    public String getTenantBlockedMsg(String action) {
+        return tenantBlockedMsgs.get(action);
+    }
+
+    public void setTenantBlocked(String action, boolean block, String msg) {
+        tenantBlockedActions.put(action, block);
+        tenantBlockedMsgs.put(action, msg);
+    }
+
+    public Set<String> getActions() {
+    	return tenantBlockedActions.keySet();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingDataContext.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingDataContext.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingDataContext.java
new file mode 100644
index 0000000..bbe5ac2
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingDataContext.java
@@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.dataobjects;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ThrottlingDataContext {
+    int tenantId;
+    String userName;
+    Map<String, ThrottlingDataEntry> data;
+    boolean async = false;
+    String taskName = null;
+
+    private ThrottlingAccessValidation accessValidation;
+    boolean processingComplete;
+
+    public ThrottlingDataContext(int tenantId) {
+        this.tenantId = tenantId;
+        this.data = new HashMap<String, ThrottlingDataEntry>();
+    }
+
+    public int getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(int tenantId) {
+        this.tenantId = tenantId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+
+    public ThrottlingAccessValidation getAccessValidation() {
+        return accessValidation;
+    }
+
+    public void setAccessValidation(ThrottlingAccessValidation accessValidation) {
+        this.accessValidation = accessValidation;
+    }
+
+    public boolean isProcessingComplete() {
+        return processingComplete;
+    }
+
+    public void setProcessingComplete(boolean processingComplete) {
+        this.processingComplete = processingComplete;
+    }
+
+    public Collection<ThrottlingDataEntry> getData() {
+        return data.values();
+    }
+
+    public void addDataString(String key, String value) {
+        ThrottlingDataEntry dataEntry = new ThrottlingDataEntry(key);
+        dataEntry.setStringValue(value);
+        data.put(key, dataEntry);
+    }
+
+    public void addDataLong(String key, long value) {
+        ThrottlingDataEntry dataEntry = new ThrottlingDataEntry(key);
+        dataEntry.setLongValue(value);
+        data.put(key, dataEntry);
+    }
+
+    public void addDataInt(String key, int value) {
+        ThrottlingDataEntry dataEntry = new ThrottlingDataEntry(key);
+        dataEntry.setIntValue(value);
+        data.put(key, dataEntry);
+    }
+
+    public void addDataObject(String key, Object value) {
+        ThrottlingDataEntry dataEntry = new ThrottlingDataEntry(key);
+        dataEntry.setObjectValue(value);
+        data.put(key, dataEntry);
+    }
+
+    public String getDataString(String key) {
+        ThrottlingDataEntry dataEntry = data.get(key);
+        if (dataEntry == null) {
+            return null;
+        }
+        return dataEntry.getStringValue();
+    }
+
+    public long getDataLong(String key) {
+        ThrottlingDataEntry dataEntry = data.get(key);
+        if (dataEntry == null) {
+            return 0;
+        }
+        return dataEntry.getLongValue();
+    }
+
+    public int getDataInt(String key) {
+        ThrottlingDataEntry dataEntry = data.get(key);
+        if (dataEntry == null) {
+            return 0;
+        }
+        return dataEntry.getIntValue();
+    }
+
+    public Object getDataObject(String key) {
+        ThrottlingDataEntry dataEntry = data.get(key);
+        if (dataEntry == null) {
+            return null;
+        }
+        return dataEntry.getObjectValue();
+    }
+
+    public boolean isAsync() {
+        return async;
+    }
+
+    public void setAsync(boolean async) {
+        this.async = async;
+    }
+
+    public String getTaskName() {
+        return taskName;
+    }
+
+    public void setTaskName(String taskName) {
+        this.taskName = taskName;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingDataEntry.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingDataEntry.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingDataEntry.java
new file mode 100644
index 0000000..9941e76
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingDataEntry.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.dataobjects;
+
+public class ThrottlingDataEntry {
+    String key;
+    String stringValue;
+    int intValue;
+    long longValue;
+    Object objectValue;
+
+    // here we are not using enums, as pojo services may not support that.
+    // 1 - String, 2 - Int, 3 - long, 4 - object
+    int valueType;
+
+    public ThrottlingDataEntry(String key) {
+        this.key = key;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getStringValue() {
+        return stringValue;
+    }
+
+    public void setStringValue(String stringValue) {
+        this.stringValue = stringValue;
+        valueType = 1;
+    }
+
+    public int getIntValue() {
+        return intValue;
+    }
+
+    public void setIntValue(int intValue) {
+        this.intValue = intValue;
+        valueType = 2;
+    }
+
+    public long getLongValue() {
+        return longValue;
+    }
+
+    public void setLongValue(long longValue) {
+        this.longValue = longValue;
+        valueType = 3;
+    }
+
+    public Object getObjectValue() {
+        return objectValue;
+    }
+
+    public void setObjectValue(Object objectValue) {
+        this.objectValue = objectValue;
+        valueType = 4;
+    }
+
+    public int getValueType() {
+        return valueType;
+    }
+
+    public void setValueType(int valueType) {
+        this.valueType = valueType;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingDataEntryConstants.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingDataEntryConstants.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingDataEntryConstants.java
new file mode 100644
index 0000000..2130287
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataobjects/ThrottlingDataEntryConstants.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.dataobjects;
+
+public class ThrottlingDataEntryConstants {
+
+    final public static String TENANT_INCOMING_BANDWIDTH = "tenantIncomingBandwidth";
+    final public static String TENANT_OUTGOING_BANDWIDTH = "tenantOutgoingBandwidth";
+
+    final public static String TENANT_CAPACITY = "tenantCapacity";
+    final public static String TENANT_HISTORY_CAPACITY = "tenantHistoryCapacity";
+
+    final public static String USERS_COUNT = "usersCount";
+
+    // some custom objects
+    final public static String CUSTOMER = "customer";
+    final public static String PACKAGE = "package";
+    final public static String USER_MANAGER = "userManager";
+    final public static String REGISTRY_INCOMING_BANDWIDTH = "registryIncomingBandwidth";
+    final public static String REGISTRY_OUTGOING_BANDWIDTH = "registryOutgoingBandwidth";
+    final public static String SERVICE_INCOMING_BANDWIDTH = "serviceIncomingBandwidth";
+    final public static String SERVICE_OUTGOING_BANDWIDTH = "serviceOutgoingBandwidth";
+    final public static String WEBAPP_INCOMING_BANDWIDTH = "webappIncomingBandwidth";
+    final public static String WEBAPP_OUTGOING_BANDWIDTH = "webappOutgoingBandwidth";
+    final public static String SERVICE_REQUEST_COUNT = "serviceRequestCount";
+    final public static String SERVICE_RESPONSE_COUNT = "serviceResponseCount";
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataproviders/BillingDataProvider.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataproviders/BillingDataProvider.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataproviders/BillingDataProvider.java
new file mode 100644
index 0000000..48994bf
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataproviders/BillingDataProvider.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.dataproviders;
+
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataContext;
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataEntryConstants;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+import org.apache.stratos.throttling.manager.utils.Util;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.billing.core.dataobjects.Customer;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.billing.mgt.dataobjects.MultitenancyPackage;
+
+public class BillingDataProvider extends DataProvider {
+    private static Log log = LogFactory.getLog(BillingDataProvider.class);
+
+    
+    public void invoke(ThrottlingDataContext dataContext) throws ThrottlingException {
+        int tenantId = dataContext.getTenantId();
+        try {
+            Customer customer = Util.getCurrentBillingCustomer(tenantId);
+            dataContext.addDataObject(ThrottlingDataEntryConstants.CUSTOMER, customer);
+        } catch (RegistryException e) {
+            String msg = "Error in getting the current customer. tenant id: " + tenantId + ".";
+            log.error(msg, e);
+            throw new ThrottlingException(msg, e);
+        }
+        // getting the package
+        try {
+            MultitenancyPackage mtPackage = Util.getCurrentBillingPackage(tenantId);
+            dataContext.addDataObject(ThrottlingDataEntryConstants.PACKAGE, mtPackage);
+        } catch (RegistryException e) {
+            String msg = "Error in getting the multi-tenancy package. tenant id: " + tenantId + ".";
+            log.error(msg, e);
+            throw new ThrottlingException(msg, e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataproviders/DataProvider.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataproviders/DataProvider.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataproviders/DataProvider.java
new file mode 100644
index 0000000..0df2b12
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataproviders/DataProvider.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.dataproviders;
+
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataContext;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+
+import java.util.Map;
+
+public abstract class DataProvider {
+    Map<String, String> parameters;
+
+    public void init(Map<String, String> parameters) throws ThrottlingException {
+        this.parameters = parameters;
+    }
+
+    public Map<String, String> getParameters() {
+        return parameters;
+    }
+
+    public abstract void invoke(ThrottlingDataContext dataContext) throws ThrottlingException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataproviders/UsageDataProvider.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataproviders/UsageDataProvider.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataproviders/UsageDataProvider.java
new file mode 100644
index 0000000..de8b689
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/dataproviders/UsageDataProvider.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.dataproviders;
+
+import java.util.Calendar;
+
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataEntryConstants;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+import org.apache.stratos.throttling.manager.utils.Util;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataContext;
+import org.apache.stratos.usage.beans.BandwidthStatistics;
+import org.apache.stratos.usage.beans.RequestStatistics;
+import org.apache.stratos.usage.api.TenantUsageRetriever;
+import org.apache.stratos.usage.beans.TenantUsage;
+
+/**
+ *
+ */
+public class UsageDataProvider extends DataProvider {
+    private static final Log log = LogFactory.getLog(UsageDataProvider.class);
+    
+    @Override
+    public void invoke(ThrottlingDataContext dataContext) throws ThrottlingException {
+        int tenantId = dataContext.getTenantId();
+        String userName = dataContext.getUserName();
+        String yearMonth = Util.getCurrentMonthString(Calendar.getInstance());
+        TenantUsageRetriever tenantUsageRetriever = Util.getTenantUsageRetriever();
+        
+        try {
+            TenantUsage usage = tenantUsageRetriever.getTenantUsage(tenantId, yearMonth);
+            
+            //Bandwidth usages
+            long tenantIncomingBandwidth = usage.getTotalIncomingBandwidth();
+            long tenantOutgoingBandwidth = usage.getTotalOutgoingBandwidth();
+            dataContext.addDataLong(ThrottlingDataEntryConstants.TENANT_INCOMING_BANDWIDTH,
+                    tenantIncomingBandwidth);
+            dataContext.addDataLong(ThrottlingDataEntryConstants.TENANT_OUTGOING_BANDWIDTH,
+                    tenantOutgoingBandwidth);
+            
+            //Registry space capacity
+            long currentTenantCapacity = usage.getRegistryContentCapacity();
+            long historyTenantCapacity = usage.getRegistryContentHistoryCapacity();
+            dataContext.addDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY,
+                    currentTenantCapacity);
+            dataContext.addDataLong(ThrottlingDataEntryConstants.TENANT_HISTORY_CAPACITY,
+                    historyTenantCapacity);
+            //Assigning registry bandwidths
+            BandwidthStatistics totalRgistryBW=usage.getTotalRegistryBandwidth();
+            dataContext.addDataLong(ThrottlingDataEntryConstants.REGISTRY_INCOMING_BANDWIDTH,
+                    totalRgistryBW.getIncomingBandwidth());
+            dataContext.addDataLong(ThrottlingDataEntryConstants.REGISTRY_OUTGOING_BANDWIDTH,
+                    totalRgistryBW.getOutgoingBandwidth());
+
+            //Assigning service bandwidths
+            BandwidthStatistics serviceBWStatistic=usage.getTotalServiceBandwidth();
+            dataContext.addDataLong(ThrottlingDataEntryConstants.SERVICE_INCOMING_BANDWIDTH,
+                    serviceBWStatistic.getIncomingBandwidth());
+            dataContext.addDataLong(ThrottlingDataEntryConstants.SERVICE_OUTGOING_BANDWIDTH,
+                    serviceBWStatistic.getOutgoingBandwidth());
+            
+            //Assigning webapp bandwidths
+            BandwidthStatistics webappBWStatistic = usage.getTotalWebappBandwidth();
+            dataContext.addDataLong(ThrottlingDataEntryConstants.WEBAPP_INCOMING_BANDWIDTH, 
+                    webappBWStatistic.getIncomingBandwidth());
+            dataContext.addDataLong(ThrottlingDataEntryConstants.WEBAPP_OUTGOING_BANDWIDTH, 
+                    webappBWStatistic.getOutgoingBandwidth());
+            
+            //Assigning service requests and response
+            RequestStatistics requestStat = usage.getTotalRequestStatistics();
+            dataContext.addDataLong(ThrottlingDataEntryConstants.SERVICE_REQUEST_COUNT, 
+                    requestStat.getRequestCount());
+            dataContext.addDataLong(ThrottlingDataEntryConstants.SERVICE_RESPONSE_COUNT, 
+                    requestStat.getResponseCount());
+            
+            //Get number of users
+            int usersCount = usage.getNumberOfUsers();
+            dataContext.addDataInt(ThrottlingDataEntryConstants.USERS_COUNT, usersCount);
+
+        } catch (Exception e) {
+            String msg = "Error in retrieving Usage information. " + "tenant id: " + tenantId
+                    + ", user name: " + userName + ".";
+            log.error(msg, e);
+            throw new ThrottlingException(msg, e);
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/exception/ThrottlingException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/exception/ThrottlingException.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/exception/ThrottlingException.java
new file mode 100644
index 0000000..681a253
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/exception/ThrottlingException.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.exception;
+
+public class ThrottlingException extends Exception{
+    public ThrottlingException(String msg, Exception e) {
+        super(msg, e);
+    }
+    public ThrottlingException(String msg) {
+        super(msg);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/internal/ThrottlingManagerServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/internal/ThrottlingManagerServiceComponent.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/internal/ThrottlingManagerServiceComponent.java
new file mode 100644
index 0000000..231e63b
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/internal/ThrottlingManagerServiceComponent.java
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.internal;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.throttling.manager.utils.Util;
+import org.osgi.service.component.ComponentContext;
+import org.wso2.carbon.billing.core.BillingManager;
+import org.wso2.carbon.registry.core.service.RegistryService;
+import org.wso2.carbon.rule.kernel.config.RuleEngineConfigService;
+import org.wso2.carbon.user.core.service.RealmService;
+import org.wso2.carbon.billing.mgt.api.MultitenancyBillingInfo;
+import org.apache.stratos.usage.api.TenantUsageRetriever;
+
+/**
+ * @scr.component name="org.wso2.carbon.throttling.manager"
+ * 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="billingManager.service"
+ * interface="org.wso2.carbon.billing.core.BillingManager" cardinality="1..1"
+ * policy="dynamic" bind="setBillingManager" unbind="unsetBillingManager"
+ * @scr.reference name="rule.engine.config.server.component"
+ * interface="org.wso2.carbon.rule.kernel.config.RuleEngineConfigService"
+ * cardinality="1..1"
+ * policy="dynamic" bind="setRuleEngineConfigService"
+ * unbind="unsetRuleEngineConfigService"
+ * @scr.reference name="metering.service"
+ * interface="org.apache.stratos.usage.api.TenantUsageRetriever" cardinality="1..1"
+ * policy="dynamic" bind="setTenantUsageRetriever" unbind="unsetTenantUsageRetriever"
+ * @scr.reference name="org.wso2.carbon.billing.mgt.api.MultitenancyBillingInfo"
+ * interface="org.wso2.carbon.billing.mgt.api.MultitenancyBillingInfo" cardinality="1..1"
+ * policy="dynamic" bind="setMultitenancyBillingInfo" unbind="unsetMultitenancyBillingInfo"
+ */
+public class ThrottlingManagerServiceComponent {
+    private static Log log = LogFactory.getLog(ThrottlingManagerServiceComponent.class);
+
+    protected void activate(ComponentContext context) {
+        try {
+            Util.setBundleContext(context.getBundleContext());
+            Util.loadThrottlingRules();
+            Util.registerThrottlingRuleInvoker();
+            Util.initializeThrottling();
+            log.debug(" Multitenancy Throttling Manager bundle is activated ");
+        } catch (Throwable e) {
+            log.error(" Multitenancy Throttling Manager bundle failed activating ", e);
+        }
+    }
+
+    protected void deactivate(ComponentContext context) {
+        log.debug("******* Multitenancy Throttling Manager bundle 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 setBillingManager(BillingManager billingManager) {
+        log.debug("Receiving billingManager service");
+        Util.setBillingManager(billingManager);
+    }
+
+    protected void unsetBillingManager(BillingManager billingManager) {
+        log.debug("Halting billingManager service");
+        Util.setBillingManager(null);
+    }
+
+    protected void setRuleEngineConfigService(RuleEngineConfigService ruleEngineConfigService) {
+        Util.setRuleEngineConfigService(ruleEngineConfigService);
+    }
+
+    protected void unsetRuleEngineConfigService(RuleEngineConfigService ruleEngineConfigService) {
+        // we are not dynamically removing schedule helpers
+    }
+
+    protected void setTenantUsageRetriever(TenantUsageRetriever tenantUsageRetriever) {
+        log.debug("Setting Tenant Usage Retriever service");
+        Util.setTenantUsageRetriever(tenantUsageRetriever);
+    }
+
+    protected void unsetTenantUsageRetriever(TenantUsageRetriever tenantUsageRetriever) {
+        log.debug("Unsetting Tenant Usage Retriever service");
+        Util.setBillingManager(null);
+    }
+
+    protected void setMultitenancyBillingInfo(MultitenancyBillingInfo mtBillingInfo) {
+        log.debug("Setting MT billing info service");
+        Util.setMultitenancyBillingInfo(mtBillingInfo);
+    }
+
+    protected void unsetMultitenancyBillingInfo(MultitenancyBillingInfo mtBillingInfo) {
+        log.debug("Unsetting MT billing info service");
+        Util.setMultitenancyBillingInfo(null);
+    }
+}


[15/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/rules/KnowledgeBaseManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/rules/KnowledgeBaseManager.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/rules/KnowledgeBaseManager.java
new file mode 100644
index 0000000..930082b
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/rules/KnowledgeBaseManager.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.rules;
+
+import java.util.List;
+
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataContext;
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataEntry;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+import org.apache.stratos.throttling.manager.tasks.Task;
+import org.apache.stratos.throttling.manager.validation.ValidationInfoManager;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class KnowledgeBaseManager {
+    private static final Log log = LogFactory.getLog(KnowledgeBaseManager.class);
+
+    public static ThrottlingDataContext feedKnowledgeBase(int tenantId, Task task,
+            List<Object> knowledgeBase) throws ThrottlingException {
+        // initialize the throttling context
+        ThrottlingDataContext throttlingDataContext = new ThrottlingDataContext(tenantId);
+
+        // prepare data from data providers
+        try {
+            task.prepareData(throttlingDataContext);
+        } catch (ThrottlingException e) {
+            String msg = "Error in preparing throttling data for tenant: " + tenantId + ".";
+            log.error(msg, e);
+            throw new ThrottlingException(msg, e);
+        }
+
+        // add data entries with object types separately
+        for (ThrottlingDataEntry dataEntry : throttlingDataContext.getData()) {
+            if (dataEntry.getValueType() == 4) {
+                Object object = dataEntry.getObjectValue();
+                if (object != null) {
+                    knowledgeBase.add(object);
+                }
+            }
+        }
+        // load the access validation data
+        try {
+            ValidationInfoManager.loadValidationDetails(throttlingDataContext);
+        } catch (ThrottlingException e) {
+            String msg = "Error in loading validation details. tenant id: " + tenantId + ".";
+            log.error(msg, e);
+            throw new ThrottlingException(msg, e);
+        }
+
+        // add metering data context
+        knowledgeBase.add(throttlingDataContext);
+        // add access validation information
+        knowledgeBase.add(throttlingDataContext.getAccessValidation());
+
+        return throttlingDataContext;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/rules/RuleInvoker.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/rules/RuleInvoker.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/rules/RuleInvoker.java
new file mode 100644
index 0000000..c4a6218
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/rules/RuleInvoker.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.rules;
+
+import java.util.List;
+
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+import org.apache.stratos.throttling.manager.utils.Util;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.rule.common.Rule;
+import org.wso2.carbon.rule.common.RuleSet;
+import org.wso2.carbon.rule.common.util.Constants;
+import org.wso2.carbon.rule.kernel.backend.RuleBackendRuntime;
+import org.wso2.carbon.rule.kernel.backend.RuleBackendRuntimeFactory;
+import org.wso2.carbon.rule.kernel.backend.Session;
+import org.wso2.carbon.rule.kernel.config.RuleEngineProvider;
+import org.apache.stratos.common.constants.StratosConstants;
+
+public class RuleInvoker {
+    private static final Log log = LogFactory.getLog(RuleInvoker.class);
+    Session session;
+
+    public RuleInvoker() throws ThrottlingException {
+        updateRules();
+    }
+
+    public synchronized void invoke(List<Object> knowledgeBase) throws ThrottlingException {
+
+        try {
+            session.execute(knowledgeBase);
+        } catch (Exception e) {
+            String msg = "Error occurred while executing the throttling rules: " + e.getMessage();
+            log.error(msg);
+            throw new ThrottlingException(msg, e);
+        }
+    }
+
+    public synchronized void updateRules() throws ThrottlingException {
+        
+        RuleEngineProvider ruleEngineProvider = 
+                Util.getRuleEngineConfigService().getRuleConfig().getRuleEngineProvider();
+        
+        Class ruleBackendRuntimeFactoryClass;
+        RuleBackendRuntime ruleBackendRuntime;
+        
+        try{
+            ruleBackendRuntimeFactoryClass = Class.forName(ruleEngineProvider.getClassName());
+            RuleBackendRuntimeFactory ruleBackendRuntimeFactory = 
+                    (RuleBackendRuntimeFactory) ruleBackendRuntimeFactoryClass.newInstance();
+            ruleBackendRuntime = 
+                    ruleBackendRuntimeFactory.getRuleBackendRuntime(ruleEngineProvider.getProperties(), 
+                                                                    Thread.currentThread().getContextClassLoader());
+
+            // create a rule set to add
+            RuleSet ruleSet = new RuleSet();
+            Rule rule = new Rule();
+            rule.setResourceType(Constants.RULE_RESOURCE_TYPE_REGULAR);
+
+            rule.setSourceType(Constants.RULE_SOURCE_TYPE_REGISTRY);
+            rule.setValue("gov:" + StratosConstants.THROTTLING_RULES_PATH);
+            ruleSet.addRule(rule);
+
+            ruleBackendRuntime.addRuleSet(ruleSet);
+
+            this.session = ruleBackendRuntime.createSession(Constants.RULE_STATEFUL_SESSION);
+
+        }catch(Exception e){
+
+            String msg = "Error occurred while initializing the rule executing environment: " + e.getMessage();
+            log.error(msg);
+            throw new ThrottlingException(msg, e);
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/rules/RuleProperty.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/rules/RuleProperty.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/rules/RuleProperty.java
new file mode 100644
index 0000000..7fc45ce
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/rules/RuleProperty.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.rules;
+
+public class RuleProperty {
+    String key;
+    String value;
+    
+    public RuleProperty(String key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/scheduling/ThrottlingJob.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/scheduling/ThrottlingJob.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/scheduling/ThrottlingJob.java
new file mode 100644
index 0000000..d3e78cf
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/scheduling/ThrottlingJob.java
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.scheduling;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.throttling.manager.tasks.Task;
+import org.apache.stratos.throttling.manager.utils.Util;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataContext;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+import org.apache.stratos.throttling.manager.rules.KnowledgeBaseManager;
+import org.apache.stratos.throttling.manager.rules.RuleInvoker;
+import org.apache.stratos.throttling.manager.validation.ValidationInfoManager;
+import org.wso2.carbon.user.core.UserStoreException;
+import org.wso2.carbon.user.core.tenant.Tenant;
+import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ThrottlingJob implements Job {
+    private static final Log log = LogFactory.getLog(ThrottlingJob.class);
+    public static final String THROTTLING_TASK_CONTEXT_KEY = "throttlingTask";
+
+    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+        carbonContext.setTenantId(MultitenantConstants.SUPER_TENANT_ID);
+        Task task = (Task) jobExecutionContext.getMergedJobDataMap().get(THROTTLING_TASK_CONTEXT_KEY);
+        executeTask(task);
+    }
+
+    public void executeTask(Task task) throws JobExecutionException {
+        // initialize and prepare the knowledge base.
+        List<Object> knowledgeBase = new ArrayList<Object>();
+        Map<Integer, ThrottlingDataContext> contextMap;
+        try {
+            contextMap = feedKnowledgeBase(task, knowledgeBase);
+        } catch (ThrottlingException e) {
+            String msg = "Error in feeding knowledge base.";
+            log.error(msg, e);
+            throw new JobExecutionException(msg, e);
+        }
+
+        // invoke the rule.
+        RuleInvoker ruleInvoker = task.getRuleInvoker();
+        try {
+            //updating the rule. this is important if we are having more than one managers running
+            ruleInvoker.updateRules();
+            ruleInvoker.invoke(knowledgeBase);
+            log.info("Throttling rules executed successfully");
+        } catch (ThrottlingException e) {
+            String msg = "Error in invoking the throttling rule invoker.";
+            log.error(msg, e);
+            throw new JobExecutionException(msg, e);
+        }
+        // now persist the access validation information
+        for (int tenantId : contextMap.keySet()) {
+            ThrottlingDataContext dataContext = contextMap.get(tenantId);
+            try {
+                ValidationInfoManager.persistValidationDetails(dataContext);
+            } catch (ThrottlingException e) {
+                String msg = "Error in persisting validation details. Tenant id: " + tenantId + ".";
+                log.error(msg, e);
+                throw new JobExecutionException(msg, e);
+            }
+        }
+    }
+
+    private Map<Integer, ThrottlingDataContext> feedKnowledgeBase(Task task,
+            List<Object> knowledgeBase) throws ThrottlingException {
+        Map<Integer, ThrottlingDataContext> contextMap =
+                new HashMap<Integer, ThrottlingDataContext>();
+        // execute the task for each tenant
+        Tenant[] tenants;
+        try {
+            tenants = Util.getAllTenants();
+        } catch (UserStoreException e) {
+            String msg = "Error in getting all the tenants.";
+            log.error(msg, e);
+            throw new ThrottlingException(msg, e);
+        }
+        // prepare the knowledge base using data on each tenant
+
+        for (Tenant tenant : tenants) {
+            if (!tenant.isActive()) {
+                continue;
+            }
+            int tenantId = tenant.getId();
+
+            ThrottlingDataContext throttlingDataContext =
+                    KnowledgeBaseManager.feedKnowledgeBase(tenantId, task, knowledgeBase);
+
+            // store the context in the map.
+            contextMap.put(tenantId, throttlingDataContext);
+        }
+        return contextMap;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/services/MultitenancyThrottlingService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/services/MultitenancyThrottlingService.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/services/MultitenancyThrottlingService.java
new file mode 100644
index 0000000..577dca0
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/services/MultitenancyThrottlingService.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.services;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.throttling.manager.utils.Util;
+import org.wso2.carbon.core.AbstractAdmin;
+import org.apache.stratos.throttling.agent.client.ThrottlingRuleInvoker;
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataContext;
+import org.apache.stratos.throttling.manager.rules.KnowledgeBaseManager;
+import org.apache.stratos.throttling.manager.rules.RuleInvoker;
+import org.apache.stratos.throttling.manager.tasks.Task;
+import org.apache.stratos.throttling.manager.validation.ValidationInfoManager;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MultitenancyThrottlingService extends AbstractAdmin implements ThrottlingRuleInvoker {
+    
+    private static Log log = LogFactory.getLog(MultitenancyThrottlingService.class);
+
+    public void executeThrottlingRules(int tenantId) throws Exception {
+
+        //UserRegistry registry = (UserRegistry) getGovernanceUserRegistry();
+        int currentTenantId = tenantId;
+        
+        List<Task> tasks = Util.getTasks();
+        for (Task task: tasks) {
+            // initialize the knowledge base
+            List<Object> knowledgeBase = new ArrayList<Object>();
+            ThrottlingDataContext throttlingDataContext =
+                    KnowledgeBaseManager.feedKnowledgeBase(currentTenantId, task, knowledgeBase);
+
+            RuleInvoker ruleInvoker = task.getRuleInvoker();
+            ruleInvoker.invoke(knowledgeBase);
+
+            log.info("Throttling rules executed for tenant id: " + currentTenantId);
+            
+            ValidationInfoManager.persistValidationDetails(throttlingDataContext);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/services/ThrottlingRuleEditorService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/services/ThrottlingRuleEditorService.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/services/ThrottlingRuleEditorService.java
new file mode 100644
index 0000000..4a2ec6e
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/services/ThrottlingRuleEditorService.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.services;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.throttling.manager.tasks.Task;
+import org.apache.stratos.throttling.manager.utils.Util;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.apache.stratos.throttling.manager.rules.RuleInvoker;
+
+import java.util.List;
+
+/**
+ * This is a super tenant service to manage throttling rules
+ */
+public class ThrottlingRuleEditorService {
+    private static final Log log = LogFactory.getLog(ThrottlingRuleEditorService.class);
+
+    /**
+     * Retrieve Throttling Rules
+     *
+     * @throws Exception, if retrieving the throttling rules failed.
+     * @return, rule content
+     */
+    public String retrieveThrottlingRules() throws Exception {
+        // getting the resource content.
+        UserRegistry systemRegistry = Util.getSuperTenantGovernanceSystemRegistry();
+        Resource ruleContentResource = systemRegistry.get(StratosConstants.THROTTLING_RULES_PATH);
+        Object ruleContent = ruleContentResource.getContent();
+        if (ruleContent instanceof String) {
+            return (String) ruleContent;
+        } else if (ruleContent instanceof byte[]) {
+            return new String((byte[]) ruleContent);
+        }
+        String msg = "Unidentified type for the registry resource content. type: " +
+                     ruleContent.getClass().getName();
+        log.error(msg);
+        throw new Exception(msg);
+    }
+
+    /**
+     * Update throttling rules.
+     *
+     * @param ruleContent - content of the rule.
+     * @throws Exception, if updating the throttling rules failed.
+     */
+    public void updateThrottlingRules(String ruleContent) throws Exception {
+        // updating the rule content
+        boolean updateSuccess = false;
+        UserRegistry systemRegistry = Util.getSuperTenantGovernanceSystemRegistry();
+        try {
+            systemRegistry.beginTransaction();
+            Resource ruleContentResource = systemRegistry.get(StratosConstants.THROTTLING_RULES_PATH);
+            ruleContentResource.setContent(ruleContent);
+            systemRegistry.put(StratosConstants.THROTTLING_RULES_PATH, ruleContentResource);
+
+            List<Task> tasks = Util.getTasks();
+            for (Task task : tasks) {
+                RuleInvoker ruleInvoker = task.getRuleInvoker();
+                ruleInvoker.updateRules();
+            }
+            updateSuccess = true;
+        } finally {
+            if (updateSuccess) {
+                systemRegistry.commitTransaction();
+            } else {
+                systemRegistry.rollbackTransaction();
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/tasks/Task.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/tasks/Task.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/tasks/Task.java
new file mode 100644
index 0000000..1915eab
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/tasks/Task.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.tasks;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.stratos.throttling.manager.conf.ThrottlingTaskConfiguration;
+import org.apache.stratos.throttling.manager.dataproviders.DataProvider;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.throttling.manager.conf.ThrottlingTaskDataProviderConfiguration;
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataContext;
+import org.apache.stratos.throttling.manager.rules.RuleInvoker;
+import org.apache.stratos.throttling.manager.utils.DataProviderIterator;
+
+public class Task {
+    private static final Log log = LogFactory.getLog(Task.class);
+    private static final int DEFAULT_INTERVAL = 15; // in minute
+    Map<String, String> parameters;
+    DataProviderIterator dataProviderIterator;
+    RuleInvoker ruleInvoker;
+
+    public Task(Map<String, String> parameters,
+            List<ThrottlingTaskDataProviderConfiguration> dataProviderConfigs)
+            throws ThrottlingException {
+        this.parameters = parameters;
+        this.dataProviderIterator = new DataProviderIterator(dataProviderConfigs);
+        // initialize the rule invokers
+        ruleInvoker = new RuleInvoker();
+    }
+
+    public void prepareData(ThrottlingDataContext dataContext) throws ThrottlingException {
+        dataProviderIterator.reset();
+        while (dataProviderIterator.hasNext()) {
+            final DataProvider dataProvider = (DataProvider) dataProviderIterator.next();
+            if (dataProvider == null) {
+                String msg =
+                        "Error in invoking the data provider. " + "dataProviderConfigs is null or "
+                                + "data provider is not yet loaded";
+                log.error(msg);
+                throw new ThrottlingException(msg);
+            }
+            dataProvider.invoke(dataContext);
+            if (dataContext.isProcessingComplete()) {
+                break;
+            }
+        }
+    }
+
+    public Map<String, String> getParameters() {
+        return parameters;
+    }
+
+    public int getTriggerInterval() {
+        if (this.parameters == null ||
+                this.parameters.get(ThrottlingTaskConfiguration.INTERVAL_PARAM_KEY) == null) {
+            return DEFAULT_INTERVAL * 60 * 1000;
+        }
+        return Integer.parseInt(
+                this.parameters.get(ThrottlingTaskConfiguration.INTERVAL_PARAM_KEY)) * 60 * 1000;
+    }
+    
+    public int getStartDelayInterval(){
+        if (this.parameters == null || 
+                this.parameters.get(ThrottlingTaskConfiguration.DELAY_PARAM_KEY) == null){
+            return DEFAULT_INTERVAL * 60 * 1000;
+        }
+        
+        return Integer.parseInt(
+                this.parameters.get(ThrottlingTaskConfiguration.DELAY_PARAM_KEY)) * 60 * 1000;
+    }
+
+    public RuleInvoker getRuleInvoker() {
+        return ruleInvoker;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/utils/DataProviderIterator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/utils/DataProviderIterator.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/utils/DataProviderIterator.java
new file mode 100644
index 0000000..5bd1e02
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/utils/DataProviderIterator.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.utils;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.stratos.throttling.manager.conf.ThrottlingTaskDataProviderConfiguration;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+// we are dynamically initializing handlers, so uses an iterator to iteration
+public class DataProviderIterator implements Iterator {
+    private static final Log log = LogFactory.getLog(DataProviderIterator.class);
+    private ThreadLocal<Integer> index = new ThreadLocal<Integer>() {
+        protected Integer initialValue() {
+            return 0;
+        }
+    };
+    
+    List<ThrottlingTaskDataProviderConfiguration> dataProviderConfigs;
+    
+    public DataProviderIterator(List<ThrottlingTaskDataProviderConfiguration> dataProviderConfigs) {
+        this.dataProviderConfigs = dataProviderConfigs;
+        reset();
+    }
+
+    public boolean hasNext() {
+        int i = index.get();
+        return (i < dataProviderConfigs.size());
+    }
+
+    public Object next() {
+        int i = index.get();
+        ThrottlingTaskDataProviderConfiguration handlerConfig = dataProviderConfigs.get(i++);
+        index.set(i);
+        try {
+            return handlerConfig.getDataProvider();
+        } catch (ThrottlingException e) {
+            String msg = "DataProvider for the dataProviderConfigs config is null. " +
+            		"dataProviderConfigs index: " + (i - 1) + ".";
+            log.error(msg);                        
+        }
+        return null;
+    }
+
+    public void remove() {
+        // doesn't need to be remove
+    }
+
+    // additional method
+    public void reset() {
+        index.set(0);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/utils/Util.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/utils/Util.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/utils/Util.java
new file mode 100644
index 0000000..c6e5c70
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/utils/Util.java
@@ -0,0 +1,464 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.utils;
+
+import org.apache.stratos.throttling.manager.dataproviders.DataProvider;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+import org.apache.stratos.throttling.manager.scheduling.ThrottlingJob;
+import org.apache.stratos.throttling.manager.services.MultitenancyThrottlingService;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.task.TaskDescription;
+import org.apache.synapse.task.TaskScheduler;
+import org.apache.synapse.task.TaskSchedulerFactory;
+import org.osgi.framework.BundleContext;
+import org.wso2.carbon.billing.core.BillingEngine;
+import org.wso2.carbon.billing.core.BillingException;
+import org.wso2.carbon.billing.core.BillingManager;
+import org.wso2.carbon.billing.core.dataobjects.Customer;
+import org.wso2.carbon.billing.core.dataobjects.Item;
+import org.wso2.carbon.billing.core.dataobjects.Subscription;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.registry.core.service.RegistryService;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+import org.wso2.carbon.registry.core.utils.UUIDGenerator;
+import org.wso2.carbon.rule.kernel.config.RuleEngineConfigService;
+import org.wso2.carbon.user.core.UserStoreException;
+import org.wso2.carbon.user.core.service.RealmService;
+import org.wso2.carbon.user.core.tenant.Tenant;
+import org.wso2.carbon.user.core.tenant.TenantManager;
+import org.wso2.carbon.utils.CarbonUtils;
+import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
+import org.wso2.carbon.billing.mgt.api.MultitenancyBillingInfo;
+import org.wso2.carbon.billing.mgt.dataobjects.MultitenancyPackage;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.apache.stratos.throttling.agent.client.ThrottlingRuleInvoker;
+import org.apache.stratos.throttling.manager.conf.ThrottlingConfiguration;
+import org.apache.stratos.throttling.manager.tasks.Task;
+import org.apache.stratos.usage.api.TenantUsageRetriever;
+
+import java.io.File;
+import java.lang.reflect.Constructor;
+import java.text.DateFormatSymbols;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * Util methods for throttling manager.
+ */
+public class Util {
+    private static final Log log = LogFactory.getLog(Util.class);
+    private static RegistryService registryService;
+    private static RealmService realmService;
+    private static RuleEngineConfigService ruleEngineConfigService;
+    private static BillingManager billingManager;
+    private static BundleContext bundleContext;
+    private static TenantUsageRetriever tenantUsageRetriever;
+    private static MultitenancyBillingInfo mtBillingInfo;
+    private static final String THROTTLING_CONFIG = "usage-throttling-agent-config.xml";
+    private static final String THROTTLING_TASK_ID = "throttling-task";
+    private static ThrottlingConfiguration throttlingConfiguration;
+    private static final String THROTTLING_RULE_FILE = "throttling-rules.drl";
+
+    public static synchronized void setRegistryService(RegistryService service) {
+        if (registryService == null) {
+            registryService = service;
+        }
+    }
+
+    public static RegistryService getRegistryService() {
+        return registryService;
+    }
+
+    public static synchronized void setRealmService(RealmService service) {
+        if (realmService == null) {
+            realmService = service;
+        }
+    }
+
+    public static synchronized void setBundleContext(BundleContext context) {
+        if (bundleContext == null) {
+            bundleContext = context;
+        }
+    }
+
+    public static void setTenantUsageRetriever(TenantUsageRetriever tenantUsageRetriever) {
+        Util.tenantUsageRetriever = tenantUsageRetriever;
+    }
+
+    public static RealmService getRealmService() {
+        return realmService;
+    }
+
+    public static UserRegistry getSuperTenantGovernanceSystemRegistry() throws RegistryException {
+        return registryService.getGovernanceSystemRegistry();
+    }
+
+    public static TenantUsageRetriever getTenantUsageRetriever() {
+        return tenantUsageRetriever;
+    }
+
+    public static void setRuleEngineConfigService(
+            RuleEngineConfigService ruleEngineConfigService) {
+        Util.ruleEngineConfigService = ruleEngineConfigService;
+    }
+
+    public static RuleEngineConfigService getRuleEngineConfigService() {
+        return Util.ruleEngineConfigService;
+    }
+
+    public static BillingManager getBillingManager() {
+        return billingManager;
+    }
+
+    public static void setBillingManager(BillingManager billingManager) {
+        Util.billingManager = billingManager;
+    }
+
+    /**
+     * get current billing customer.
+     *
+     * @param tenantId, tenant id.
+     * @return Customer
+     * @throws RegistryException, if getting the current billing customer failed.
+     */
+    public static Customer getCurrentBillingCustomer(int tenantId) throws RegistryException {
+        // get the host name of the current domain
+        if (tenantId == MultitenantConstants.SUPER_TENANT_ID) {
+            return null;
+        }
+        Tenant tenant;
+        try {
+            tenant = (Tenant) realmService.getTenantManager().getTenant(tenantId);
+        } catch (org.wso2.carbon.user.api.UserStoreException e) {
+            String msg = "Error in getting the realm Information.";
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+        if (tenant == null) {
+            return null;
+        }
+        String customerName = tenant.getDomain();
+        BillingEngine billingEngine =
+                billingManager.getBillingEngine(StratosConstants.MULTITENANCY_VIEWING_TASK_ID);
+        Customer customer;
+        try {
+            if (billingEngine != null) {
+                List<Customer> customers = billingEngine.getCustomersWithName(customerName);
+                if (customers == null || customers.size() == 0) {
+                    customer = null;
+                } else {
+                    customer = customers.get(0);
+                }
+            } else {
+                customer=null;
+                String msg = "Error in getting billing Engine";
+                log.error(msg);
+            }
+        } catch (BillingException e) {
+            String msg = "Error in getting the current customer";
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+        return customer;
+    }
+
+    /**
+     * get current subscription type for the tenant.
+     *
+     * @param tenantId, tenant id
+     * @throws RegistryException, if getting the current subscription type failed.
+     * @return, Subscripiton
+     */
+    public static Subscription getCurrentSubscription(int tenantId) throws RegistryException {
+        BillingEngine billingEngine =
+                billingManager.getBillingEngine(StratosConstants.MULTITENANCY_SCHEDULED_TASK_ID);
+
+        Customer customer = getCurrentBillingCustomer(tenantId);
+        if (customer == null) {
+            return null;
+        }
+        List<Subscription> subscriptions;
+        try {
+            subscriptions = billingEngine.getActiveSubscriptions(customer);
+        } catch (BillingException e) {
+            String msg = "Error in getting the current subscription.";
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+        if (subscriptions == null || subscriptions.size() == 0) {
+            return null;
+        }
+        Subscription subscription = subscriptions.get(0);
+        if (subscription.getActiveUntil().getTime() <= System.currentTimeMillis()) {
+            return null;
+        }
+        int itemId = subscription.getItem().getId();
+        // fill with a correct item
+        Item item;
+        try {
+            item = billingEngine.getItem(itemId);
+        } catch (BillingException e) {
+            String msg = "Error in getting the item for item id: " + itemId + ".";
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+        subscription.setItem(item);
+        return subscription;
+    }
+
+    /**
+     * get current billing package.
+     *
+     * @param tenantId, tenant id.
+     * @return MultitenancyPackage
+     * @throws RegistryException, if getting the current billing package failed.
+     */
+    public static MultitenancyPackage getCurrentBillingPackage(int tenantId)
+            throws RegistryException {
+        if (mtBillingInfo == null) {
+            String msg =
+                    "Error in retrieving the current billing package. The package info is null.";
+            log.error(msg);
+            throw new RegistryException(msg);
+        }
+        List<MultitenancyPackage> multitenancyPackages = mtBillingInfo.getMultitenancyPackages();
+        Subscription subscription = getCurrentSubscription(tenantId);
+        Item currentPackage;
+        if (subscription == null) {
+            currentPackage = null;
+        } else {
+            currentPackage = subscription.getItem();
+        }
+        MultitenancyPackage currentMultitenancyPackage = null;
+        for (MultitenancyPackage multitenancyPackage : multitenancyPackages) {
+            if (multitenancyPackage.getName().toLowerCase().contains("free") &&
+                    currentPackage == null) {
+                currentMultitenancyPackage = multitenancyPackage;
+                break;
+            } else if (currentPackage != null &&
+                    multitenancyPackage.getName().equals(currentPackage.getName())) {
+                currentMultitenancyPackage = multitenancyPackage;
+                break;
+            }
+        }
+        return currentMultitenancyPackage;
+    }
+
+    /**
+     * get maximum users allowed for a tenant.
+     *
+     * @param tenantId, tenant id
+     * @throws RegistryException, if getting the maximum number of users failed.
+     * @return, maximum number of users allowed.
+     */
+    public static int getMaximumUsersAllow(int tenantId) throws RegistryException {
+        MultitenancyPackage multitenancyPackage = getCurrentBillingPackage(tenantId);
+        if (multitenancyPackage == null) {
+            String msg = "The multitenancy package is null.";
+            log.error(msg);
+            throw new RegistryException(msg);
+        }
+        return multitenancyPackage.getUsersLimit();
+    }
+
+    /**
+     * returns the maximum resource volume in bytes
+     *
+     * @param tenantId, tenant id
+     * @return Resource volume limit.
+     * @throws RegistryException, if getting the maximum resource limit failed.
+     */
+    public static long getMaximumResourceVolume(int tenantId) throws RegistryException {
+        MultitenancyPackage multitenancyPackage = getCurrentBillingPackage(tenantId);
+        if (multitenancyPackage == null) {
+            String msg = "The multitenancy package is null.";
+            log.error(msg);
+            throw new RegistryException(msg);
+        }
+        // converting the mb to bytes
+        return ((long) multitenancyPackage.getResourceVolumeLimit()) * 1024 * 1024;
+    }
+
+    /**
+     * get the current month
+     *
+     * @param calendar, Calendar
+     * @return, year-month
+     */
+    public static String getCurrentMonthString(Calendar calendar) {
+        int currentMonth = calendar.get(Calendar.MONTH);
+
+        String[] monthArr = new DateFormatSymbols().getMonths();
+        String month = monthArr[currentMonth];
+        return calendar.get(Calendar.YEAR) + "-" + month;
+    }
+
+    public static void registerTaskOSGIService(Task task) {
+        if (bundleContext != null) {
+            bundleContext.registerService(Task.class.getName(), task, null);
+        }
+    }
+
+    public static void registerHandlerOSGIService(DataProvider handler) {
+        if (bundleContext != null) {
+            bundleContext.registerService(DataProvider.class.getName(), handler, null);
+        }
+    }
+
+    public static void setMultitenancyBillingInfo(MultitenancyBillingInfo mtBillingInfo) {
+        Util.mtBillingInfo = mtBillingInfo;
+    }
+
+    /**
+     * Construct the object for the given class
+     *
+     * @param className - name of the class
+     * @return the constructed object.
+     * @throws org.apache.stratos.throttling.manager.exception.ThrottlingException, if constructing the object failed.
+     */
+    public static Object constructObject(String className) throws ThrottlingException {
+        Class cl;
+        Constructor co;
+        Object obj;
+        try {
+            cl = Class.forName(className);
+        } catch (ClassNotFoundException e) {
+            String msg = "The class: " + className + " is not in the classpath.";
+            log.error(msg, e);
+            throw new ThrottlingException(msg, e);
+        }
+
+        try {
+            co = cl.getConstructor();
+        } catch (NoSuchMethodException e) {
+            String msg = "The default constructor for the  is not available for " + className + ".";
+            log.error(msg, e);
+            throw new ThrottlingException(msg, e);
+        }
+        try {
+            obj = co.newInstance();
+        } catch (Exception e) {
+            String msg = "Error in initializing the object for " + className + ".";
+            log.error(msg);
+            throw new ThrottlingException(msg, e);
+        }
+        return obj;
+    }
+
+    public static void registerThrottlingRuleInvoker() {
+        // construct an instance of throttling service as the rule invoker.
+        bundleContext.registerService(ThrottlingRuleInvoker.class.getName(),
+                new MultitenancyThrottlingService(), null);
+    }
+
+    /**
+     * Initialize throttling
+     *
+     * @throws ThrottlingException, if initializing failed.
+     */
+    public static void initializeThrottling() throws ThrottlingException {
+
+        // load the configuration and initialize the billing engine + do the
+        // necessary scheduling.
+        String configFile = CarbonUtils.getCarbonConfigDirPath() + File.separator +
+                StratosConstants.MULTITENANCY_CONFIG_FOLDER + File.separator + THROTTLING_CONFIG;
+        // the configuration init will initialize task objects.
+        throttlingConfiguration = new ThrottlingConfiguration(configFile);
+        List<Task> throttlingTasks = throttlingConfiguration.getThrottlingTasks();
+
+        // now initialize the scheduling per each task
+        for (Task throttlingTask : throttlingTasks) {
+            initializeScheduling(throttlingTask);
+        }
+    }
+
+    private static void initializeScheduling(Task throttlingTask) {
+        // generate tasks
+        if (throttlingTask.getTriggerInterval() < 0) {
+            log.info("Throttling manager Validation info service Disabled");
+        } else {
+            String taskName = UUIDGenerator.generateUUID();
+            String groupId = UUIDGenerator.generateUUID();
+
+            TaskDescription taskDescription = new TaskDescription();
+            taskDescription.setName(taskName);
+            taskDescription.setGroup(groupId);
+            // we are triggering only at the period
+
+            taskDescription.setInterval(throttlingTask.getTriggerInterval());
+
+            //Delay first run by given minutes
+            Calendar startTime = Calendar.getInstance();
+            startTime.add(Calendar.MILLISECOND, throttlingTask.getStartDelayInterval());
+            taskDescription.setStartTime(startTime.getTime());
+
+            Map<String, Object> resources = new HashMap<String, Object>();
+            resources.put(ThrottlingJob.THROTTLING_TASK_CONTEXT_KEY, throttlingTask);
+
+            TaskScheduler taskScheduler = TaskSchedulerFactory.getTaskScheduler(THROTTLING_TASK_ID);
+            if (!taskScheduler.isInitialized()) {
+                Properties properties = new Properties();
+                taskScheduler.init(properties);
+            }
+            taskScheduler.scheduleTask(taskDescription, resources, ThrottlingJob.class);
+        }
+    }
+
+    /**
+     * get all the tenants
+     *
+     * @return Tenant[]
+     * @throws UserStoreException, if getting the tenants failed.
+     */
+    public static Tenant[] getAllTenants() throws UserStoreException {
+        TenantManager tenantManager = realmService.getTenantManager();
+        try {
+            return (Tenant[]) tenantManager.getAllTenants();
+        } catch (org.wso2.carbon.user.api.UserStoreException e) {
+            throw new UserStoreException(e);
+        }
+    }
+
+    public static List<Task> getTasks() {
+        return throttlingConfiguration.getThrottlingTasks();
+    }
+
+    /**
+     * Load throttling rules
+     *
+     * @throws Exception, if loading the throttling rules failed.
+     */
+    public static void loadThrottlingRules() throws Exception {
+        UserRegistry systemRegistry = getSuperTenantGovernanceSystemRegistry();
+        if (systemRegistry.resourceExists(StratosConstants.THROTTLING_RULES_PATH)) {
+            return;
+        }
+        String throttlingRuleFile = CarbonUtils.getCarbonConfigDirPath() +
+                File.separator + THROTTLING_RULE_FILE;
+        byte[] content = CarbonUtils.getBytesFromFile(new File(throttlingRuleFile));
+        Resource ruleResource = systemRegistry.newResource();
+        ruleResource.setContent(content);
+        systemRegistry.put(StratosConstants.THROTTLING_RULES_PATH, ruleResource);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/validation/ValidationInfoManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/validation/ValidationInfoManager.java b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/validation/ValidationInfoManager.java
new file mode 100644
index 0000000..850468d
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/java/org/apache/stratos/throttling/manager/validation/ValidationInfoManager.java
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.manager.validation;
+
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingAccessValidation;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+import org.apache.stratos.throttling.manager.utils.Util;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.registry.core.Registry;
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.apache.stratos.common.util.MeteringAccessValidationUtils;
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataContext;
+
+public class ValidationInfoManager {
+    private static final Log log = LogFactory.getLog(ValidationInfoManager.class);
+
+    public static void loadValidationDetails(ThrottlingDataContext throttlingDataContext)
+            throws ThrottlingException {
+        int tenantId = throttlingDataContext.getTenantId();
+        // retrieve validation info for the tenant
+        String tenantValidationInfoResourcePath =
+                StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
+                        RegistryConstants.PATH_SEPARATOR + tenantId;
+
+        ThrottlingAccessValidation accessValidation = throttlingDataContext.getAccessValidation();
+        if (accessValidation == null) {
+            accessValidation = new ThrottlingAccessValidation();
+            throttlingDataContext.setAccessValidation(accessValidation);
+        }
+        try {
+            Registry governanceSystemRegistry = Util.getSuperTenantGovernanceSystemRegistry();
+            if (governanceSystemRegistry.resourceExists(tenantValidationInfoResourcePath)) {
+                Resource tenantValidationInfoResource =
+                        governanceSystemRegistry.get(tenantValidationInfoResourcePath);
+                Properties properties = tenantValidationInfoResource.getProperties();
+                Set<String> actions = MeteringAccessValidationUtils.getAvailableActions(properties);
+
+                for (String action : actions) {
+                    String blockActionStr =
+                            tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
+                                    .generateIsBlockedPropertyKey(action));
+
+                    String blockActionMsg =
+                            tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
+                                    .generateErrorMsgPropertyKey(action));
+                    accessValidation.setTenantBlocked(action, "true".equals(blockActionStr),
+                            blockActionMsg);
+
+                }
+            }
+        } catch (RegistryException e) {
+            String msg =
+                    "Error in getting the tenant validation info.  tenant id: " + tenantId + ".";
+            log.error(msg, e);
+            throw new ThrottlingException(msg, e);
+        }
+    }
+
+    public static void persistValidationDetails(ThrottlingDataContext throttlingDataContext)
+            throws ThrottlingException {
+        int tenantId = throttlingDataContext.getTenantId();
+        // retrieve validation info for the tenant
+        String tenantValidationInfoResourcePath =
+                StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
+                        RegistryConstants.PATH_SEPARATOR + tenantId;
+
+        ThrottlingAccessValidation accessValidation = throttlingDataContext.getAccessValidation();
+        try {
+            Registry governanceSystemRegistry = Util.getSuperTenantGovernanceSystemRegistry();
+
+            Resource tenantValidationInfoResource;
+            if (governanceSystemRegistry.resourceExists(tenantValidationInfoResourcePath)) {
+                tenantValidationInfoResource =
+                        governanceSystemRegistry.get(tenantValidationInfoResourcePath);
+            } else {
+                tenantValidationInfoResource = governanceSystemRegistry.newResource();
+            }
+
+            Set<String> actions = accessValidation.getActions();
+            for (String action : actions) {
+                boolean blockAction = accessValidation.isTenantBlocked(action);
+                String blockActionMsg = accessValidation.getTenantBlockedMsg(action);
+
+                tenantValidationInfoResource.setProperty(MeteringAccessValidationUtils
+                        .generateIsBlockedPropertyKey(action), blockAction ? "true" : "false");
+
+                tenantValidationInfoResource.setProperty(MeteringAccessValidationUtils
+                        .generateErrorMsgPropertyKey(action), blockActionMsg);
+            }
+            governanceSystemRegistry.put(tenantValidationInfoResourcePath,
+                    tenantValidationInfoResource);
+        } catch (RegistryException e) {
+            String msg =
+                    "Error in storing the tenant validation info.  tenant id: " + tenantId + ".";
+            log.error(msg, e);
+            throw new ThrottlingException(msg, e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/resources/META-INF/component.xml b/components/org.apache.stratos.throttling.manager/src/main/resources/META-INF/component.xml
new file mode 100644
index 0000000..cd8be13
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/resources/META-INF/component.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<component xmlns="http://products.wso2.org/carbon">
+    <ManagementPermissions>
+        <ManagementPermission>
+            <DisplayName>Configure</DisplayName>
+            <ResourceId>/permission/protected/configure</ResourceId>
+        </ManagementPermission>
+        <ManagementPermission>
+            <DisplayName>Throttling-Rules</DisplayName>
+            <ResourceId>/permission/protected/configure/throttling-rules</ResourceId>
+        </ManagementPermission>
+        <ManagementPermission>
+            <DisplayName>Manage</DisplayName>
+            <ResourceId>/permission/protected/manage</ResourceId>
+        </ManagementPermission>
+        <ManagementPermission>
+            <DisplayName>Throttling</DisplayName>
+            <ResourceId>/permission/protected/manage/throttling</ResourceId>
+        </ManagementPermission>
+    </ManagementPermissions>
+</component>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/main/resources/META-INF/services.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/main/resources/META-INF/services.xml b/components/org.apache.stratos.throttling.manager/src/main/resources/META-INF/services.xml
new file mode 100644
index 0000000..a153ef3
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/main/resources/META-INF/services.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<serviceGroup>
+
+	<service name="MultitenancyThrottlingService" scope="transportsession">
+		<transports>
+			<transport>https</transport>
+		</transports>
+		<parameter name="ServiceClass" locked="false">
+            org.apache.stratos.throttling.manager.services.MultitenancyThrottlingService
+        </parameter>
+		<parameter name="adminService" locked="true">true</parameter>
+		<parameter name="AuthorizationAction" locked="true">/permission/protected/manage/throttling
+		</parameter>
+
+        <operation name="executeThrottlingRules">
+            <parameter name="superTenantService" locked="true">true</parameter>
+        </operation>
+	</service>
+
+	<service name="ThrottlingRuleEditorService" scope="transportsession">
+		<transports>
+			<transport>https</transport>
+		</transports>
+		<parameter name="ServiceClass" locked="false">
+            org.apache.stratos.throttling.manager.services.ThrottlingRuleEditorService
+        </parameter>
+		<parameter name="adminService" locked="true">true</parameter>
+		<parameter name="AuthorizationAction" locked="true">/permission/protected/configure/throttling-rules
+		</parameter>
+
+        <operation name="retrieveThrottlingRules">
+            <parameter name="superTenantService" locked="true">true</parameter>
+        </operation>
+
+        <operation name="updateThrottlingRules">
+            <parameter name="superTenantService" locked="true">true</parameter>
+        </operation>
+	</service>
+	
+	<parameter name="hiddenService" locked="true">true</parameter>
+</serviceGroup>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/java/org/apache/carbon/throttling/test/ThrottlingTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/java/org/apache/carbon/throttling/test/ThrottlingTest.java b/components/org.apache.stratos.throttling.manager/src/test/java/org/apache/carbon/throttling/test/ThrottlingTest.java
new file mode 100644
index 0000000..396fb42
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/java/org/apache/carbon/throttling/test/ThrottlingTest.java
@@ -0,0 +1,228 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.carbon.throttling.test;
+
+import org.apache.stratos.throttling.manager.scheduling.ThrottlingJob;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.user.core.tenant.Tenant;
+import org.wso2.carbon.utils.CarbonUtils;
+import org.apache.stratos.throttling.manager.tasks.Task;
+import org.apache.carbon.throttling.test.utils.BaseTestCase;
+
+public class ThrottlingTest extends BaseTestCase {
+    public void testLimitResourceSizeRules() throws Exception {
+        Tenant tenant = new Tenant();
+        tenant.setAdminName("admin");
+        tenant.setDomain("abc1.com");
+        tenant.setAdminPassword("admin");
+        tenant.setEmail("admin@abc1.com");
+        tenant.setActive(true);
+
+        int tenantId = realmService.getTenantManager().addTenant(tenant);
+        realmService.getTenantManager().activateTenant(tenantId);
+        registry = registryService.getGovernanceUserRegistry("admin", tenantId);
+
+        String configFile = CarbonUtils.getCarbonConfigDirPath() + "/throttling-config1.xml";
+        String ruleFile = CarbonUtils.getCarbonConfigDirPath() + "/throttling-rules1.drl";
+        // the configuration init will initialize task objects.
+        //ThrottlingConfiguration ignore = new ThrottlingConfiguration(configFile);
+        Task task = getThrottlingTask(configFile, ruleFile);
+
+        Resource r1 = registry.newResource();
+        r1.setContent("12345678");   // 8 byte is ok
+        registry.put("/bang", r1);
+
+        new ThrottlingJob().executeTask(task);
+
+        try {
+            putEmptyResource();
+            assertTrue(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            assertTrue(false);
+        }
+
+        r1.setContent("123456789");   // 9 byte is not ok
+        registry.put("/bang", r1);
+
+        new ThrottlingJob().executeTask(task);
+        try {
+            putEmptyResource();
+            assertTrue(false); // we expect the exception
+        } catch (Exception e) {
+            assertTrue(true);
+            assertEquals("Your data is big. Bigger than 8", e.getMessage());
+        }
+
+        registry.delete("/bang");
+        new ThrottlingJob().executeTask(task);
+
+        r1.setContent("1234567891011");   // > 10 byte is not ok
+        registry.put("/bang", r1);
+        new ThrottlingJob().executeTask(task);
+        try {
+            putEmptyResource();
+            assertTrue(true);
+        } catch (Exception e) {
+            assertTrue(false);
+            e.printStackTrace();
+        }
+        registry.delete("/bang");
+        new ThrottlingJob().executeTask(task);
+
+        r1.setContent("1234567890123456");
+        registry.put("/bang", r1);
+        new ThrottlingJob().executeTask(task);
+        try {
+            putEmptyResource();
+            assertTrue(false); // we expect the exception
+        } catch (Exception e) {
+            assertTrue(true);
+            assertEquals("the strange condition for test1 is met", e.getMessage());
+        }
+        registry.delete("/bang");
+        new ThrottlingJob().executeTask(task);
+
+        r1.setContent("12345678901234567");
+        registry.put("/bang", r1);
+        new ThrottlingJob().executeTask(task);
+        try {
+            putEmptyResource();
+            assertTrue(false); // we expect the exception
+        } catch (Exception e) {
+            assertTrue(true);
+            assertEquals("the strange condition for test2 is met", e.getMessage());
+        }
+    }
+
+    public void testBandwidthRules() throws Exception {
+
+        Tenant tenant = new Tenant();
+        tenant.setAdminName("admin");
+        tenant.setDomain("abc2.com");
+        tenant.setAdminPassword("admin");
+        tenant.setEmail("admin@abc2.com");
+        tenant.setActive(true);
+
+        int tenantId = realmService.getTenantManager().addTenant(tenant);
+        realmService.getTenantManager().activateTenant(tenantId);
+        registry = registryService.getGovernanceUserRegistry("admin", tenantId);
+
+        String configFile = CarbonUtils.getCarbonConfigDirPath() + "/throttling-config2.xml";
+        String ruleFile = CarbonUtils.getCarbonConfigDirPath() + "/throttling-rules2.drl";
+        // the configuration init will initialize task objects.
+        //ThrottlingConfiguration ignore = new ThrottlingConfiguration(configFile);
+        Task task = getThrottlingTask(configFile, ruleFile);
+
+        Resource r1 = registry.newResource();
+        r1.setContent("12345678");   // 8 byte in
+        registry.put("/bang", r1);
+        new ThrottlingJob().executeTask(task);
+        try {
+            putEmptyResource();
+            assertTrue(true);
+        } catch (Exception e) {
+            assertTrue(false);
+            e.printStackTrace();
+        }
+
+        r1.setContent("12345678");   // another 8 byte in
+        registry.put("/bang", r1);
+        new ThrottlingJob().executeTask(task);
+        try {
+            putEmptyResource();
+            assertTrue(false); // we expect the exception
+        } catch (Exception e) {
+            assertTrue(true);
+            assertEquals("Your incoming bw is big. Bigger than 12. your value: 16", e.getMessage());
+        }
+
+        // setting another 8 bytes, this should give the early message rather than a new one
+
+        new ThrottlingJob().executeTask(task);
+        r1.setContent("12345678");   // another 8 byte in
+        try {
+            registry.put("/bang", r1);
+            assertTrue(false); // we expect the exception
+        } catch (Exception e) {
+            assertTrue(true);
+            // and same exception message (no bigger number than 16)
+            assertEquals("Your incoming bw is big. Bigger than 12. your value: 16", e.getMessage());
+        }
+    }
+
+    public void testDBVolume() throws Exception {
+
+        Tenant tenant = new Tenant();
+        tenant.setAdminName("admin");
+        tenant.setDomain("abc3.com");
+        tenant.setAdminPassword("admin");
+        tenant.setEmail("admin@abc3.com");
+        tenant.setActive(true);
+
+        int tenantId = realmService.getTenantManager().addTenant(tenant);
+        realmService.getTenantManager().activateTenant(tenantId);
+        registry = registryService.getGovernanceUserRegistry("admin", tenantId);
+
+        String configFile = CarbonUtils.getCarbonConfigDirPath() + "/throttling-config3.xml";
+        String ruleFile = CarbonUtils.getCarbonConfigDirPath() + "/throttling-rules3.drl";
+        // the configuration init will initialize task objects.
+        //ThrottlingConfiguration ignore = new ThrottlingConfiguration(configFile);
+        Task task = getThrottlingTask(configFile, ruleFile);
+
+        Resource r1 = registry.newResource();
+        r1.setContent("12345678");   // 8 byte in
+
+        registry.put("/bang", r1);
+        new ThrottlingJob().executeTask(task);
+        try {
+            putEmptyResource();
+            assertTrue(true);
+        } catch (Exception e) {
+            assertTrue(false);
+            e.printStackTrace();
+        }
+
+        r1.setContent("12345678");   // another 8 byte in
+        registry.put("/bang2", r1);
+        new ThrottlingJob().executeTask(task);
+        try {
+            putEmptyResource();
+            assertTrue(false); // we expect the exception
+        } catch (Exception e) {
+            assertTrue(true);
+            assertEquals("Your resource volume is big. Bigger than 12. your value: 16", e.getMessage());
+        }
+
+        // setting another 8 bytes, this should give the early message rather than a new one
+        // if the pre handlers are doing the job. because the value 16 will be increased only
+        // it goes through the pre dataProviderConfigs
+
+        new ThrottlingJob().executeTask(task);
+        r1.setContent("12345678");   // another 8 byte in
+        try {
+            registry.put("/bang3", r1);
+            assertTrue(false); // we expect the exception
+        } catch (Exception e) {
+            assertTrue(true);
+            // and same exception message (no bigger number than 16)
+            assertEquals("Your resource volume is big. Bigger than 12. your value: 16", e.getMessage());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/java/org/apache/carbon/throttling/test/utils/BaseTestCase.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/java/org/apache/carbon/throttling/test/utils/BaseTestCase.java b/components/org.apache.stratos.throttling.manager/src/test/java/org/apache/carbon/throttling/test/utils/BaseTestCase.java
new file mode 100644
index 0000000..78746ab
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/java/org/apache/carbon/throttling/test/utils/BaseTestCase.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.carbon.throttling.test.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.List;
+
+import javax.sql.DataSource;
+
+import junit.framework.TestCase;
+
+import org.apache.stratos.throttling.manager.conf.ThrottlingConfiguration;
+import org.apache.stratos.throttling.manager.tasks.Task;
+import org.apache.stratos.throttling.manager.utils.Util;
+import org.wso2.carbon.registry.core.Registry;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.config.RegistryContext;
+import org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService;
+import org.wso2.carbon.registry.core.jdbc.InMemoryEmbeddedRegistryService;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+import org.wso2.carbon.user.core.service.RealmService;
+import org.wso2.carbon.utils.CarbonUtils;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.wso2.carbon.registry.core.jdbc.dataaccess.JDBCDataAccessManager;
+
+public class BaseTestCase extends TestCase {
+
+    protected static RegistryContext ctx;
+    protected EmbeddedRegistryService registryService;
+    protected Registry registry; // an admin registry
+    protected RealmService realmService;
+
+    public void setUp() throws Exception {
+        if (System.getProperty("carbon.home") == null) {
+            File file = new File("src/test/resources/carbon-home");
+            if (file.exists()) {
+                System.setProperty("carbon.home", file.getAbsolutePath());
+            }
+        }
+
+        InputStream is;
+        try {
+            is = new FileInputStream("src/test/resources/registry.xml");
+        } catch (Exception e) {
+            is = null;
+        }
+        /*
+         * RealmService realmService = new InMemoryRealmService();
+         * RegistryContext registryContext = RegistryContext.getBaseInstance(is,
+         * realmService); registryContext.setSetup(true);
+         * registryContext.selectDBConfig("h2-db");
+         */
+
+        registryService = new InMemoryEmbeddedRegistryService(is);
+        Util.setRegistryService(registryService);
+        org.apache.stratos.usage.util.Util.setRegistryService(registryService);
+        org.apache.stratos.usage.agent.util.Util.initializeAllListeners();
+//    TODO    org.apache.stratos.usage.agent.util.Util.setRegistryService(registryService);
+
+        realmService = RegistryContext.getBaseInstance().getRealmService();
+        Util.setRealmService(realmService);
+        DataSource registryDataSource =
+                ((JDBCDataAccessManager) RegistryContext.getBaseInstance().getDataAccessManager())
+                        .getDataSource();
+        UserRegistry superTenantGovernanceRegistry = registryService.getGovernanceSystemRegistry();
+//   TODO      Util.setTenantUsageRetriever(new TenantUsageRetriever(registryDataSource,
+//                superTenantGovernanceRegistry, registryService));
+
+        /*RuleServerManager ruleServerManager = new RuleServerManager();
+        RuleServerConfiguration configuration =
+                new RuleServerConfiguration(new JSR94BackendRuntimeFactory());
+        ruleServerManager.init(configuration);
+        Util.setRuleEngineConfigService(ruleServerManager);
+        */
+    }
+
+    public Task getThrottlingTask(String configFile, String ruleFile) throws Exception {
+        saveTrottlingRules(ruleFile);
+        ThrottlingConfiguration throttlingConfiguration = new ThrottlingConfiguration(configFile);
+        List<Task> throttlingTasks = throttlingConfiguration.getThrottlingTasks();
+        return throttlingTasks.get(0);
+    }
+    
+    public void saveTrottlingRules(String throttlingRuleFile) throws Exception {
+        UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
+
+        byte[] content = CarbonUtils.getBytesFromFile(new File(throttlingRuleFile));
+        Resource ruleResource = systemRegistry.newResource();
+        ruleResource.setContent(content);
+        systemRegistry.put(StratosConstants.THROTTLING_RULES_PATH, ruleResource);
+    }
+
+    public void putEmptyResource() throws Exception {
+        Resource r = (Resource) registry.newResource();
+        registry.put("/empty", r);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/java/org/apache/carbon/throttling/test/utils/CustomDataProvider.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/java/org/apache/carbon/throttling/test/utils/CustomDataProvider.java b/components/org.apache.stratos.throttling.manager/src/test/java/org/apache/carbon/throttling/test/utils/CustomDataProvider.java
new file mode 100644
index 0000000..b24f03e
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/java/org/apache/carbon/throttling/test/utils/CustomDataProvider.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.carbon.throttling.test.utils;
+
+import org.wso2.carbon.billing.mgt.dataobjects.MultitenancyPackage;
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataContext;
+import org.apache.stratos.throttling.manager.dataobjects.ThrottlingDataEntryConstants;
+import org.apache.stratos.throttling.manager.dataproviders.DataProvider;
+import org.apache.stratos.throttling.manager.exception.ThrottlingException;
+
+public class CustomDataProvider extends DataProvider {
+    public void invoke(ThrottlingDataContext dataContext) throws ThrottlingException {
+        long dataSize = dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY);
+
+        if (dataSize % 2 == 0) {
+            MultitenancyPackage multiPackage = new MultitenancyPackage();
+            multiPackage.setName("test1");
+            multiPackage.setBandwidthLimit(50);
+
+            dataContext.addDataObject(ThrottlingDataEntryConstants.PACKAGE, multiPackage);
+        } else {
+            MultitenancyPackage multiPackage = new MultitenancyPackage();
+            multiPackage.setName("test2");
+
+            dataContext.addDataObject(ThrottlingDataEntryConstants.PACKAGE, multiPackage);
+            multiPackage.setBandwidthLimit(50);
+        }
+
+    }
+}


[05/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/mysql.sql
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/mysql.sql b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/mysql.sql
deleted file mode 100644
index 5b9b234..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/mysql.sql
+++ /dev/null
@@ -1,370 +0,0 @@
-CREATE TABLE IF NOT EXISTS REG_CLUSTER_LOCK (
-             REG_LOCK_NAME VARCHAR (20),
-             REG_LOCK_STATUS VARCHAR (20),
-             REG_LOCKED_TIME TIMESTAMP,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (REG_LOCK_NAME)
-)ENGINE INNODB;
-
-CREATE TABLE IF NOT EXISTS REG_LOG (
-             REG_LOG_ID INTEGER AUTO_INCREMENT,
-             REG_PATH VARCHAR (750),
-             REG_USER_ID VARCHAR (31) NOT NULL,
-             REG_LOGGED_TIME TIMESTAMP NOT NULL,
-             REG_ACTION INTEGER NOT NULL,
-             REG_ACTION_DATA VARCHAR (500),
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID)
-)ENGINE INNODB;
-
--- The REG_PATH_VALUE should be less than 767 bytes, and hence was fixed at 750.
--- See CARBON-5917.
-
-CREATE TABLE IF NOT EXISTS REG_PATH(
-             REG_PATH_ID INTEGER NOT NULL AUTO_INCREMENT,
-             REG_PATH_VALUE VARCHAR(750) NOT NULL,
-             REG_PATH_PARENT_ID INTEGER,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID)
-)ENGINE INNODB;
-
-CREATE INDEX REG_PATH_IND_BY_PATH_VALUE USING HASH ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID);
-CREATE INDEX REG_PATH_IND_BY_PATH_PARENT_ID USING HASH ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID);
-
-CREATE TABLE IF NOT EXISTS REG_CONTENT (
-             REG_CONTENT_ID INTEGER NOT NULL AUTO_INCREMENT,
-             REG_CONTENT_DATA LONGBLOB,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
-)ENGINE INNODB;
-
-CREATE TABLE IF NOT EXISTS REG_CONTENT_HISTORY (
-             REG_CONTENT_ID INTEGER NOT NULL,
-             REG_CONTENT_DATA LONGBLOB,
-             REG_DELETED   SMALLINT,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
-)ENGINE INNODB;
-
-CREATE TABLE IF NOT EXISTS REG_RESOURCE (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR(256),
-            REG_VERSION         INTEGER NOT NULL AUTO_INCREMENT,
-            REG_MEDIA_TYPE      VARCHAR(500),
-            REG_CREATOR         VARCHAR(31) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR(31),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
-)ENGINE INNODB;
-
-ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_IND_BY_NAME USING HASH ON REG_RESOURCE(REG_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
-
-CREATE TABLE IF NOT EXISTS REG_RESOURCE_HISTORY (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR(256),
-            REG_VERSION         INTEGER NOT NULL,
-            REG_MEDIA_TYPE      VARCHAR(500),
-            REG_CREATOR         VARCHAR(31) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR(31),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_DELETED         SMALLINT,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
-)ENGINE INNODB;
-
-ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME USING HASH ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
-
-CREATE TABLE IF NOT EXISTS REG_COMMENT (
-            REG_ID        INTEGER NOT NULL AUTO_INCREMENT,
-            REG_COMMENT_TEXT      VARCHAR(500) NOT NULL,
-            REG_USER_ID           VARCHAR(31) NOT NULL,
-            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID)
-)ENGINE INNODB;
-
-CREATE TABLE IF NOT EXISTS REG_RESOURCE_COMMENT (
-            REG_COMMENT_ID          INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-)ENGINE INNODB;
-
-ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION USING HASH ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID);
-
-CREATE TABLE IF NOT EXISTS REG_RATING (
-            REG_ID     INTEGER NOT NULL AUTO_INCREMENT,
-            REG_RATING        INTEGER NOT NULL,
-            REG_USER_ID       VARCHAR(31) NOT NULL,
-            REG_RATED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID)
-)ENGINE INNODB;
-
-CREATE TABLE IF NOT EXISTS REG_RESOURCE_RATING (
-            REG_RATING_ID           INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-)ENGINE INNODB;
-
-ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION USING HASH ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID);
-
-
-CREATE TABLE IF NOT EXISTS REG_TAG (
-            REG_ID         INTEGER NOT NULL AUTO_INCREMENT,
-            REG_TAG_NAME       VARCHAR(500) NOT NULL,
-            REG_USER_ID        VARCHAR(31) NOT NULL,
-            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID)
-)ENGINE INNODB;
-
-CREATE TABLE IF NOT EXISTS REG_RESOURCE_TAG (
-            REG_TAG_ID              INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-)ENGINE INNODB;
-
-ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION USING HASH ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID);
-
-CREATE TABLE IF NOT EXISTS REG_PROPERTY (
-            REG_ID         INTEGER NOT NULL AUTO_INCREMENT,
-            REG_NAME       VARCHAR(100) NOT NULL,
-            REG_VALUE        VARCHAR(1000),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID)
-)ENGINE INNODB;
-
-CREATE TABLE IF NOT EXISTS REG_RESOURCE_PROPERTY (
-            REG_PROPERTY_ID         INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-)ENGINE INNODB;
-
-ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION USING HASH ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID);
-
--- CREATE TABLE IF NOT EXISTS REG_ASSOCIATIONS (
--- SRC_PATH_ID     INTEGER,
--- SRC_RESOURCE_NAME    VARCHAR(256),
--- SRC_VERSION     INTEGER,
--- TGT_PATH_ID     INTEGER,
--- TGT_RESOURCE_NAME    VARCHAR(256),
--- TGT_VERSION     INTEGER
--- )ENGINE INNODB;
--- 
--- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_SRC_PATH_ID FOREIGN KEY (SRC_PATH_ID) REFERENCES REG_PATH (PATH_ID);
--- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_TGT_PATH_ID FOREIGN KEY (TGT_PATH_ID) REFERENCES REG_PATH (PATH_ID);
--- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_VERSION ON REG_ASSOCIATIONS(SRC_VERSION);
--- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_VERSION ON REG_ASSOCIATIONS(TGT_VERSION);
--- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_RESOURCE_NAME ON REG_ASSOCIATIONS(SRC_RESOURCE_NAME);
--- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_RESOURCE_NAME ON REG_ASSOCIATIONS(TGT_RESOURCE_NAME);
-
-
-
-CREATE TABLE IF NOT EXISTS REG_ASSOCIATION (
-            REG_ASSOCIATION_ID INTEGER AUTO_INCREMENT,
-            REG_SOURCEPATH VARCHAR (750) NOT NULL,
-            REG_TARGETPATH VARCHAR (750) NOT NULL,
-            REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID)
-)ENGINE INNODB;
-
-CREATE TABLE IF NOT EXISTS REG_SNAPSHOT (
-            REG_SNAPSHOT_ID     INTEGER NOT NULL AUTO_INCREMENT,
-            REG_PATH_ID            INTEGER NOT NULL,
-            REG_RESOURCE_NAME      VARCHAR(255),
-            REG_RESOURCE_VIDS     LONGBLOB NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID)
-)ENGINE INNODB;
-
-CREATE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-
-ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-
-
--- ################################
--- USER MANAGER TABLES
--- ################################
-
-CREATE TABLE UM_TENANT (
-			UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-	    UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
-            UM_EMAIL VARCHAR(255),
-            UM_ACTIVE BOOLEAN DEFAULT FALSE,
-			PRIMARY KEY (UM_ID),
-			UNIQUE(UM_DOMAIN_NAME));
-
-CREATE TABLE UM_USER ( 
-             UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
-             UM_USER_NAME VARCHAR(255) NOT NULL, 
-             UM_USER_PASSWORD VARCHAR(255) NOT NULL,
-             UM_SALT_VALUE VARCHAR(31),
-             UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE,
-             UM_CHANGED_TIME TIMESTAMP NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             PRIMARY KEY (UM_ID, UM_TENANT_ID), 
-             UNIQUE(UM_USER_NAME, UM_TENANT_ID)
-)ENGINE INNODB; 
-
-CREATE TABLE UM_ROLE ( 
-             UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
-             UM_ROLE_NAME VARCHAR(255) NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,  
-             PRIMARY KEY (UM_ID, UM_TENANT_ID),
-             UNIQUE(UM_ROLE_NAME, UM_TENANT_ID) 
-)ENGINE INNODB;
-
-CREATE TABLE UM_PERMISSION ( 
-             UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
-             UM_RESOURCE_ID VARCHAR(255) NOT NULL, 
-             UM_ACTION VARCHAR(255) NOT NULL, 
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)ENGINE INNODB; 
-
-CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION 
-                    ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID); 
-
-CREATE TABLE UM_ROLE_PERMISSION ( 
-             UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
-             UM_PERMISSION_ID INTEGER NOT NULL, 
-             UM_ROLE_NAME VARCHAR(255) NOT NULL,
-             UM_IS_ALLOWED SMALLINT NOT NULL, 
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID), 
-             PRIMARY KEY (UM_ID, UM_TENANT_ID) 
-)ENGINE INNODB; 
-
--- REMOVED UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID) 
-CREATE TABLE UM_USER_PERMISSION ( 
-             UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
-             UM_PERMISSION_ID INTEGER NOT NULL, 
-             UM_USER_NAME VARCHAR(255) NOT NULL,
-             UM_IS_ALLOWED SMALLINT NOT NULL,          
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID), 
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)ENGINE INNODB;
-
--- REMOVED UNIQUE (UM_PERMISSION_ID, UM_USER_ID) 
-CREATE TABLE UM_USER_ROLE ( 
-             UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
-             UM_ROLE_ID INTEGER NOT NULL, 
-             UM_USER_ID INTEGER NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,  
-             UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID), 
-             FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID), 
-             FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), 
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)ENGINE INNODB; 
-
-
-CREATE TABLE UM_USER_ATTRIBUTE ( 
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
-            UM_ATTR_NAME VARCHAR(255) NOT NULL, 
-            UM_ATTR_VALUE VARCHAR(1024), 
-            UM_PROFILE_ID VARCHAR(255), 
-            UM_USER_ID INTEGER, 
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)ENGINE INNODB; 
-
-
-
-CREATE TABLE UM_DIALECT( 
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
-            UM_DIALECT_URI VARCHAR(255) NOT NULL, 
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)ENGINE INNODB; 
-
-CREATE TABLE UM_CLAIM( 
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
-            UM_DIALECT_ID INTEGER NOT NULL, 
-            UM_CLAIM_URI VARCHAR(255) NOT NULL, 
-            UM_DISPLAY_TAG VARCHAR(255), 
-            UM_DESCRIPTION VARCHAR(255), 
-            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
-            UM_REG_EX VARCHAR(255), 
-            UM_SUPPORTED SMALLINT, 
-            UM_REQUIRED SMALLINT, 
-            UM_DISPLAY_ORDER INTEGER,
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID), 
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)ENGINE INNODB; 
-
-CREATE TABLE UM_PROFILE_CONFIG( 
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
-            UM_DIALECT_ID INTEGER NOT NULL, 
-            UM_PROFILE_NAME VARCHAR(255), 
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)ENGINE INNODB; 
-    
-CREATE TABLE UM_CLAIM_BEHAVIOR( 
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT, 
-            UM_PROFILE_ID INTEGER, 
-            UM_CLAIM_ID INTEGER, 
-            UM_BEHAVIOUR SMALLINT, 
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID), 
-            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)ENGINE INNODB; 
-
-CREATE TABLE UM_HYBRID_ROLE(
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-            UM_ROLE_NAME VARCHAR(255),
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)ENGINE INNODB;
-
-CREATE TABLE UM_HYBRID_USER_ROLE(
-            UM_ID INTEGER NOT NULL AUTO_INCREMENT,
-            UM_USER_NAME VARCHAR(255),
-            UM_ROLE_ID INTEGER NOT NULL,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
-            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)ENGINE INNODB;
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/oracle.sql
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/oracle.sql b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/oracle.sql
deleted file mode 100644
index e7cc68f..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/oracle.sql
+++ /dev/null
@@ -1,644 +0,0 @@
-CREATE TABLE REG_CLUSTER_LOCK (
-             REG_LOCK_NAME VARCHAR2(20),
-             REG_LOCK_STATUS VARCHAR2(20),
-             REG_LOCKED_TIME TIMESTAMP,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CLUSTER_LOCK PRIMARY KEY (REG_LOCK_NAME))
-/
-CREATE TABLE REG_LOG (
-             REG_LOG_ID INTEGER,
-             REG_PATH VARCHAR2(2000),
-             REG_USER_ID VARCHAR2(31) NOT NULL,
-             REG_LOGGED_TIME TIMESTAMP  NOT NULL,
-             REG_ACTION INTEGER NOT NULL,
-             REG_ACTION_DATA VARCHAR2(500),
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_LOG PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_LOG_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER REG_LOG_TRIGGER
-                    BEFORE INSERT
-                    ON REG_LOG
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_LOG_SEQUENCE.nextval INTO :NEW.REG_LOG_ID FROM dual;
-           		   END;
-/	         
-
-CREATE TABLE REG_PATH(
-             REG_PATH_ID INTEGER NULL,
-	         REG_PATH_VALUE VARCHAR2(2000) NOT NULL,
-             REG_PATH_PARENT_ID INTEGER,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID))
-/
-CREATE INDEX REG_PATH_IND_BY_PATH_VALUE ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID)
-/
-CREATE INDEX REG_PATH_IND_BY_PARENT_ID ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID)
-/
-CREATE SEQUENCE REG_PATH_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER REG_PATH_TRIGGER
-                    BEFORE INSERT
-                    ON REG_PATH
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_PATH_SEQUENCE.nextval INTO :NEW.REG_PATH_ID FROM dual;
- 			   END;
-/                   
-
-CREATE TABLE REG_CONTENT (
-             REG_CONTENT_ID INTEGER,
-             REG_CONTENT_DATA BLOB,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_CONTENT_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER REG_CONTENT_TRIGGER
-                    BEFORE INSERT
-                    ON REG_CONTENT
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_CONTENT_SEQUENCE.nextval INTO :NEW.REG_CONTENT_ID FROM dual;
- 			   END;
-/                   
-
-CREATE TABLE REG_CONTENT_HISTORY (
-             REG_CONTENT_ID INTEGER NOT NULL,
-             REG_CONTENT_DATA BLOB,
-             REG_DELETED   SMALLINT,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID))
-/
-CREATE TABLE REG_RESOURCE (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR2(256),
-            REG_VERSION         INTEGER,
-            REG_MEDIA_TYPE      VARCHAR2(500),
-            REG_CREATOR         VARCHAR2(31) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR2(31),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR2(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT FK_REG_RES_PATH FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),         
-            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_RESOURCE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER REG_RESOURCE_TRIGGER
-                    BEFORE INSERT
-                    ON REG_RESOURCE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_RESOURCE_SEQUENCE.nextval INTO :NEW.REG_VERSION FROM dual;
- 			   END;
-/                   
-
-CREATE INDEX REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME, REG_TENANT_ID)
-/
-CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID)
-/
-CREATE TABLE REG_RESOURCE_HISTORY (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR2(256),
-            REG_VERSION         INTEGER NOT NULL,
-            REG_MEDIA_TYPE      VARCHAR2(500),
-            REG_CREATOR         VARCHAR2(31) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR2(31),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR2(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_DELETED         SMALLINT,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
-            FOREIGN KEY (REG_CONTENT_ID,REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID,REG_TENANT_ID),            
-            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID))
-/
-CREATE INDEX REG_RES_HIST_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID)
-/
-CREATE INDEX REG_RES_HIST_IND_BY_PATH_ID ON REG_RESOURCE_HISTORY(REG_PATH_ID, REG_NAME, REG_TENANT_ID)
-/
-CREATE TABLE REG_COMMENT (
-            REG_ID        INTEGER,
-            REG_COMMENT_TEXT      VARCHAR2(500) NOT NULL,
-            REG_USER_ID           VARCHAR2(31) NOT NULL,
-            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_COMMENT_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER REG_COMMENT_TRIGGER
-                    BEFORE INSERT
-                    ON REG_COMMENT
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_COMMENT_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
- 			   END;
-/                   
-
-CREATE TABLE REG_RESOURCE_COMMENT (
-            REG_COMMENT_ID          INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR2(256),
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
-            FOREIGN KEY (REG_COMMENT_ID,REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID,REG_TENANT_ID),            
-            REG_TENANT_ID INTEGER DEFAULT 0) 
-/
-CREATE INDEX REG_RES_COMM_BY_PATH_ID ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
-/
-CREATE INDEX REG_RES_COMM_BY_VERSION ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID)
-/
-CREATE TABLE REG_RATING (
-            REG_ID     INTEGER,
-            REG_RATING        INTEGER NOT NULL,
-            REG_USER_ID       VARCHAR2(31) NOT NULL,
-            REG_RATED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_RATING_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER REG_RATING_TRIGGER
-                    BEFORE INSERT
-                    ON REG_RATING
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_RATING_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
-                     END;
-/
-				
-CREATE TABLE REG_RESOURCE_RATING (
-            REG_RATING_ID           INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR2(256),
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
-            FOREIGN KEY (REG_RATING_ID,REG_TENANT_ID) REFERENCES REG_RATING (REG_ID,REG_TENANT_ID),           
-            REG_TENANT_ID INTEGER DEFAULT 0)
-/
-CREATE INDEX REG_RATING_IND_BY_PATH_ID ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
-/
-CREATE INDEX REG_RATING_IND_BY_VERSION ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID)
-/
-CREATE TABLE REG_TAG (
-            REG_ID         INTEGER,
-            REG_TAG_NAME       VARCHAR2(500) NOT NULL,
-            REG_USER_ID        VARCHAR2(31) NOT NULL,
-            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_TAG_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER REG_TAG_TRIGGER
-                    BEFORE INSERT
-                    ON REG_TAG
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_TAG_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
-                     END;
-/  
-			
-
-CREATE TABLE REG_RESOURCE_TAG (
-            REG_TAG_ID              INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR2(256),
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
-            FOREIGN KEY (REG_TAG_ID,REG_TENANT_ID) REFERENCES REG_TAG (REG_ID,REG_TENANT_ID),            
-            REG_TENANT_ID INTEGER DEFAULT 0)
-/
-CREATE INDEX REG_TAG_IND_BY_PATH_ID ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
-/
-CREATE INDEX REG_TAG_IND_BY_VERSION ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID)
-/
-CREATE TABLE REG_PROPERTY (
-            REG_ID         INTEGER,
-            REG_NAME       VARCHAR2(100) NOT NULL,
-            REG_VALUE        VARCHAR2(1000),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_PROPERTY_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER REG_PROPERTY_TRIGGER
-                    BEFORE INSERT
-                    ON REG_PROPERTY
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_PROPERTY_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
- 			   END;
-/                   
-
-CREATE TABLE REG_RESOURCE_PROPERTY (
-            REG_PROPERTY_ID         INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR2(256),
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
-            FOREIGN KEY (REG_PROPERTY_ID,REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID,REG_TENANT_ID),           
-            REG_TENANT_ID INTEGER DEFAULT 0)
-/
-CREATE INDEX REG_RESC_PROP_BY_VERN_PROPID ON REG_RESOURCE_PROPERTY(REG_PROPERTY_ID,REG_VERSION, REG_TENANT_ID)
-/
-CREATE INDEX REG_RESC_PROP_BY_VERN_PATHNAME ON REG_RESOURCE_PROPERTY(REG_PROPERTY_ID,REG_PATH_ID,REG_RESOURCE_NAME, REG_TENANT_ID)
-/
-CREATE TABLE REG_ASSOCIATION (
-            REG_ASSOCIATION_ID INTEGER,
-            REG_SOURCEPATH VARCHAR2 (2000) NOT NULL,
-            REG_TARGETPATH VARCHAR2 (2000) NOT NULL,
-            REG_ASSOCIATION_TYPE VARCHAR2 (2000) NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_ASSOCIATION PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_ASSOCIATION_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER REG_ASSOCIATION_TRIGGER
-                    BEFORE INSERT
-                    ON REG_ASSOCIATION
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_ASSOCIATION_SEQUENCE.nextval INTO :NEW.REG_ASSOCIATION_ID FROM dual;
- 			   END;
-/                   
-
-CREATE TABLE REG_SNAPSHOT (
-            REG_SNAPSHOT_ID     INTEGER,
-            REG_PATH_ID            INTEGER NOT NULL,
-            REG_RESOURCE_NAME      VARCHAR2(256),
-            REG_RESOURCE_VIDS     BLOB NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
-            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID))
-/
-CREATE INDEX REG_SNAPSHOT_PATH_ID ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
-/
-CREATE SEQUENCE REG_SNAPSHOT_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER REG_SNAPSHOT_TRIGGER
-                    BEFORE INSERT
-                    ON REG_SNAPSHOT
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_SNAPSHOT_SEQUENCE.nextval INTO :NEW.REG_SNAPSHOT_ID FROM dual;
-                     END;
-/
-/
-CREATE TABLE UM_TENANT (
-                    UM_ID INTEGER,
-                    UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
-                    UM_EMAIL VARCHAR(255),
-                    UM_ACTIVE NUMBER(1) DEFAULT 0,
-                    PRIMARY KEY (UM_ID),
-                    UNIQUE(UM_DOMAIN_NAME))
-/
-CREATE SEQUENCE UM_TENANT_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_TENANT_TRIGGER
-		            BEFORE INSERT
-                    ON UM_TENANT
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                     SELECT UM_TENANT_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-                    END;
-/
-CREATE TABLE UM_USER (
-                    UM_ID INTEGER,
-                    UM_USER_NAME VARCHAR2(255) NOT NULL,
-                    UM_USER_PASSWORD VARCHAR2(255) NOT NULL,
-                    UM_SALT_VALUE VARCHAR(31),
-                    UM_REQUIRE_CHANGE NUMBER(1) DEFAULT 0,
-                    UM_CHANGED_TIME TIMESTAMP NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID),
-                    UNIQUE(UM_USER_NAME, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_USER_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_USER_TRIGGER
-		            BEFORE INSERT
-                    ON UM_USER
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                     SELECT UM_USER_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-                    END;
-/
-		
-CREATE TABLE UM_USER_ATTRIBUTE (
-                    UM_ID INTEGER,
-                    UM_ATTR_NAME VARCHAR2(255) NOT NULL,
-                    UM_ATTR_VALUE VARCHAR2(255),
-                    UM_PROFILE_ID VARCHAR(255),
-                    UM_USER_ID INTEGER,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_USER_ATTRIBUTE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_USER_ATTRIBUTE_TRIGGER
-                    BEFORE INSERT
-                    ON UM_USER_ATTRIBUTE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_USER_ATTRIBUTE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
- 			  END;
-/                   
-
-CREATE TABLE UM_ROLE (
-                    UM_ID INTEGER,
-                    UM_ROLE_NAME VARCHAR2(255) NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID),
-                    UNIQUE(UM_ROLE_NAME, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_ROLE_TRIGGER
-                    BEFORE INSERT
-                    ON UM_ROLE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                     SELECT UM_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
- 			  END;
-/             
-
-CREATE TABLE UM_PERMISSION (
-                    UM_ID INTEGER,
-                    UM_RESOURCE_ID VARCHAR2(255) NOT NULL,
-                    UM_ACTION VARCHAR2(255) NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_PERMISSION_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_PERMISSION_TRIGGER
-                    BEFORE INSERT
-                    ON UM_PERMISSION
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                     SELECT UM_PERMISSION_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-                    END;
-/   
-
-CREATE TABLE UM_ROLE_PERMISSION (
-		            UM_ID INTEGER,
-                    UM_PERMISSION_ID INTEGER NOT NULL,
-                    UM_ROLE_NAME VARCHAR(255) NOT NULL,
-                    UM_IS_ALLOWED SMALLINT NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID),
-                    FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE  CASCADE,
-                    --FOREIGN KEY (UM_ROLE_ID) REFERENCES UM_ROLE(UM_ID) ON DELETE CASCADE,                    
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_ROLE_PERMISSION_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_ROLE_PERMISSION_TRIGGER
-		            BEFORE INSERT
-                    ON UM_ROLE_PERMISSION
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_ROLE_PERMISSION_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
- 			  END;
-/                   
-
-CREATE TABLE UM_USER_PERMISSION (
-		            UM_ID INTEGER,
-		            UM_PERMISSION_ID INTEGER NOT NULL,
-                    UM_USER_NAME VARCHAR(255) NOT NULL,
-                    UM_IS_ALLOWED SMALLINT NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    UNIQUE (UM_PERMISSION_ID, UM_USER_NAME, UM_TENANT_ID),
-                    FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
-                    --FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID) ON DELETE CASCADE,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_USER_PERMISSION_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_USER_PERMISSION_TRIGGER
-		            BEFORE INSERT
-		            ON UM_USER_PERMISSION
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_USER_PERMISSION_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
- 			  END;
-/                   
-
-CREATE TABLE UM_USER_ROLE (
-		            UM_ID INTEGER,
-                    UM_ROLE_ID INTEGER NOT NULL,
-                    UM_USER_ID INTEGER NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID),
-                    FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
-                    FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_USER_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_USER_ROLE_TRIGGER
-                    BEFORE INSERT
-                    ON UM_USER_ROLE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
- 	                   SELECT UM_USER_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-                    END;
-/
-
-CREATE TABLE HYBRID_ROLE (
-                    UM_ID INTEGER,
-                    UM_ROLE_ID VARCHAR(255) NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID),
-                    UNIQUE(UM_ROLE_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE HYBRID_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER HYBRID_ROLE_TRIGGER
-                    BEFORE INSERT
-                    ON HYBRID_ROLE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT HYBRID_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-                    END;
-/  
-			
-CREATE TABLE HYBRID_USER_ROLE (
-                    UM_ID INTEGER,
-                    UM_USER_ID VARCHAR(255),
-                    UM_ROLE_ID VARCHAR(255) NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE HYBRID_USER_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER HYBRID_USER_ROLE_TRIGGER
-                    BEFORE INSERT
-                    ON HYBRID_USER_ROLE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT HYBRID_USER_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-			  END;
-/                    
-
-CREATE TABLE UM_DIALECT(
-            UM_ID INTEGER, 
-            UM_DIALECT_URI VARCHAR(255) NOT NULL,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)
-/
-CREATE SEQUENCE UM_DIALECT_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_DIALECT_TRIGGER
-                    BEFORE INSERT
-                    ON UM_DIALECT
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_DIALECT_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-  			  END;
-/                  
-
-CREATE TABLE UM_CLAIM(
-            UM_ID INTEGER, 
-            UM_DIALECT_ID INTEGER NOT NULL, 
-            UM_CLAIM_URI VARCHAR(255) NOT NULL, 
-            UM_DISPLAY_TAG VARCHAR(255), 
-            UM_DESCRIPTION VARCHAR(255), 
-            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
-            UM_REG_EX VARCHAR(255), 
-            UM_SUPPORTED SMALLINT, 
-            UM_REQUIRED SMALLINT, 
-            UM_DISPLAY_ORDER INTEGER,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID),
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)
-/
-CREATE SEQUENCE UM_CLAIM_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_CLAIM_TRIGGER
-                    BEFORE INSERT
-                    ON UM_CLAIM
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-	                SELECT UM_CLAIM_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-      		  END;
-/              
-
-CREATE TABLE UM_PROFILE_CONFIG(
-            UM_ID INTEGER, 
-            UM_DIALECT_ID INTEGER, 
-            UM_PROFILE_NAME VARCHAR(255), 
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)
-/
-CREATE SEQUENCE UM_PROFILE_CONFIG_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_PROFILE_CONFIG_TRIGGER
-                    BEFORE INSERT
-                    ON UM_PROFILE_CONFIG
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_PROFILE_CONFIG_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-                    END;
-/
-    
-CREATE TABLE UM_CLAIM_BEHAVIOR(
-            UM_ID INTEGER, 
-            UM_PROFILE_ID INTEGER, 
-            UM_CLAIM_ID INTEGER, 
-            UM_BEHAVIOUR SMALLINT,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID), 
-            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)
-/
-CREATE SEQUENCE UM_CLAIM_BEHAVIOR_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_CLAIM_BEHAVIOR_TRIGGER
-                    BEFORE INSERT
-                    ON UM_CLAIM_BEHAVIOR
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_CLAIM_BEHAVIOR_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
- 			  END;
-/                   
-
-CREATE TABLE UM_HYBRID_ROLE(
-            UM_ID INTEGER NOT NULL,
-            UM_ROLE_NAME VARCHAR(255),
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)
-/
-CREATE SEQUENCE UM_HYBRID_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_HYBRID_ROLE_TRIGGER
-                    BEFORE INSERT
-                    ON UM_HYBRID_ROLE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_HYBRID_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-              END;
-/
-CREATE TABLE UM_HYBRID_USER_ROLE(
-            UM_ID INTEGER NOT NULL,
-            UM_USER_NAME VARCHAR(255),
-            UM_ROLE_ID INTEGER NOT NULL,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
-            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)
-/
-CREATE SEQUENCE UM_HYBRID_USER_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
-/
-CREATE OR REPLACE TRIGGER UM_HYBRID_USER_ROLE_TRIGGER
-                    BEFORE INSERT
-                    ON UM_HYBRID_USER_ROLE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_HYBRID_USER_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-              END;
-/

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/oracle_rac.sql
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/oracle_rac.sql b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/oracle_rac.sql
deleted file mode 100644
index 4bdffd1..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/oracle_rac.sql
+++ /dev/null
@@ -1,644 +0,0 @@
-CREATE TABLE REG_CLUSTER_LOCK (
-             REG_LOCK_NAME VARCHAR2(20),
-             REG_LOCK_STATUS VARCHAR2(20),
-             REG_LOCKED_TIME TIMESTAMP,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CLUSTER_LOCK PRIMARY KEY (REG_LOCK_NAME))
-/
-CREATE TABLE REG_LOG (
-             REG_LOG_ID INTEGER,
-             REG_PATH VARCHAR2(2000),
-             REG_USER_ID VARCHAR2(31) NOT NULL,
-             REG_LOGGED_TIME TIMESTAMP  NOT NULL,
-             REG_ACTION INTEGER NOT NULL,
-             REG_ACTION_DATA VARCHAR2(500),
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_LOG PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_LOG_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER REG_LOG_TRIGGER
-                    BEFORE INSERT
-                    ON REG_LOG
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_LOG_SEQUENCE.nextval INTO :NEW.REG_LOG_ID FROM dual;
-           		   END;
-/	         
-
-CREATE TABLE REG_PATH(
-             REG_PATH_ID INTEGER NULL,
-	         REG_PATH_VALUE VARCHAR2(2000) NOT NULL,
-             REG_PATH_PARENT_ID INTEGER,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID))
-/
-CREATE INDEX REG_PATH_IND_BY_PATH_VALUE ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID)
-/
-CREATE INDEX REG_PATH_IND_BY_PARENT_ID ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID)
-/
-CREATE SEQUENCE REG_PATH_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER REG_PATH_TRIGGER
-                    BEFORE INSERT
-                    ON REG_PATH
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_PATH_SEQUENCE.nextval INTO :NEW.REG_PATH_ID FROM dual;
- 			   END;
-/                   
-
-CREATE TABLE REG_CONTENT (
-             REG_CONTENT_ID INTEGER,
-             REG_CONTENT_DATA BLOB,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_CONTENT_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER REG_CONTENT_TRIGGER
-                    BEFORE INSERT
-                    ON REG_CONTENT
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_CONTENT_SEQUENCE.nextval INTO :NEW.REG_CONTENT_ID FROM dual;
- 			   END;
-/                   
-
-CREATE TABLE REG_CONTENT_HISTORY (
-             REG_CONTENT_ID INTEGER NOT NULL,
-             REG_CONTENT_DATA BLOB,
-             REG_DELETED   SMALLINT,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID))
-/
-CREATE TABLE REG_RESOURCE (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR2(256),
-            REG_VERSION         INTEGER,
-            REG_MEDIA_TYPE      VARCHAR2(500),
-            REG_CREATOR         VARCHAR2(31) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR2(31),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR2(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),          
-            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_RESOURCE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER REG_RESOURCE_TRIGGER
-                    BEFORE INSERT
-                    ON REG_RESOURCE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_RESOURCE_SEQUENCE.nextval INTO :NEW.REG_VERSION FROM dual;
- 			   END;
-/                   
-
-CREATE INDEX REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME, REG_TENANT_ID)
-/
-CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID)
-/
-CREATE TABLE REG_RESOURCE_HISTORY (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR2(256),
-            REG_VERSION         INTEGER NOT NULL,
-            REG_MEDIA_TYPE      VARCHAR2(500),
-            REG_CREATOR         VARCHAR2(31) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR2(31),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR2(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_DELETED         SMALLINT,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
-            FOREIGN KEY (REG_CONTENT_ID,REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID,REG_TENANT_ID),            
-            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID))
-/
-CREATE INDEX REG_RES_HIST_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID)
-/
-CREATE INDEX REG_RES_HIST_IND_BY_PATH_ID ON REG_RESOURCE_HISTORY(REG_PATH_ID, REG_NAME, REG_TENANT_ID)
-/
-CREATE TABLE REG_COMMENT (
-            REG_ID        INTEGER,
-            REG_COMMENT_TEXT      VARCHAR2(500) NOT NULL,
-            REG_USER_ID           VARCHAR2(31) NOT NULL,
-            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_COMMENT_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER REG_COMMENT_TRIGGER
-                    BEFORE INSERT
-                    ON REG_COMMENT
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_COMMENT_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
- 			   END;
-/                   
-
-CREATE TABLE REG_RESOURCE_COMMENT (
-            REG_COMMENT_ID          INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR2(256),
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
-            FOREIGN KEY (REG_COMMENT_ID,REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID,REG_TENANT_ID),            
-            REG_TENANT_ID INTEGER DEFAULT 0) 
-/
-CREATE INDEX REG_RES_COMM_BY_PATH_ID ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
-/
-CREATE INDEX REG_RES_COMM_BY_VERSION ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID)
-/
-CREATE TABLE REG_RATING (
-            REG_ID     INTEGER,
-            REG_RATING        INTEGER NOT NULL,
-            REG_USER_ID       VARCHAR2(31) NOT NULL,
-            REG_RATED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_RATING_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER REG_RATING_TRIGGER
-                    BEFORE INSERT
-                    ON REG_RATING
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_RATING_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
-                     END;
-/
-				
-CREATE TABLE REG_RESOURCE_RATING (
-            REG_RATING_ID           INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR2(256),
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
-            FOREIGN KEY (REG_RATING_ID,REG_TENANT_ID) REFERENCES REG_RATING (REG_ID,REG_TENANT_ID),           
-            REG_TENANT_ID INTEGER DEFAULT 0)
-/
-CREATE INDEX REG_RATING_IND_BY_PATH_ID ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
-/
-CREATE INDEX REG_RATING_IND_BY_VERSION ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID)
-/
-CREATE TABLE REG_TAG (
-            REG_ID         INTEGER,
-            REG_TAG_NAME       VARCHAR2(500) NOT NULL,
-            REG_USER_ID        VARCHAR2(31) NOT NULL,
-            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_TAG_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER REG_TAG_TRIGGER
-                    BEFORE INSERT
-                    ON REG_TAG
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_TAG_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
-                     END;
-/  
-			
-
-CREATE TABLE REG_RESOURCE_TAG (
-            REG_TAG_ID              INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR2(256),
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
-            FOREIGN KEY (REG_TAG_ID,REG_TENANT_ID) REFERENCES REG_TAG (REG_ID,REG_TENANT_ID),            
-            REG_TENANT_ID INTEGER DEFAULT 0)
-/
-CREATE INDEX REG_TAG_IND_BY_PATH_ID ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
-/
-CREATE INDEX REG_TAG_IND_BY_VERSION ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID)
-/
-CREATE TABLE REG_PROPERTY (
-            REG_ID         INTEGER,
-            REG_NAME       VARCHAR2(100) NOT NULL,
-            REG_VALUE        VARCHAR2(1000),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_PROPERTY_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER REG_PROPERTY_TRIGGER
-                    BEFORE INSERT
-                    ON REG_PROPERTY
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_PROPERTY_SEQUENCE.nextval INTO :NEW.REG_ID FROM dual;
- 			   END;
-/                   
-
-CREATE TABLE REG_RESOURCE_PROPERTY (
-            REG_PROPERTY_ID         INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR2(256),
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
-            FOREIGN KEY (REG_PROPERTY_ID,REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID,REG_TENANT_ID),           
-            REG_TENANT_ID INTEGER DEFAULT 0)
-/
-CREATE INDEX REG_RESC_PROP_BY_VERN_PROPID ON REG_RESOURCE_PROPERTY(REG_PROPERTY_ID,REG_VERSION, REG_TENANT_ID)
-/
-CREATE INDEX REG_RESC_PROP_BY_VERN_PATHNAME ON REG_RESOURCE_PROPERTY(REG_PROPERTY_ID,REG_PATH_ID,REG_RESOURCE_NAME, REG_TENANT_ID)
-/
-CREATE TABLE REG_ASSOCIATION (
-            REG_ASSOCIATION_ID INTEGER,
-            REG_SOURCEPATH VARCHAR2 (2000) NOT NULL,
-            REG_TARGETPATH VARCHAR2 (2000) NOT NULL,
-            REG_ASSOCIATION_TYPE VARCHAR2 (2000) NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_ASSOCIATION PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID))
-/
-CREATE SEQUENCE REG_ASSOCIATION_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER REG_ASSOCIATION_TRIGGER
-                    BEFORE INSERT
-                    ON REG_ASSOCIATION
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_ASSOCIATION_SEQUENCE.nextval INTO :NEW.REG_ASSOCIATION_ID FROM dual;
- 			   END;
-/                   
-
-CREATE TABLE REG_SNAPSHOT (
-            REG_SNAPSHOT_ID     INTEGER,
-            REG_PATH_ID            INTEGER NOT NULL,
-            REG_RESOURCE_NAME      VARCHAR2(256),
-            REG_RESOURCE_VIDS     BLOB NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY (REG_PATH_ID,REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID,REG_TENANT_ID),
-            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID))
-/
-CREATE INDEX REG_SNAPSHOT_PATH_ID ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID)
-/
-CREATE SEQUENCE REG_SNAPSHOT_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER REG_SNAPSHOT_TRIGGER
-                    BEFORE INSERT
-                    ON REG_SNAPSHOT
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                     BEGIN
-                       SELECT REG_SNAPSHOT_SEQUENCE.nextval INTO :NEW.REG_SNAPSHOT_ID FROM dual;
-                     END;
-/
-/
-CREATE TABLE UM_TENANT (
-                    UM_ID INTEGER,
-                    UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
-                    UM_EMAIL VARCHAR(255),
-                    UM_ACTIVE NUMBER(1) DEFAULT 0,
-                    PRIMARY KEY (UM_ID),
-                    UNIQUE(UM_DOMAIN_NAME))
-/
-CREATE SEQUENCE UM_TENANT_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_TENANT_TRIGGER
-		            BEFORE INSERT
-                    ON UM_TENANT
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                     SELECT UM_TENANT_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-                    END;
-/
-CREATE TABLE UM_USER (
-                    UM_ID INTEGER,
-                    UM_USER_NAME VARCHAR2(255) NOT NULL,
-                    UM_USER_PASSWORD VARCHAR2(255) NOT NULL,
-                    UM_SALT_VALUE VARCHAR(31),
-                    UM_REQUIRE_CHANGE NUMBER(1) DEFAULT 0,
-                    UM_CHANGED_TIME TIMESTAMP NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID),
-                    UNIQUE(UM_USER_NAME, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_USER_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_USER_TRIGGER
-		            BEFORE INSERT
-                    ON UM_USER
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                     SELECT UM_USER_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-                    END;
-/
-		
-CREATE TABLE UM_USER_ATTRIBUTE (
-                    UM_ID INTEGER,
-                    UM_ATTR_NAME VARCHAR2(255) NOT NULL,
-                    UM_ATTR_VALUE VARCHAR2(255),
-                    UM_PROFILE_ID VARCHAR(255),
-                    UM_USER_ID INTEGER,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_USER_ATTRIBUTE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_USER_ATTRIBUTE_TRIGGER
-                    BEFORE INSERT
-                    ON UM_USER_ATTRIBUTE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_USER_ATTRIBUTE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
- 			  END;
-/                   
-
-CREATE TABLE UM_ROLE (
-                    UM_ID INTEGER,
-                    UM_ROLE_NAME VARCHAR2(255) NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID),
-                    UNIQUE(UM_ROLE_NAME, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_ROLE_TRIGGER
-                    BEFORE INSERT
-                    ON UM_ROLE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                     SELECT UM_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
- 			  END;
-/             
-
-CREATE TABLE UM_PERMISSION (
-                    UM_ID INTEGER,
-                    UM_RESOURCE_ID VARCHAR2(255) NOT NULL,
-                    UM_ACTION VARCHAR2(255) NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_PERMISSION_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_PERMISSION_TRIGGER
-                    BEFORE INSERT
-                    ON UM_PERMISSION
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                     SELECT UM_PERMISSION_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-                    END;
-/   
-
-CREATE TABLE UM_ROLE_PERMISSION (
-		            UM_ID INTEGER,
-                    UM_PERMISSION_ID INTEGER NOT NULL,
-                    UM_ROLE_NAME VARCHAR(255) NOT NULL,
-                    UM_IS_ALLOWED SMALLINT NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID),
-                    FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE  CASCADE,
-                    --FOREIGN KEY (UM_ROLE_ID) REFERENCES UM_ROLE(UM_ID) ON DELETE CASCADE,                    
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_ROLE_PERMISSION_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_ROLE_PERMISSION_TRIGGER
-		            BEFORE INSERT
-                    ON UM_ROLE_PERMISSION
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_ROLE_PERMISSION_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
- 			  END;
-/                   
-
-CREATE TABLE UM_USER_PERMISSION (
-		            UM_ID INTEGER,
-		            UM_PERMISSION_ID INTEGER NOT NULL,
-                    UM_USER_NAME VARCHAR(255) NOT NULL,
-                    UM_IS_ALLOWED SMALLINT NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    UNIQUE (UM_PERMISSION_ID, UM_USER_NAME, UM_TENANT_ID),
-                    FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
-                    --FOREIGN KEY (UM_USER_ID) REFERENCES UM_USER(UM_ID) ON DELETE CASCADE,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_USER_PERMISSION_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_USER_PERMISSION_TRIGGER
-		            BEFORE INSERT
-		            ON UM_USER_PERMISSION
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_USER_PERMISSION_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
- 			  END;
-/                   
-
-CREATE TABLE UM_USER_ROLE (
-		            UM_ID INTEGER,
-                    UM_ROLE_ID INTEGER NOT NULL,
-                    UM_USER_ID INTEGER NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID),
-                    FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
-                    FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE UM_USER_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_USER_ROLE_TRIGGER
-                    BEFORE INSERT
-                    ON UM_USER_ROLE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
- 	                   SELECT UM_USER_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-                    END;
-/
-
-CREATE TABLE HYBRID_ROLE (
-                    UM_ID INTEGER,
-                    UM_ROLE_ID VARCHAR(255) NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID),
-                    UNIQUE(UM_ROLE_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE HYBRID_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER HYBRID_ROLE_TRIGGER
-                    BEFORE INSERT
-                    ON HYBRID_ROLE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT HYBRID_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-                    END;
-/  
-			
-CREATE TABLE HYBRID_USER_ROLE (
-                    UM_ID INTEGER,
-                    UM_USER_ID VARCHAR(255),
-                    UM_ROLE_ID VARCHAR(255) NOT NULL,
-                    UM_TENANT_ID INTEGER DEFAULT 0,
-                    PRIMARY KEY (UM_ID, UM_TENANT_ID))
-/
-CREATE SEQUENCE HYBRID_USER_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER HYBRID_USER_ROLE_TRIGGER
-                    BEFORE INSERT
-                    ON HYBRID_USER_ROLE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT HYBRID_USER_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-			  END;
-/                    
-
-CREATE TABLE UM_DIALECT(
-            UM_ID INTEGER, 
-            UM_DIALECT_URI VARCHAR(255) NOT NULL,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)
-/
-CREATE SEQUENCE UM_DIALECT_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_DIALECT_TRIGGER
-                    BEFORE INSERT
-                    ON UM_DIALECT
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_DIALECT_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-  			  END;
-/                  
-
-CREATE TABLE UM_CLAIM(
-            UM_ID INTEGER, 
-            UM_DIALECT_ID INTEGER NOT NULL, 
-            UM_CLAIM_URI VARCHAR(255) NOT NULL, 
-            UM_DISPLAY_TAG VARCHAR(255), 
-            UM_DESCRIPTION VARCHAR(255), 
-            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
-            UM_REG_EX VARCHAR(255), 
-            UM_SUPPORTED SMALLINT, 
-            UM_REQUIRED SMALLINT, 
-            UM_DISPLAY_ORDER INTEGER,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID),
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)
-/
-CREATE SEQUENCE UM_CLAIM_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_CLAIM_TRIGGER
-                    BEFORE INSERT
-                    ON UM_CLAIM
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-	                SELECT UM_CLAIM_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-      		  END;
-/              
-
-CREATE TABLE UM_PROFILE_CONFIG(
-            UM_ID INTEGER, 
-            UM_DIALECT_ID INTEGER, 
-            UM_PROFILE_NAME VARCHAR(255), 
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)
-/
-CREATE SEQUENCE UM_PROFILE_CONFIG_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_PROFILE_CONFIG_TRIGGER
-                    BEFORE INSERT
-                    ON UM_PROFILE_CONFIG
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_PROFILE_CONFIG_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-                    END;
-/
-    
-CREATE TABLE UM_CLAIM_BEHAVIOR(
-            UM_ID INTEGER, 
-            UM_PROFILE_ID INTEGER, 
-            UM_CLAIM_ID INTEGER, 
-            UM_BEHAVIOUR SMALLINT,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID), 
-            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)
-/
-CREATE SEQUENCE UM_CLAIM_BEHAVIOR_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_CLAIM_BEHAVIOR_TRIGGER
-                    BEFORE INSERT
-                    ON UM_CLAIM_BEHAVIOR
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_CLAIM_BEHAVIOR_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
- 			  END;
-/                   
-
-CREATE TABLE UM_HYBRID_ROLE(
-            UM_ID INTEGER NOT NULL,
-            UM_ROLE_NAME VARCHAR(255),
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)
-/
-CREATE SEQUENCE UM_HYBRID_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_HYBRID_ROLE_TRIGGER
-                    BEFORE INSERT
-                    ON UM_HYBRID_ROLE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_HYBRID_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-              END;
-/
-CREATE TABLE UM_HYBRID_USER_ROLE(
-            UM_ID INTEGER NOT NULL,
-            UM_USER_NAME VARCHAR(255),
-            UM_ROLE_ID INTEGER NOT NULL,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
-            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-)
-/
-CREATE SEQUENCE UM_HYBRID_USER_ROLE_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
-/
-CREATE OR REPLACE TRIGGER UM_HYBRID_USER_ROLE_TRIGGER
-                    BEFORE INSERT
-                    ON UM_HYBRID_USER_ROLE
-                    REFERENCING NEW AS NEW
-                    FOR EACH ROW
-                    BEGIN
-                    SELECT UM_HYBRID_USER_ROLE_SEQUENCE.nextval INTO :NEW.UM_ID FROM dual;
-              END;
-/


[17/18] git commit: applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
applying 0001-Refactor-throttling-module.patch


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

Branch: refs/heads/master
Commit: 767082e314345555db5de93396908d4642f6dd4b
Parents: a875aab
Author: Lakmal Warusawithana <la...@wso2.com>
Authored: Fri Jul 12 13:21:52 2013 +0530
Committer: Lakmal Warusawithana <la...@wso2.com>
Committed: Fri Jul 12 13:21:52 2013 +0530

----------------------------------------------------------------------
 .../org.apache.stratos.throttling.agent/pom.xml | 138 ++++
 .../throttling/agent/ThrottlingAgent.java       | 246 +++++++
 .../Axis2ConfigurationContextObserverImpl.java  |  45 ++
 .../agent/cache/TenantThrottlingInfo.java       |  56 ++
 .../agent/cache/ThrottlingActionInfo.java       |  40 +
 .../agent/cache/ThrottlingInfoCache.java        | 121 +++
 .../cache/ThrottlingInfoCacheUpdaterTask.java   |  82 +++
 .../MultitenancyThrottlingServiceClient.java    |  65 ++
 .../agent/client/ThrottlingRuleInvoker.java     |  23 +
 .../conf/ThrottlingAgentConfiguration.java      |  88 +++
 .../ThrottlingAgentServiceComponent.java        | 191 +++++
 .../listeners/PerRegistryRequestListener.java   | 119 +++
 .../agent/listeners/PerUserAddListener.java     |  90 +++
 .../agent/listeners/ServiceRequestListener.java | 114 +++
 .../agent/listeners/ThrottlingModule.java       |  50 ++
 .../agent/listeners/WebAppRequestListener.java  | 180 +++++
 .../agent/validation/ValidationException.java   |  28 +
 .../agent/validation/ValidationInfo.java        |  42 ++
 .../validation/ValidationInfoRetriever.java     | 112 +++
 .../src/main/resources/META-INF/module.xml      |  34 +
 .../MultitenancyThrottlingService.wsdl          |  82 +++
 .../pom.xml                                     | 177 +++++
 .../manager/conf/ThrottlingConfiguration.java   | 107 +++
 .../conf/ThrottlingTaskConfiguration.java       | 120 +++
 ...ThrottlingTaskDataProviderConfiguration.java | 117 +++
 .../dataobjects/ThrottlingAccessValidation.java |  73 ++
 .../dataobjects/ThrottlingDataContext.java      | 148 ++++
 .../dataobjects/ThrottlingDataEntry.java        |  87 +++
 .../ThrottlingDataEntryConstants.java           |  44 ++
 .../dataproviders/BillingDataProvider.java      |  55 ++
 .../manager/dataproviders/DataProvider.java     |  38 +
 .../dataproviders/UsageDataProvider.java        | 106 +++
 .../manager/exception/ThrottlingException.java  |  28 +
 .../ThrottlingManagerServiceComponent.java      | 129 ++++
 .../manager/rules/KnowledgeBaseManager.java     |  73 ++
 .../throttling/manager/rules/RuleInvoker.java   |  92 +++
 .../throttling/manager/rules/RuleProperty.java  |  45 ++
 .../manager/scheduling/ThrottlingJob.java       | 120 +++
 .../services/MultitenancyThrottlingService.java |  59 ++
 .../services/ThrottlingRuleEditorService.java   |  90 +++
 .../stratos/throttling/manager/tasks/Task.java  |  94 +++
 .../manager/utils/DataProviderIterator.java     |  72 ++
 .../stratos/throttling/manager/utils/Util.java  | 464 ++++++++++++
 .../validation/ValidationInfoManager.java       | 122 ++++
 .../src/main/resources/META-INF/component.xml   |  40 +
 .../src/main/resources/META-INF/services.xml    |  59 ++
 .../carbon/throttling/test/ThrottlingTest.java  | 228 ++++++
 .../throttling/test/utils/BaseTestCase.java     | 116 +++
 .../test/utils/CustomDataProvider.java          |  46 ++
 .../resources/carbon-home/dbscripts/db2.sql     | 450 ++++++++++++
 .../resources/carbon-home/dbscripts/derby.sql   | 364 ++++++++++
 .../test/resources/carbon-home/dbscripts/h2.sql | 337 +++++++++
 .../resources/carbon-home/dbscripts/mssql.sql   | 494 +++++++++++++
 .../resources/carbon-home/dbscripts/mysql.sql   | 370 ++++++++++
 .../resources/carbon-home/dbscripts/oracle.sql  | 644 ++++++++++++++++
 .../carbon-home/dbscripts/oracle_rac.sql        | 644 ++++++++++++++++
 .../carbon-home/dbscripts/postgresql.sql        | 427 +++++++++++
 .../resources/carbon-home/repository/README     |  22 +
 .../carbon-home/repository/conf/README          |  39 +
 .../carbon-home/repository/conf/axis2.xml       | 633 ++++++++++++++++
 .../repository/conf/axis2_client.xml            | 283 +++++++
 .../repository/conf/broker-config.xml           |  55 ++
 .../carbon-home/repository/conf/carbon.xml      | 354 +++++++++
 .../repository/conf/cipher-text.properties      |   8 +
 .../repository/conf/mgt-transports.xml          |  87 +++
 .../carbon-home/repository/conf/mime.types      | 728 +++++++++++++++++++
 .../repository/conf/node/registry.xml           |  84 +++
 .../repository/conf/node/user-mgt.xml           | 106 +++
 .../repository/conf/ports-config.xml            |  58 ++
 .../carbon-home/repository/conf/registry.xml    | 102 +++
 .../repository/conf/secret-conf.properties      |  37 +
 .../carbon-home/repository/conf/synapse.xml     |  31 +
 .../repository/conf/throttling-config1.xml      |  48 ++
 .../repository/conf/throttling-config2.xml      |  48 ++
 .../repository/conf/throttling-config3.xml      |  48 ++
 .../repository/conf/throttling-rules1.drl       |  60 ++
 .../repository/conf/throttling-rules2.drl       |  18 +
 .../repository/conf/throttling-rules3.drl       |  17 +
 .../carbon-home/repository/conf/user-mgt.xml    | 117 +++
 .../carbon-home/repository/conf/wrapper.conf    | 125 ++++
 .../carbon-home/repository/logs/README          |   1 +
 .../src/test/resources/registry.xml             | 250 +++++++
 .../user-test/adv-jdbc-readonly-test.xml        |  60 ++
 .../resources/user-test/jdbc-readonly-test.xml  |  60 ++
 .../user-test/user-mgt-registry-test.xml        |  95 +++
 .../test/resources/user-test/user-mgt-test.xml  |  96 +++
 .../org.apache.stratos.throttling.ui/pom.xml    | 126 ++++
 .../ui/clients/ThrottlingRuleEditorClient.java  |  98 +++
 .../src/main/resources/META-INF/component.xml   |  37 +
 .../resources/ThrottlingRuleEditorService.wsdl  | 148 ++++
 .../throttling/ui/i18n/JSResources.properties   |   1 +
 .../throttling/ui/i18n/Resources.properties     |   2 +
 .../web/mt-throttling/docs/images/add-org.png   | Bin 0 -> 49926 bytes
 .../web/mt-throttling/docs/userguide.html       |  35 +
 .../web/mt-throttling/images/throttling.gif     | Bin 0 -> 1008 bytes
 .../resources/web/mt-throttling/throttling.jsp  | 104 +++
 .../mt-throttling/throttling_ajaxprocessor.jsp  |  30 +
 .../2.1.0/pom.xml                               | 136 ----
 .../throttling/agent/ThrottlingAgent.java       | 244 -------
 .../Axis2ConfigurationContextObserverImpl.java  |  42 --
 .../agent/cache/TenantThrottlingInfo.java       |  53 --
 .../agent/cache/ThrottlingActionInfo.java       |  37 -
 .../agent/cache/ThrottlingInfoCache.java        | 118 ---
 .../cache/ThrottlingInfoCacheUpdaterTask.java   |  79 --
 .../MultitenancyThrottlingServiceClient.java    |  62 --
 .../agent/client/ThrottlingRuleInvoker.java     |  20 -
 .../conf/ThrottlingAgentConfiguration.java      |  85 ---
 .../ThrottlingAgentServiceComponent.java        | 193 -----
 .../listeners/PerRegistryRequestListener.java   | 116 ---
 .../agent/listeners/PerUserAddListener.java     |  87 ---
 .../agent/listeners/ServiceRequestListener.java | 113 ---
 .../agent/listeners/ThrottlingModule.java       |  49 --
 .../agent/listeners/WebAppRequestListener.java  | 179 -----
 .../agent/validation/ValidationException.java   |  25 -
 .../agent/validation/ValidationInfo.java        |  39 -
 .../validation/ValidationInfoRetriever.java     | 109 ---
 .../src/main/resources/META-INF/module.xml      |  33 -
 .../MultitenancyThrottlingService.wsdl          |  82 ---
 .../2.1.0/pom.xml                               | 170 -----
 .../manager/conf/ThrottlingConfiguration.java   | 104 ---
 .../conf/ThrottlingTaskConfiguration.java       | 117 ---
 ...ThrottlingTaskDataProviderConfiguration.java | 114 ---
 .../dataobjects/ThrottlingAccessValidation.java |  70 --
 .../dataobjects/ThrottlingDataContext.java      | 145 ----
 .../dataobjects/ThrottlingDataEntry.java        |  84 ---
 .../ThrottlingDataEntryConstants.java           |  41 --
 .../dataproviders/BillingDataProvider.java      |  52 --
 .../manager/dataproviders/DataProvider.java     |  35 -
 .../dataproviders/UsageDataProvider.java        | 103 ---
 .../manager/exception/ThrottlingException.java  |  25 -
 .../ThrottlingManagerServiceComponent.java      | 129 ----
 .../manager/rules/KnowledgeBaseManager.java     |  70 --
 .../throttling/manager/rules/RuleInvoker.java   |  89 ---
 .../throttling/manager/rules/RuleProperty.java  |  42 --
 .../manager/scheduling/ThrottlingJob.java       | 117 ---
 .../services/MultitenancyThrottlingService.java |  58 --
 .../services/ThrottlingRuleEditorService.java   |  87 ---
 .../carbon/throttling/manager/tasks/Task.java   |  91 ---
 .../manager/utils/DataProviderIterator.java     |  69 --
 .../carbon/throttling/manager/utils/Util.java   | 461 ------------
 .../validation/ValidationInfoManager.java       | 119 ---
 .../src/main/resources/META-INF/component.xml   |  37 -
 .../src/main/resources/META-INF/services.xml    |  49 --
 .../carbon/throttling/test/ThrottlingTest.java  | 226 ------
 .../throttling/test/utils/BaseTestCase.java     | 113 ---
 .../test/utils/CustomDataProvider.java          |  43 --
 .../resources/carbon-home/dbscripts/db2.sql     | 450 ------------
 .../resources/carbon-home/dbscripts/derby.sql   | 364 ----------
 .../test/resources/carbon-home/dbscripts/h2.sql | 337 ---------
 .../resources/carbon-home/dbscripts/mssql.sql   | 494 -------------
 .../resources/carbon-home/dbscripts/mysql.sql   | 370 ----------
 .../resources/carbon-home/dbscripts/oracle.sql  | 644 ----------------
 .../carbon-home/dbscripts/oracle_rac.sql        | 644 ----------------
 .../carbon-home/dbscripts/postgresql.sql        | 427 -----------
 .../resources/carbon-home/repository/README     |  22 -
 .../carbon-home/repository/conf/README          |  39 -
 .../carbon-home/repository/conf/axis2.xml       | 630 ----------------
 .../repository/conf/axis2_client.xml            | 280 -------
 .../repository/conf/broker-config.xml           |  52 --
 .../carbon-home/repository/conf/carbon.xml      | 351 ---------
 .../repository/conf/cipher-text.properties      |   8 -
 .../repository/conf/mgt-transports.xml          |  84 ---
 .../carbon-home/repository/conf/mime.types      | 727 ------------------
 .../repository/conf/node/registry.xml           |  81 ---
 .../repository/conf/node/user-mgt.xml           | 105 ---
 .../repository/conf/ports-config.xml            |  55 --
 .../carbon-home/repository/conf/registry.xml    |  99 ---
 .../repository/conf/secret-conf.properties      |  37 -
 .../carbon-home/repository/conf/synapse.xml     |  30 -
 .../repository/conf/throttling-config1.xml      |  47 --
 .../repository/conf/throttling-config2.xml      |  47 --
 .../repository/conf/throttling-config3.xml      |  47 --
 .../repository/conf/throttling-rules1.drl       |  60 --
 .../repository/conf/throttling-rules2.drl       |  18 -
 .../repository/conf/throttling-rules3.drl       |  17 -
 .../carbon-home/repository/conf/user-mgt.xml    | 114 ---
 .../carbon-home/repository/conf/wrapper.conf    | 125 ----
 .../carbon-home/repository/logs/README          |   1 -
 .../2.1.0/src/test/resources/registry.xml       | 247 -------
 .../user-test/adv-jdbc-readonly-test.xml        |  59 --
 .../resources/user-test/jdbc-readonly-test.xml  |  59 --
 .../user-test/user-mgt-registry-test.xml        |  94 ---
 .../test/resources/user-test/user-mgt-test.xml  |  95 ---
 .../org.wso2.carbon.throttling.ui/2.1.0/pom.xml | 120 ---
 .../ui/clients/ThrottlingRuleEditorClient.java  |  97 ---
 .../src/main/resources/META-INF/component.xml   |  36 -
 .../resources/ThrottlingRuleEditorService.wsdl  | 148 ----
 .../throttling/ui/i18n/JSResources.properties   |   1 -
 .../throttling/ui/i18n/Resources.properties     |   2 -
 .../web/mt-throttling/docs/images/add-org.png   | Bin 49926 -> 0 bytes
 .../web/mt-throttling/docs/userguide.html       |  35 -
 .../web/mt-throttling/images/throttling.gif     | Bin 1008 -> 0 bytes
 .../resources/web/mt-throttling/throttling.jsp  | 103 ---
 .../mt-throttling/throttling_ajaxprocessor.jsp  |  29 -
 components/stratos/throttling/pom.xml           |  42 --
 195 files changed, 12876 insertions(+), 12734 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/pom.xml b/components/org.apache.stratos.throttling.agent/pom.xml
new file mode 100644
index 0000000..5a92a50
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/pom.xml
@@ -0,0 +1,138 @@
+<!-- 
+  #  Licensed to the Apache Software Foundation (ASF) under one
+  #  or more contributor license agreements.  See the NOTICE file
+  #  distributed with this work for additional information
+  #  regarding copyright ownership.  The ASF licenses this file
+  #  to you under the Apache License, Version 2.0 (the
+  #  "License"); you may not use this file except in compliance
+  #  with the License.  You may obtain a copy of the License at
+  #  
+  #  http://www.apache.org/licenses/LICENSE-2.0
+  #  
+  #  Unless required by applicable law or agreed to in writing,
+  #  software distributed under the License is distributed on an
+  #  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  #  KIND, either express or implied.  See the License for the
+  #  specific language governing permissions and limitations
+  #  under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>stratos-components-parent</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.apache.stratos.throttling.agent</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache Stratos - Throttling Agent</name>
+
+    <build>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        <Bundle-Name>${project.artifactId}</Bundle-Name>
+                        <Axis2Module>${project.artifactId}-${project.version}</Axis2Module>
+                        <ListenerManager-RequiredServices>
+                            org.apache.stratos.throttling.agent.ThrottlingAgent
+                        </ListenerManager-RequiredServices>
+                        <Export-Package>
+                            org.apache.stratos.throttling.agent.client,
+                            org.apache.stratos.throttling.agent.*,
+                        </Export-Package>
+                        <Private-Package>
+                            !org.apache.stratos.throttling.agent.client,
+                            org.apache.stratos.throttling.agent.*,
+                        </Private-Package>
+                        <Import-Package>
+                            org.wso2.carbon.throttling.agent.stub.*;
+                            version="${carbon.platform.package.import.version.range}",
+                            org.apache.stratos.common.*,
+                            org.wso2.carbon.server.*,
+                            org.wso2.carbon.registry.core.*;version=1.0.1,
+                            org.wso2.carbon.registry.resource.*,
+                            !javax.xml.namespace,
+                            javax.xml.namespace; version=0.0.0,
+                            javax.servlet;version="${imp.pkg.version.javax.servlet}",
+                            javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
+                            org.apache.axiom.*; version="${axiom.osgi.version.range}",
+                            *;resolution:=optional
+                        </Import-Package>
+                        <DynamicImport-Package>*</DynamicImport-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.axis2.wso2</groupId>
+            <artifactId>axis2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.utils</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.core</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.extensions</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.resource</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.common</artifactId>
+	    <version>${apache.stratos.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+	    <artifactId>org.wso2.carbon.throttling.agent.stub</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.server</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.tomcat.ext</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/ThrottlingAgent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/ThrottlingAgent.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/ThrottlingAgent.java
new file mode 100644
index 0000000..b8665e9
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/ThrottlingAgent.java
@@ -0,0 +1,246 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.throttling.agent;
+
+import org.apache.stratos.throttling.agent.cache.TenantThrottlingInfo;
+import org.apache.stratos.throttling.agent.cache.ThrottlingActionInfo;
+import org.apache.stratos.throttling.agent.cache.ThrottlingInfoCache;
+import org.apache.stratos.throttling.agent.cache.ThrottlingInfoCacheUpdaterTask;
+import org.apache.stratos.throttling.agent.client.MultitenancyThrottlingServiceClient;
+import org.apache.stratos.throttling.agent.client.ThrottlingRuleInvoker;
+import org.apache.stratos.throttling.agent.conf.ThrottlingAgentConfiguration;
+import org.apache.stratos.throttling.agent.listeners.PerRegistryRequestListener;
+import org.apache.stratos.throttling.agent.listeners.PerUserAddListener;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.framework.BundleContext;
+import org.osgi.util.tracker.ServiceTracker;
+import org.wso2.carbon.base.ServerConfiguration;
+import org.wso2.carbon.context.CarbonContext;
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.config.RegistryContext;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.registry.core.service.RegistryService;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.apache.stratos.common.util.MeteringAccessValidationUtils;
+import org.apache.stratos.common.util.StratosConfiguration;
+import org.wso2.carbon.user.core.listener.UserStoreManagerListener;
+import org.wso2.carbon.user.core.service.RealmService;
+import org.wso2.carbon.utils.CarbonUtils;
+import org.wso2.carbon.utils.ConfigurationContextService;
+
+import java.io.File;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+
+public class ThrottlingAgent {
+    private static final Log log = LogFactory.getLog(ThrottlingAgent.class);
+
+    private static final String CONFIG_FILE = "throttling-agent-config.xml";
+    private static final String MANAGER_SERVER_URL_PARAM_NAME = "managerServiceUrl";
+    private static final String USERNAME_PARAM_NAME = "userName";
+    private static final String PASSWORD_PARAM_NAME = "password";
+
+    private ThrottlingAgentConfiguration configuration;
+
+    private RegistryService registryService;
+
+    private RealmService realmService;
+
+    private ConfigurationContextService configurationContextService;
+
+    private ThrottlingInfoCache throttlingInfoCache;
+
+    private ServiceTracker throttlingRuleInvokerTracker = null;
+
+    private ScheduledExecutorService scheduler;
+
+    private BundleContext bundleContext;
+    private StratosConfiguration stratosConfiguration=null;
+
+    public StratosConfiguration getStratosConfiguration() {
+        return stratosConfiguration;
+    }
+
+    public void setStratosConfiguration(StratosConfiguration stratosConfiguration) {
+        this.stratosConfiguration = stratosConfiguration;
+    }
+
+    public ThrottlingAgent(BundleContext bundleContext) throws Exception {
+        this.scheduler = Executors.newScheduledThreadPool(1, new ThrottlingAgentThreadFactory());
+        this.throttlingInfoCache = new ThrottlingInfoCache();
+        this.bundleContext = bundleContext;
+    }
+
+    public void init() throws RegistryException {
+
+        if("true".equals(ServerConfiguration.getInstance().getFirstProperty("EnableMetering"))){
+
+            UserRegistry superTenantGovernanceRegistry = registryService.getGovernanceSystemRegistry();
+
+            scheduler.scheduleAtFixedRate(
+                    new ThrottlingInfoCacheUpdaterTask(throttlingInfoCache, superTenantGovernanceRegistry), 2, 15,
+                    TimeUnit.MINUTES);
+
+            PerRegistryRequestListener.registerPerRegistryRequestListener(RegistryContext.getBaseInstance());
+            if (bundleContext != null) {
+                bundleContext.registerService(UserStoreManagerListener.class.getName(),
+                        new PerUserAddListener(), null);
+            }
+
+        }
+        throttlingRuleInvokerTracker = new ServiceTracker(bundleContext, ThrottlingRuleInvoker.class.getName(),
+                null);
+        throttlingRuleInvokerTracker.open();
+    }
+
+    public ThrottlingInfoCache getThrottlingInfoCache() {
+        return throttlingInfoCache;
+    }
+
+    public void setRegistryService(RegistryService registryService) {
+        this.registryService = registryService;
+    }
+
+    public RegistryService getRegistryService(){
+        return this.registryService;
+    }
+
+    public void setRealmService(RealmService realmService) {
+        this.realmService = realmService;
+    }
+
+    public RealmService getRealmService() {
+        return realmService;
+    }
+
+    public void setConfigurationContextService(ConfigurationContextService configurationContextService) {
+        this.configurationContextService = configurationContextService;
+    }
+
+    public ConfigurationContextService getConfigurationContextService() {
+        return configurationContextService;
+    }
+
+    public void updateThrottlingCacheForTenant() throws Exception {
+        // TODO: Need to refactor this and updater task
+
+        int tenantId = CarbonContext.getCurrentContext().getTenantId();
+
+        String tenantValidationInfoResourcePath =
+                StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
+                        RegistryConstants.PATH_SEPARATOR + tenantId;
+        try {
+            if (registryService.getGovernanceSystemRegistry().resourceExists(tenantValidationInfoResourcePath)) {
+                Resource tenantValidationInfoResource =
+                        registryService.getGovernanceSystemRegistry().get(tenantValidationInfoResourcePath);
+                Properties properties = tenantValidationInfoResource.getProperties();
+                Set<String> actions = MeteringAccessValidationUtils.getAvailableActions(properties);
+                for (String action : actions) {
+                    String blocked =
+                            tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
+                                    .generateIsBlockedPropertyKey(action));
+
+                    String blockMessage =
+                            tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
+                                    .generateErrorMsgPropertyKey(action));
+                    TenantThrottlingInfo tenantThrottlingInfo = throttlingInfoCache.getTenantThrottlingInfo(tenantId);
+                    if (tenantThrottlingInfo == null) {
+                        throttlingInfoCache.addTenant(tenantId);
+                        tenantThrottlingInfo = throttlingInfoCache.getTenantThrottlingInfo(tenantId);
+                    }
+                    tenantThrottlingInfo.updateThrottlingActionInfo(action,
+                            new ThrottlingActionInfo("true".equals(blocked), blockMessage));
+                }
+            }
+        } catch (RegistryException re) {
+            String msg =
+                    "Error while getting throttling info for tenant " + tenantId + ".";
+            log.error(msg, re);
+        }
+    }
+
+    private ThrottlingAgentConfiguration loadThrottlingConfiguration() throws Exception {
+        // it is acceptable that throttling agent file is not present, when the
+        // embedded rule invoker is in use.
+        ThrottlingAgentConfiguration throttlingAgentConfig = null;
+        String configFileName = CarbonUtils.getCarbonConfigDirPath() + File.separator +
+                StratosConstants.MULTITENANCY_CONFIG_FOLDER + File.separator + CONFIG_FILE;
+        if (new File(configFileName).exists()) {
+            throttlingAgentConfig = new ThrottlingAgentConfiguration(configFileName);
+        } else {
+            log.warn("Throttling agent config file is not present. File name: " + configFileName + ".");
+        }
+
+        return throttlingAgentConfig;
+    }
+
+    public ThrottlingRuleInvoker getThrottlingRuleInvoker() throws Exception {
+        // first check the OSGi service exists, if so return it
+        ThrottlingRuleInvoker embeddedRuleInvoker =
+                (ThrottlingRuleInvoker) throttlingRuleInvokerTracker.getService();
+        if (embeddedRuleInvoker != null) {
+            return embeddedRuleInvoker;
+        }
+
+
+        if (stratosConfiguration == null) {
+            String msg =
+                    "Neither embedded nor web service implementation of throttling rule invoker found.";
+            log.error(msg);
+            throw new Exception(msg);
+        }
+        String serverUrl = stratosConfiguration.getManagerServiceUrl();
+        String userName =stratosConfiguration.getAdminUserName() ;
+        String password = stratosConfiguration.getAdminPassword();
+
+        return new MultitenancyThrottlingServiceClient(serverUrl, userName, password);
+    }
+
+    public void executeManagerThrottlingRules(int tenantId) throws Exception {
+        ThrottlingRuleInvoker client = getThrottlingRuleInvoker();
+        client.executeThrottlingRules(tenantId);
+    }
+
+
+    class ThrottlingAgentThreadFactory implements ThreadFactory {
+        private int counter = 0;
+
+        public Thread newThread(Runnable r) {
+            return new Thread(r, "ThrottlingAgentThreadFactory-" + counter++);
+        }
+    }
+
+    public void executeThrottlingRules(int tenantId) {
+        try {
+            executeManagerThrottlingRules(tenantId);
+            updateThrottlingCacheForTenant();
+        } catch (Exception e) {
+            log.error("Error in executing throttling rules");
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/Axis2ConfigurationContextObserverImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/Axis2ConfigurationContextObserverImpl.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/Axis2ConfigurationContextObserverImpl.java
new file mode 100644
index 0000000..9467b61
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/Axis2ConfigurationContextObserverImpl.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.throttling.agent.cache;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.wso2.carbon.utils.AbstractAxis2ConfigurationContextObserver;
+import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
+
+/**
+ * Axis configuration context observer which add and remove lazy loaded/unloaded tenants to throttling information
+ * cache.
+ */
+public class Axis2ConfigurationContextObserverImpl extends AbstractAxis2ConfigurationContextObserver{
+
+    private ThrottlingInfoCache throttlingInfoCache;
+
+    public Axis2ConfigurationContextObserverImpl(ThrottlingInfoCache throttlingInfoCache){
+        this.throttlingInfoCache = throttlingInfoCache;
+    }
+
+    public void createdConfigurationContext(ConfigurationContext configContext) {
+        throttlingInfoCache.addTenant(MultitenantUtils.getTenantId(configContext));
+    }
+
+    public void terminatedConfigurationContext(ConfigurationContext configCtx) {
+        throttlingInfoCache.deleteTenant(MultitenantUtils.getTenantId(configCtx));
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/TenantThrottlingInfo.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/TenantThrottlingInfo.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/TenantThrottlingInfo.java
new file mode 100644
index 0000000..6ea5db6
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/TenantThrottlingInfo.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.throttling.agent.cache;
+
+import org.apache.stratos.common.constants.StratosConstants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class TenantThrottlingInfo {
+    private Map<String, ThrottlingActionInfo> throttlingActionInfoMap = new HashMap<String, ThrottlingActionInfo>();
+
+    public ThrottlingActionInfo getThrottlingActionInfo(String action) {
+        if(throttlingActionInfoMap.get(action) != null){
+            return throttlingActionInfoMap.get(action);
+        }
+        return new ThrottlingActionInfo(false, "");
+    }
+
+    public ThrottlingActionInfo getThrottlingActionInfo(String[] actions) {
+        ThrottlingActionInfo actionInfo = throttlingActionInfoMap.get(StratosConstants.THROTTLING_ALL_ACTION);
+        if (actionInfo != null && actionInfo.isBlocked()) {
+            return actionInfo;
+        }
+
+        for (String action : actions) {
+            actionInfo = throttlingActionInfoMap.get(action);
+            if (actionInfo != null && actionInfo.isBlocked()) {
+                return actionInfo;
+            }
+        }
+
+        return new ThrottlingActionInfo(false, "");
+    }
+
+    public void updateThrottlingActionInfo(String action, ThrottlingActionInfo throttlingActionInfo) {
+        throttlingActionInfoMap.put(action, throttlingActionInfo);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/ThrottlingActionInfo.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/ThrottlingActionInfo.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/ThrottlingActionInfo.java
new file mode 100644
index 0000000..9a09f06
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/ThrottlingActionInfo.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.throttling.agent.cache;
+
+public class ThrottlingActionInfo {
+    private boolean blocked = false;
+
+    private String message = "";
+
+    public ThrottlingActionInfo(boolean blocked, String message) {
+        this.blocked = blocked;
+        this.message = message;
+    }
+
+    public boolean isBlocked() {
+        return blocked;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/ThrottlingInfoCache.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/ThrottlingInfoCache.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/ThrottlingInfoCache.java
new file mode 100644
index 0000000..3bf9f40
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/ThrottlingInfoCache.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.throttling.agent.cache;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.registry.api.RegistryService;
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.apache.stratos.common.util.MeteringAccessValidationUtils;
+import org.apache.stratos.throttling.agent.internal.ThrottlingAgentServiceComponent;
+
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * In memory cache which keeps throttling information for active tenants(local to a server instance). Cache is updated
+ * periodically using information retrieved from registry.
+ */
+public class ThrottlingInfoCache {
+
+    private static final Log log = LogFactory.getLog(ThrottlingInfoCache.class);
+
+    private Map<Integer, TenantThrottlingInfo> tenantThrottlingInfoMap =
+            new ConcurrentHashMap<Integer, TenantThrottlingInfo>();
+
+    public void addTenant(int tenantId){
+        if(!tenantThrottlingInfoMap.containsKey(tenantId)){
+            tenantThrottlingInfoMap.put(tenantId, getTenantThrottlingInfoFromRegistry(tenantId));
+        }
+    }
+
+    public void deleteTenant(int tenantId){
+        tenantThrottlingInfoMap.remove(tenantId);
+    }
+
+    public Set<Integer> getActiveTenants(){
+        return tenantThrottlingInfoMap.keySet();
+    }
+
+    public void updateThrottlingActionInfo(int tenantId, String action, ThrottlingActionInfo throttlingActionInfo){
+        // throttlingInfo could never be null if the update and lazy loading logic are correct.
+        TenantThrottlingInfo throttlingInfo = tenantThrottlingInfoMap.get(tenantId);
+        throttlingInfo.updateThrottlingActionInfo(action, throttlingActionInfo);
+    }
+
+    public ThrottlingActionInfo getThrottlingActionInfo(int tenantId, String action){
+        if(tenantThrottlingInfoMap.get(tenantId) != null){
+            return tenantThrottlingInfoMap.get(tenantId).getThrottlingActionInfo(action);
+        }
+
+        // This could happen if user has never perform this action before or throttling info cache updating task
+        // has not executed for this tenant. TODO: Check the validity
+        return null;
+    }
+
+    public TenantThrottlingInfo getTenantThrottlingInfo(int tenantId){
+        if(!tenantThrottlingInfoMap.containsKey(tenantId)){
+            tenantThrottlingInfoMap.put(tenantId, getTenantThrottlingInfoFromRegistry(tenantId));
+        }
+        return tenantThrottlingInfoMap.get(tenantId);
+    }
+
+    private TenantThrottlingInfo getTenantThrottlingInfoFromRegistry (int tenantId) {
+        log.info("Tenant throttling info is not in the cache. Hence, getting it from registry");
+        RegistryService registryService = ThrottlingAgentServiceComponent.getThrottlingAgent().
+                                            getRegistryService();
+        TenantThrottlingInfo tenantThrottlingInfo = new TenantThrottlingInfo();
+        try{
+            UserRegistry superTenantGovernanceRegistry = (UserRegistry)registryService.getGovernanceSystemRegistry();
+            String tenantValidationInfoResourcePath =
+                    StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
+                            RegistryConstants.PATH_SEPARATOR + tenantId;
+
+            if (superTenantGovernanceRegistry.resourceExists(tenantValidationInfoResourcePath)) {
+                Resource tenantValidationInfoResource =
+                        superTenantGovernanceRegistry.get(tenantValidationInfoResourcePath);
+                Properties properties = tenantValidationInfoResource.getProperties();
+                Set<String> actions = MeteringAccessValidationUtils.getAvailableActions(properties);
+                for (String action : actions) {
+                    String blocked =
+                            tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
+                                    .generateIsBlockedPropertyKey(action));
+
+                    String blockMessage =
+                            tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
+                                    .generateErrorMsgPropertyKey(action));
+
+                    tenantThrottlingInfo.updateThrottlingActionInfo(action,
+                            new ThrottlingActionInfo("true".equals(blocked), blockMessage));
+                }
+            }
+        } catch (Exception e){
+            log.error("Error occurred while obtaining governance system registry from registry service", e);
+        }
+
+        return tenantThrottlingInfo;
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/ThrottlingInfoCacheUpdaterTask.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/ThrottlingInfoCacheUpdaterTask.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/ThrottlingInfoCacheUpdaterTask.java
new file mode 100644
index 0000000..3bfdda4
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/cache/ThrottlingInfoCacheUpdaterTask.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.throttling.agent.cache;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.apache.stratos.common.util.MeteringAccessValidationUtils;
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+
+import java.util.Properties;
+import java.util.Set;
+
+public class ThrottlingInfoCacheUpdaterTask implements Runnable {
+    private static final Log log = LogFactory.getLog(ThrottlingInfoCacheUpdaterTask.class);
+
+    private ThrottlingInfoCache cache;
+    private UserRegistry governanceSystemRegistry;
+
+    public ThrottlingInfoCacheUpdaterTask(ThrottlingInfoCache cache, UserRegistry governanceSystemRegistry) {
+        this.cache = cache;
+        this.governanceSystemRegistry = governanceSystemRegistry;
+    }
+
+    public void run() {
+        log.info("Running throttling info cache updater task");
+        Set<Integer> activeTenants = cache.getActiveTenants();
+        for (Integer tenant : activeTenants) {
+            String tenantValidationInfoResourcePath =
+                    StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
+                            RegistryConstants.PATH_SEPARATOR + tenant;
+            try {
+                if (governanceSystemRegistry.resourceExists(tenantValidationInfoResourcePath)) {
+                    Resource tenantValidationInfoResource =
+                            governanceSystemRegistry.get(tenantValidationInfoResourcePath);
+                    Properties properties = tenantValidationInfoResource.getProperties();
+                    Set<String> actions = MeteringAccessValidationUtils.getAvailableActions(properties);
+                    for (String action : actions) {
+                        String blocked =
+                                tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
+                                        .generateIsBlockedPropertyKey(action));
+                        if(log.isDebugEnabled()){
+                            log.debug("Action: " + action + " blocked: " + blocked + " tenant: " + tenant);
+                        }
+
+                        String blockMessage =
+                                tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
+                                        .generateErrorMsgPropertyKey(action));
+                        TenantThrottlingInfo tenantThrottlingInfo = cache.getTenantThrottlingInfo(tenant);
+
+                        tenantThrottlingInfo.updateThrottlingActionInfo(action,
+                                new ThrottlingActionInfo("true".equals(blocked), blockMessage));
+                    }
+                }
+            } catch (RegistryException re) {
+                String msg =
+                        "Error while getting throttling info for tenant " + tenant + ".";
+                log.error(msg, re);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/client/MultitenancyThrottlingServiceClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/client/MultitenancyThrottlingServiceClient.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/client/MultitenancyThrottlingServiceClient.java
new file mode 100644
index 0000000..40a901e
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/client/MultitenancyThrottlingServiceClient.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.agent.client;
+
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.wso2.carbon.authenticator.proxy.AuthenticationAdminClient;
+import org.apache.stratos.throttling.agent.internal.ThrottlingAgentServiceComponent;
+import org.wso2.carbon.throttling.agent.stub.services.MultitenancyThrottlingServiceStub;
+
+public class MultitenancyThrottlingServiceClient implements ThrottlingRuleInvoker {
+    MultitenancyThrottlingServiceStub stub;
+
+    public MultitenancyThrottlingServiceClient(String serverUrl, String userName, String password)
+            throws Exception {
+        stub =
+                new MultitenancyThrottlingServiceStub(ThrottlingAgentServiceComponent.getThrottlingAgent().getConfigurationContextService()
+                        .getClientConfigContext(), serverUrl + "MultitenancyThrottlingService");
+        ServiceClient client = stub._getServiceClient();
+        Options option = client.getOptions();
+        option.setManageSession(true);
+        String cookie = login(serverUrl, userName, password);
+        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
+    }
+
+    public static String login(String serverUrl, String userName, String password) throws Exception {
+        String sessionCookie = null;
+        try {
+            AuthenticationAdminClient client =
+                    new AuthenticationAdminClient(ThrottlingAgentServiceComponent.getThrottlingAgent().getConfigurationContextService()
+                            .getClientConfigContext(), 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 Exception("Error in login to throttling manager. server: " + serverUrl +
+                    "username: " + userName + ".", e);
+        }
+        return sessionCookie;
+    }
+
+
+    public void executeThrottlingRules(int tenantId) throws Exception {
+        stub.executeThrottlingRules(tenantId);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/client/ThrottlingRuleInvoker.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/client/ThrottlingRuleInvoker.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/client/ThrottlingRuleInvoker.java
new file mode 100644
index 0000000..10bdc8e
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/client/ThrottlingRuleInvoker.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.agent.client;
+
+public interface ThrottlingRuleInvoker {
+    public void executeThrottlingRules(int tenantId) throws Exception;
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/conf/ThrottlingAgentConfiguration.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/conf/ThrottlingAgentConfiguration.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/conf/ThrottlingAgentConfiguration.java
new file mode 100644
index 0000000..b4fb8af
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/conf/ThrottlingAgentConfiguration.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.agent.conf;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.util.CommonUtil;
+
+public class ThrottlingAgentConfiguration {
+    private static final Log log = LogFactory.getLog(ThrottlingAgentConfiguration.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 ThrottlingAgentConfiguration(String throttlingConfigFile) throws Exception {
+        try {
+            OMElement meteringConfig =
+                    CommonUtil.buildOMElement(new FileInputStream(throttlingConfigFile));
+            deserialize(meteringConfig);
+        } catch (FileNotFoundException e) {
+            String msg = "Unable to find the file: " + throttlingConfigFile + ".";
+            log.error(msg, e);
+            throw new Exception(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;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/internal/ThrottlingAgentServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/internal/ThrottlingAgentServiceComponent.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/internal/ThrottlingAgentServiceComponent.java
new file mode 100644
index 0000000..161ae37
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/internal/ThrottlingAgentServiceComponent.java
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.agent.internal;
+
+import org.apache.stratos.throttling.agent.cache.Axis2ConfigurationContextObserverImpl;
+import org.apache.stratos.throttling.agent.cache.ThrottlingInfoCache;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.component.ComponentContext;
+import org.wso2.carbon.base.ServerConfiguration;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.registry.core.service.RegistryService;
+import org.apache.stratos.throttling.agent.ThrottlingAgent;
+import org.apache.stratos.throttling.agent.listeners.WebAppRequestListener;
+import org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve;
+import org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer;
+import org.wso2.carbon.user.core.service.RealmService;
+import org.wso2.carbon.utils.Axis2ConfigurationContextObserver;
+import org.wso2.carbon.utils.ConfigurationContextService;
+import org.apache.stratos.common.util.StratosConfiguration;
+
+import java.util.ArrayList;
+
+/**
+ * @scr.component name="org.wso2.carbon.throttling.agent"
+ * 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"
+ * @scr.reference name="stratos.config.service"
+ * interface="org.apache.stratos.common.util.StratosConfiguration" cardinality="1..1"
+ * policy="dynamic" bind="setStratosConfigurationService" unbind="unsetStratosConfigurationService"
+ */
+public class ThrottlingAgentServiceComponent {
+    private static Log log = LogFactory.getLog(ThrottlingAgentServiceComponent.class);
+
+    private static ThrottlingAgent throttlingAgent;
+    private static RealmService realmService;
+    private static RegistryService registryService;
+    private static ConfigurationContextService contextService;
+    private static StratosConfiguration stratosConfiguration;
+
+    protected void activate(ComponentContext context) {
+        try {
+            BundleContext bundleContext = context.getBundleContext();
+            throttlingAgent = new ThrottlingAgent(bundleContext);
+            throttlingAgent.setConfigurationContextService(contextService);
+            throttlingAgent.setRealmService(realmService);
+            throttlingAgent.setRegistryService(registryService);
+            throttlingAgent.setStratosConfiguration(stratosConfiguration);
+
+            try {
+                // Throttling agent initialization require registry service.
+                throttlingAgent.init();
+            } catch (RegistryException e) {
+                String errMessage = "Failed to initialize throttling agent.";
+                log.error(errMessage, e);
+                throw new RuntimeException(errMessage, e);
+            }
+
+            if("true".equals(ServerConfiguration.getInstance().getFirstProperty("EnableMetering"))){
+                // Register the Tomcat Valve
+                ArrayList<CarbonTomcatValve> valves = new ArrayList<CarbonTomcatValve>();
+                valves.add(new WebAppRequestListener(throttlingAgent));
+                TomcatValveContainer.addValves(valves);
+
+                registerAxis2ConfigurationContextObserver(bundleContext, throttlingAgent.getThrottlingInfoCache());
+            }else{
+                log.debug("WebAppRequestListener valve was not added because metering is disabled in the configuration");
+                log.debug("Axis2ConfigurationContextObserver was not registered because metering is disabled");
+            }
+
+            registerThrottlingAgent(bundleContext);
+
+            log.debug("Multitenancy Throttling Agent bundle is activated.");
+        } catch (Throwable e) {
+            log.error("Multitenancy Throttling Agent bundle failed activating.", e);
+        }
+
+    }
+
+    private void registerAxis2ConfigurationContextObserver(BundleContext bundleContext, ThrottlingInfoCache cache) {
+        bundleContext.registerService(Axis2ConfigurationContextObserver.class.getName(),
+                new Axis2ConfigurationContextObserverImpl(cache),
+                null);
+    }
+
+    /**
+     * Register throttling agent service that use to update throttling rules when users try to
+     * upgrade down grade usage plans
+     *
+     * @param bundleContext bundle context that need to initialize throttling agent
+     */
+    public void registerThrottlingAgent(BundleContext bundleContext) {
+        try {
+            bundleContext.registerService(ThrottlingAgent.class.getName(),
+                    throttlingAgent,
+                    null);
+        }
+        catch (Exception e) {
+
+        }
+    }
+
+    protected void deactivate(ComponentContext context) {
+        //Util.uninitializeThrottlingRuleInvokerTracker();
+        log.debug("******* Multitenancy Throttling Agent bundle is deactivated ******* ");
+    }
+
+    protected void setRegistryService(RegistryService registryService) {
+        ThrottlingAgentServiceComponent.registryService = registryService;
+    }
+
+    protected void unsetRegistryService(RegistryService registryService) {
+        ThrottlingAgentServiceComponent.registryService = null;
+        throttlingAgent.setRegistryService(null);
+    }
+
+    protected void setRealmService(RealmService realmService) {
+        ThrottlingAgentServiceComponent.realmService = realmService;
+    }
+
+    protected void unsetRealmService(RealmService realmService) {
+        ThrottlingAgentServiceComponent.realmService = null;
+        throttlingAgent.setRealmService(null);
+    }
+
+    protected void setConfigurationContextService(ConfigurationContextService contextService) {
+        ThrottlingAgentServiceComponent.contextService = contextService;
+        
+        //this module is not necessary when we have the WebAppRequestListerner.
+        //It takes care of webapps and services. But this is not working for ESb
+        //When a solution for ESB is found, this module can be engaged again
+        /*try {
+            contextService.getServerConfigContext().getAxisConfiguration().engageModule(
+                    "usagethrottling");
+        } catch (AxisFault e) {
+            log.error("Failed to engage usage throttling module", e);
+        }*/
+    }
+
+    protected void unsetConfigurationContextService(ConfigurationContextService contextService) {
+        /*try {
+            AxisConfiguration axisConfig =
+                    contextService.getServerConfigContext().getAxisConfiguration();
+            axisConfig.disengageModule(axisConfig.getModule("usagethrottling"));
+        } catch (AxisFault e) {
+            log.error("Failed to disengage usage throttling module", e);
+        }*/
+        ThrottlingAgentServiceComponent.contextService = null;
+        throttlingAgent.setConfigurationContextService(null);
+    }
+
+    public static ThrottlingAgent getThrottlingAgent() {
+        return throttlingAgent;
+    }
+
+    protected void setStratosConfigurationService(StratosConfiguration stratosConfigService) {
+        ThrottlingAgentServiceComponent.stratosConfiguration=stratosConfigService;
+    }
+
+    protected void unsetStratosConfigurationService(StratosConfiguration ccService) {
+        ThrottlingAgentServiceComponent.stratosConfiguration = null;
+        throttlingAgent.setStratosConfiguration(null);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/PerRegistryRequestListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/PerRegistryRequestListener.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/PerRegistryRequestListener.java
new file mode 100644
index 0000000..826cc76
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/PerRegistryRequestListener.java
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.agent.listeners;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.CarbonConstants;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.config.RegistryContext;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.registry.core.jdbc.handlers.Handler;
+import org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager;
+import org.wso2.carbon.registry.core.jdbc.handlers.RequestContext;
+import org.wso2.carbon.registry.core.jdbc.handlers.filters.Filter;
+import org.wso2.carbon.registry.core.jdbc.handlers.filters.URLMatcher;
+import org.wso2.carbon.registry.core.session.CurrentSession;
+import org.apache.stratos.throttling.agent.cache.TenantThrottlingInfo;
+import org.apache.stratos.throttling.agent.cache.ThrottlingActionInfo;
+import org.apache.stratos.throttling.agent.internal.ThrottlingAgentServiceComponent;
+import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
+
+public class PerRegistryRequestListener extends Handler {
+
+    private static final Log log = LogFactory.getLog(PerRegistryRequestListener.class);
+
+    @Override
+    public void put(RequestContext context) throws RegistryException {
+        validateRegistryAction(StratosConstants.THROTTLING_IN_DATA_ACTION);
+    }
+
+    @Override
+    public void importResource(RequestContext context) throws RegistryException {
+        validateRegistryAction(StratosConstants.THROTTLING_IN_DATA_ACTION);
+    }
+
+    @Override
+    public Resource get(RequestContext context) throws RegistryException {
+        validateRegistryAction(StratosConstants.THROTTLING_OUT_DATA_ACTION);
+        return null;
+    }
+
+    @Override
+    public void dump(RequestContext requestContext) throws RegistryException {
+        validateRegistryAction(StratosConstants.THROTTLING_OUT_DATA_ACTION);
+    }
+
+    @Override
+    public void restore(RequestContext requestContext) throws RegistryException {
+        validateRegistryAction(StratosConstants.THROTTLING_IN_DATA_ACTION);
+    }
+
+    private void validateRegistryAction(String action) throws RegistryException {
+        if (CurrentSession.getCallerTenantId() == MultitenantConstants.SUPER_TENANT_ID
+                || CurrentSession.getTenantId() == MultitenantConstants.SUPER_TENANT_ID) {
+            // no limitations for the super tenant
+            return;
+        }
+        if (CarbonConstants.REGISTRY_SYSTEM_USERNAME.equals(CurrentSession.getUser()) ||
+                CarbonConstants.REGISTRY_ANONNYMOUS_USERNAME.equals(CurrentSession.getUser())) {
+            // skipping tracking for anonymous and system user
+            return;
+        }
+
+        // called only once per request..
+        if (CurrentSession.getAttribute(StratosConstants.REGISTRY_ACTION_VALIDATED_SESSION_ATTR) != null) {
+            return;
+        }
+        CurrentSession.setAttribute(StratosConstants.REGISTRY_ACTION_VALIDATED_SESSION_ATTR, true);
+
+        int tenantId = CurrentSession.getTenantId();
+
+        TenantThrottlingInfo tenantThrottlingInfo =
+                ThrottlingAgentServiceComponent.getThrottlingAgent().getThrottlingInfoCache()
+                        .getTenantThrottlingInfo(tenantId);
+        if(tenantThrottlingInfo!=null){
+            ThrottlingActionInfo actionInfo = tenantThrottlingInfo.getThrottlingActionInfo(action);
+
+            if (actionInfo != null && actionInfo.isBlocked()) {
+                String blockedMsg = actionInfo.getMessage();
+                String msg =
+                        "The throttling action is blocked. message: " + blockedMsg + ", action: " +
+                                action + ".";
+                log.error(msg);
+                // we are only throwing the blocked exception, as it is a error
+                // message for the user
+                throw new RegistryException(blockedMsg);
+            }
+        }
+    }
+
+    public static void registerPerRegistryRequestListener(RegistryContext registryContext) {
+        HandlerManager handlerManager = registryContext.getHandlerManager();
+        PerRegistryRequestListener storeBandwidthHandler = new PerRegistryRequestListener();
+        URLMatcher anyUrlMatcher = new URLMatcher();
+        anyUrlMatcher.setPattern(".*");
+        String[] applyingFilters =
+                new String[] { Filter.PUT, Filter.IMPORT, Filter.GET, Filter.DUMP, Filter.RESTORE, };
+
+        handlerManager.addHandlerWithPriority(
+                applyingFilters, anyUrlMatcher, storeBandwidthHandler);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/PerUserAddListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/PerUserAddListener.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/PerUserAddListener.java
new file mode 100644
index 0000000..f4ec4be
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/PerUserAddListener.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.agent.listeners;
+
+import org.apache.stratos.throttling.agent.cache.ThrottlingActionInfo;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.CarbonConstants;
+import org.wso2.carbon.base.ServerConfiguration;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.apache.stratos.throttling.agent.cache.TenantThrottlingInfo;
+import org.apache.stratos.throttling.agent.internal.ThrottlingAgentServiceComponent;
+import org.wso2.carbon.user.core.UserStoreException;
+import org.wso2.carbon.user.core.UserStoreManager;
+import org.wso2.carbon.user.core.common.AbstractUserStoreManagerListener;
+import org.wso2.carbon.user.core.listener.AuthorizationManagerListener;
+import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
+
+import java.util.Map;
+
+public class PerUserAddListener extends AbstractUserStoreManagerListener {
+    private static final Log log = LogFactory.getLog(PerUserAddListener.class);
+
+    public int getExecutionOrderId() {
+        return AuthorizationManagerListener.MULTITENANCY_USER_RESTRICTION_HANDLER;
+    }
+
+    @Override
+    public boolean addUser(String userName, Object credential, String[] roleList,
+                           Map<String, String> claims, String profileName, UserStoreManager userStoreManager)
+            throws UserStoreException {
+
+        //If this is not a cloud deployment there is no way to run the throttling rules
+        //This means the product is being used in the tenant mode
+        //Therefore we can ommit running the throttling rules
+        if("false".equals(ServerConfiguration.getInstance().getFirstProperty(CarbonConstants.IS_CLOUD_DEPLOYMENT))){
+            log.info("Omitting executing throttling rules becasue this is not a cloud deployment.");
+            return true;
+        }
+        int tenantId = userStoreManager.getTenantId();
+        if (tenantId == MultitenantConstants.SUPER_TENANT_ID) {
+            return true;
+        }
+        // running the rules invoking the remote throttling manager.
+        String[] users = userStoreManager.listUsers("*", -1);
+        if (users.length <= 1) {
+            // no filtering if the users count < 1
+            return true;
+        }
+
+        try {
+            ThrottlingAgentServiceComponent.getThrottlingAgent().executeManagerThrottlingRules(tenantId);
+            ThrottlingAgentServiceComponent.getThrottlingAgent().updateThrottlingCacheForTenant();
+        } catch (Exception e1) {
+            String msg = "Error in executing the throttling rules in manager.";
+            log.error(msg + " tenantId: " + tenantId + ".", e1);
+            throw new UserStoreException(msg, e1);
+        }
+        TenantThrottlingInfo throttlingInfo = ThrottlingAgentServiceComponent.getThrottlingAgent()
+                .getThrottlingInfoCache().getTenantThrottlingInfo(tenantId);
+        if(throttlingInfo!=null){
+            ThrottlingActionInfo actionInfo = throttlingInfo.getThrottlingActionInfo(StratosConstants.THROTTLING_ADD_USER_ACTION);
+
+            if (actionInfo!=null && actionInfo.isBlocked()) {
+                String blockedMsg = actionInfo.getMessage();
+                String msg = "The add user action is blocked. message: " + blockedMsg + ".";
+                log.error(msg);
+                // we are only throwing the blocked exception, as it is a error message for the user
+                throw new UserStoreException(blockedMsg);
+            }
+        }
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/ServiceRequestListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/ServiceRequestListener.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/ServiceRequestListener.java
new file mode 100644
index 0000000..5498b86
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/ServiceRequestListener.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.agent.listeners;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.handlers.AbstractHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.wso2.carbon.core.transports.metering.MeteredServletRequest;
+import org.apache.stratos.throttling.agent.cache.ThrottlingActionInfo;
+import org.apache.stratos.throttling.agent.cache.ThrottlingInfoCache;
+import org.apache.stratos.throttling.agent.internal.ThrottlingAgentServiceComponent;
+
+/**
+ * Checks whether the axis2 operations (service calls) are allowed. 
+ */
+public class ServiceRequestListener extends AbstractHandler {
+    private static final Log log = LogFactory.getLog(ServiceRequestListener.class);
+
+    public InvocationResponse invoke(MessageContext messageContext) throws AxisFault {
+        if (log.isDebugEnabled()) {
+            log.debug("Staring throttling handler invocation. Incoming message: " +
+                    messageContext.getEnvelope().toString());
+        }
+        AxisService service = messageContext.getAxisService();
+        Parameter param = service.getParameter("adminService");
+        
+        if (param != null && "true".equals(param.getValue())) {
+            //We will allow admin services to proceed.
+            return InvocationResponse.CONTINUE;
+        }
+        
+        int tenantId = getTenantId(messageContext);
+        if(tenantId <= 0){
+            //We can allow all super tenant actions
+            return InvocationResponse.CONTINUE;
+        }
+        
+        ThrottlingInfoCache throttlingInfoCache = ThrottlingAgentServiceComponent.getThrottlingAgent().getThrottlingInfoCache();
+        String[] actions = new String[]{StratosConstants.THROTTLING_SERVICE_IN_BANDWIDTH_ACTION, 
+                                        StratosConstants.THROTTLING_SERVICE_OUT_BANDWIDTH_ACTION,
+                                        StratosConstants.THROTTLING_SERVICE_REQUEST_ACTION,
+                                        StratosConstants.THROTTLING_SERVICE_RESPONSE_ACTION
+                                        };
+        ThrottlingActionInfo actionInfo = throttlingInfoCache.getTenantThrottlingInfo(tenantId).getThrottlingActionInfo(actions);
+
+        if (actionInfo.isBlocked()) {
+            String blockedMsg = actionInfo.getMessage();
+            String msg = "The throttling action is blocked. message: " + blockedMsg;
+            log.error(msg);
+            // we are only throwing the blocked exception, as it is a error message for the user
+            throw new AxisFault(blockedMsg);
+        }
+
+        return InvocationResponse.CONTINUE;
+    }
+    
+    private int getTenantId(MessageContext messageContext) {
+        Object obj = messageContext.getProperty("transport.http.servletRequest");
+        if (obj == null) {
+            // TODO: check for cause of the error.
+            log.debug("Servlet request is null. Skip monitoring.");
+            return 0;
+        }
+        if (!(obj instanceof MeteredServletRequest)) {
+            log.debug("HttpServletRequest is not of type MeteredServletRequest. Skip monitoring.");
+            return 0;
+        }
+
+        MeteredServletRequest servletRequest = (MeteredServletRequest) obj;
+        String address = servletRequest.getRequestURI();
+        String servicesPrefix = "/services/t/";
+        if (address != null && address.contains(servicesPrefix)) {
+            int domainNameStartIndex =
+                    address.indexOf(servicesPrefix) + servicesPrefix.length();
+            int domainNameEndIndex = address.indexOf('/', domainNameStartIndex);
+            String domainName = address.substring(domainNameStartIndex,
+                    domainNameEndIndex == -1 ? address.length() : domainNameEndIndex);
+
+            // return tenant id if domain name is not null
+            if (domainName != null) {
+                try {
+                    return ThrottlingAgentServiceComponent.getThrottlingAgent().getRealmService().getTenantManager().getTenantId(domainName);
+                } catch (org.wso2.carbon.user.api.UserStoreException e) {
+                    log.error("An error occurred while obtaining the tenant id.", e);
+                }
+            }
+        }
+
+        // return 0 if the domain name is null
+        return 0;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/ThrottlingModule.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/ThrottlingModule.java b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/ThrottlingModule.java
new file mode 100644
index 0000000..04d956d
--- /dev/null
+++ b/components/org.apache.stratos.throttling.agent/src/main/java/org/apache/stratos/throttling/agent/listeners/ThrottlingModule.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.agent.listeners;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.description.AxisDescription;
+import org.apache.axis2.description.AxisModule;
+import org.apache.axis2.modules.Module;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.Policy;
+
+/**
+ * 
+ */
+public class ThrottlingModule implements Module {
+
+    public void applyPolicy(Policy arg0, AxisDescription arg1) throws AxisFault {
+    }
+
+    public boolean canSupportAssertion(Assertion arg0) {
+        return true;
+    }
+
+    public void engageNotify(AxisDescription arg0) throws AxisFault {
+    }
+
+    public void init(ConfigurationContext arg0, AxisModule arg1) throws AxisFault {
+    }
+
+    public void shutdown(ConfigurationContext arg0) throws AxisFault {
+    }
+
+}


[11/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/carbon.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/carbon.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/carbon.xml
new file mode 100644
index 0000000..c176c75
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/carbon.xml
@@ -0,0 +1,354 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<!--
+    This is the main server configuration file
+    
+    ${carbon.home} represents the carbon.home system property.
+    Other system properties can be specified in a similar manner.
+-->
+<Server xmlns="http://wso2.org/projects/carbon/carbon.xml">
+
+    <!--
+       Product Name
+    -->
+    <Name>${product.name}</Name>
+
+    <!--
+       Product Version
+    -->
+    <Version>${product.version}</Version>
+
+    <!--
+       The fully qualified name of the server
+    -->
+    <Package>org.wso2.carbon</Package>
+
+    <!--
+    Webapp context root of WSO2 Carbon. If Carbon is to be deployed on a different context,
+    the carbon webapp directory has to be renamed, and this entry has to be changed to have the
+    same name as the renamed carbon webapp directory.
+    -->
+    <WebContextRoot>/</WebContextRoot>
+
+    <!--
+     The URL of the back end server. This is where the admin services are hosted and
+     will be used by the clients in the front end server.
+     This is required only for the Front-end server. This is used when seperating BE server from FE server
+    -->
+    <ServerURL>https://${carbon.local.ip}:${carbon.management.port}${carbon.context}/services/</ServerURL>
+
+
+    <!-- In-order to  get the registry http Port from the back-end when the default http transport is not the same-->
+    <!--RegistryHttpPort>9763</RegistryHttpPort-->
+
+    <!--
+    Number of items to be displayed on a management console page. This is used at the
+    backend server for pagination of various items.
+    -->
+    <ItemsPerPage>15</ItemsPerPage>
+
+    <!--
+       Host name or IP address of the machine hosting this server
+       e.g. www.wso2.org, 192.168.1.10
+       This is will become part of the End Point Reference of the
+       services deployed on this server instance.
+    -->
+
+    <!--HostName>www.wso2.org</HostName-->
+
+    <!--
+     The URL of the index page. This is where the user will be redirected after signing in to the
+     carbon server.
+    -->
+    <!--IndexPageURL>/carbon/admin/index.jsp</IndexPageURL-->
+
+    <!-- HTTP and HTTPS ports when apache is fronted to a carbon server-->
+    <!--ApacheHttpPort>80</ApacheHttpPort>
+    <ApacheHttpsPort>443</ApacheHttpsPort-->
+
+    <!--
+       Ports used by this server
+    -->
+    <Ports>
+        <!--
+           The JMX Port
+        -->
+        <!--
+        <JMX>9999</JMX>
+         -->
+    </Ports>
+
+    <!--
+    Axis2 related configurations
+    -->
+    <Axis2Config>
+        <!--
+             Location of the Axis2 Services & Modules repository
+
+             This can be a directory in the local file system, or a URL.
+
+             e.g.
+             1. /home/wso2wsas/repository/ - An absolute path
+             2. repository - In this case, the path is relative to CARBON_HOME
+             3. file:///home/wso2wsas/repository/
+             4. http://wso2wsas/repository/
+        -->
+        <RepositoryLocation>${carbon.home}/repository/deployment/server/</RepositoryLocation>
+
+        <!--
+            Location of the main Axis2 configuration descriptor file, a.k.a. axis2.xml file
+
+            This can be a file on the local file system, or a URL
+
+            e.g.
+            1. /home/repository/axis2.xml - An absolute path
+            2. conf/axis2.xml - In this case, the path is relative to CARBON_HOME
+            3. file:///home/carbon/repository/axis2.xml
+            4. http://repository/conf/axis2.xml
+        -->
+        <ConfigurationFile>${carbon.home}/repository/conf/axis2.xml</ConfigurationFile>
+
+        <!--
+          ServiceGroupContextIdleTime, which will be set in ConfigurationContex
+          for multiple clients which are going to access the same ServiceGroupContext
+          Default Value is 30 Sec.
+        -->
+        <ServiceGroupContextIdleTime>30000</ServiceGroupContextIdleTime>
+
+        <!--
+          This repository location is used to crete the client side configuration
+          context used by the server when calling admin services.
+        -->
+        <ClientRepositoryLocation>${carbon.home}/repository/deployment/client/</ClientRepositoryLocation>
+        <!-- This axis2 xml is used in createing the configuration context by the FE server
+         calling to BE server -->
+        <clientAxis2XmlLocation>${carbon.home}/repository/conf/axis2_client.xml</clientAxis2XmlLocation>
+    </Axis2Config>
+
+    <!--
+       The default user roles which will be created when the server
+       is started up for the first time.
+    -->
+    <ServiceUserRoles>
+        <Role>
+            <Name>admin</Name>
+            <Description>Default Administrator Role</Description>
+        </Role>
+        <Role>
+            <Name>user</Name>
+            <Description>Default User Role</Description>
+        </Role>
+    </ServiceUserRoles>
+
+    <!--
+      Security configurations
+    -->
+    <Security>
+        <!--
+            KeyStore which will be used for encrypting/decrypting passwords
+            and other sensitive information.
+        -->
+        <KeyStore>
+            <!-- Keystore file location-->
+            <Location>${carbon.home}/resources/security/wso2carbon.jks</Location>
+            <!-- Keystore type (JKS/PKCS12 etc.)-->
+            <Type>JKS</Type>
+            <!-- Keystore password-->
+            <Password>wso2carbon</Password>
+            <!-- Private Key alias-->
+            <KeyAlias>wso2carbon</KeyAlias>
+            <!-- Private Key password-->
+            <KeyPassword>wso2carbon</KeyPassword>
+        </KeyStore>
+
+        <!--
+           The directory under which all other KeyStore files will be stored
+        -->
+        <KeyStoresDir>${carbon.home}/repository/conf/keystores</KeyStoresDir>
+    </Security>
+
+    <!--
+       The temporary work directory
+    -->
+    <WorkDirectory>${carbon.home}/tmp/work</WorkDirectory>
+
+    <!--
+       House-keeping configuration
+    -->
+    <HouseKeeping>
+
+        <!--
+           true  - Start House-keeping thread on server startup
+           false - Do not start House-keeping thread on server startup.
+                   The user will run it manually as and when he wishes.
+        -->
+        <AutoStart>true</AutoStart>
+
+        <!--
+           The interval in *minutes*, between house-keeping runs
+        -->
+        <Interval>10</Interval>
+
+        <!--
+          The maximum time in *minutes*, temp files are allowed to live
+          in the system. Files/directories which were modified more than
+          "MaxTempFileLifetime" minutes ago will be removed by the
+          house-keeping task
+        -->
+        <MaxTempFileLifetime>30</MaxTempFileLifetime>
+    </HouseKeeping>
+
+    <!--
+       Configuration for handling different types of file upload.
+
+       To map all actions to a particular FileUploadExecutor, use
+       <Action>*</Action>
+    -->
+    <FileUploadConfig>
+        <Mapping>
+            <Actions>
+                <Action>keystore</Action>
+                <Action>certificate</Action>
+                <Action>*</Action>
+            </Actions>
+            <Class>org.wso2.carbon.ui.transports.fileupload.AnyFileUploadExecutor</Class>
+        </Mapping>
+
+        <Mapping>
+            <Actions>
+                <Action>jarZip</Action>
+            </Actions>
+            <Class>org.wso2.carbon.ui.transports.fileupload.JarZipUploadExecutor</Class>
+        </Mapping>
+        <Mapping>
+            <Actions>
+                <Action>dbs</Action>
+            </Actions>
+            <Class>org.wso2.carbon.ui.transports.fileupload.DBSFileUploadExecutor</Class>
+        </Mapping>
+        <Mapping>
+            <Actions>
+                <Action>tools</Action>
+            </Actions>
+            <Class>org.wso2.carbon.ui.transports.fileupload.ToolsFileUploadExecutor</Class>
+        </Mapping>
+        <Mapping>
+            <Actions>
+                <Action>toolsAny</Action>
+            </Actions>
+            <Class>org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor</Class>
+        </Mapping>
+    </FileUploadConfig>
+
+    <!--
+       Processors which process special HTTP GET requests such as ?wsdl, ?policy etc.
+
+       In order to plug in a processor to handle a special request, simply add an entry to this
+       section.
+
+       The value of the Item element is the first parameter in the query string(e.g. ?wsdl)
+       which needs special processing
+       
+       The value of the Class element is a class which implements
+       org.wso2.carbon.transport.HttpGetRequestProcessor
+    -->
+    <HttpGetRequestProcessors>
+        <Processor>
+            <Item>info</Item>
+            <Class>org.wso2.carbon.core.transports.util.InfoProcessor</Class>
+        </Processor>
+        <Processor>
+            <Item>wsdl</Item>
+            <Class>org.wso2.carbon.core.transports.util.Wsdl11Processor</Class>
+        </Processor>
+        <Processor>
+            <Item>wsdl2</Item>
+            <Class>org.wso2.carbon.core.transports.util.Wsdl20Processor</Class>
+        </Processor>
+        <Processor>
+            <Item>xsd</Item>
+            <Class>org.wso2.carbon.core.transports.util.XsdProcessor</Class>
+        </Processor>
+    </HttpGetRequestProcessors>
+
+    <!--
+    Server intializing code, specified as implementation classes of org.wso2.carbon.core.ServerInitializer.
+    This code will be run when the Carbon server is initialized
+    -->
+    <ServerInitializers>
+        <!--<Initializer></Initializer>-->
+    </ServerInitializers>
+    
+    <!--
+    Un-comment the following block to enable token based authenticator.
+    The priority of the default authenticator is 5 - to supersede that, you need to have higher priority level.
+    -->
+    <!-- Authenticators>
+		<TokenUIAuthenticator>
+			<Priority>20</Priority>
+		</TokenUIAuthenticator>
+	</Authenticators -->
+
+    <!--
+    @deprecated Use the registry.xml file to configure the Registry.
+    -->
+    <Registry/>
+
+    <!--
+    Indicates whether the Carbon Servlet is required by the system, and whether it should be
+    registered
+    -->
+    <RequireCarbonServlet>${require.carbon.servlet}</RequireCarbonServlet>
+
+    <!--
+    Carbon H2 OSGI Configuration
+    By default non of the servers start.
+        name="web" - Start the web server with the H2 Console
+        name="webPort" - The port (default: 8082)
+        name="webAllowOthers" - Allow other computers to connect
+        name="webSSL" - Use encrypted (HTTPS) connections
+        name="tcp" - Start the TCP server
+        name="tcpPort" - The port (default: 9092)
+        name="tcpAllowOthers" - Allow other computers to connect
+        name="tcpSSL" - Use encrypted (SSL) connections
+        name="pg" - Start the PG server
+        name="pgPort"  - The port (default: 5435)
+        name="pgAllowOthers"  - Allow other computers to connect
+        name="trace" - Print additional trace information; for all servers
+        name="baseDir" - The base directory for H2 databases; for all servers  
+    -->
+    <!--H2DatabaseConfiguration>
+        <property name="web" />
+        <property name="webPort">8082</property>
+        <property name="webAllowOthers" />
+        <property name="webSSL" />
+        <property name="tcp" />
+        <property name="tcpPort">9092</property>
+        <property name="tcpAllowOthers" />
+        <property name="tcpSSL" />
+        <property name="pg" />
+        <property name="pgPort">5435</property>
+        <property name="pgAllowOthers" />
+        <property name="trace" />
+        <property name="baseDir">${carbon.home}</property>
+    </H2DatabaseConfiguration-->
+</Server>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/cipher-text.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/cipher-text.properties b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/cipher-text.properties
new file mode 100644
index 0000000..9432376
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/cipher-text.properties
@@ -0,0 +1,8 @@
+#aliases=testpass
+#
+## configuration  per each plaintext
+#testpass.secret=LxtcBuAfwazeX3Fk1kFHe9CvL6T3XaVAuh79ZpkJY5yeDAdfqmrVgq3HWNrLrWp4YLDUlhDP8VI0e/HMykul6yyuXa7YrZUpx5RovH5/Nl1dZvemgsVrgK5mioYtw9Z/1KQFDGphekd0NLNNXOD6uiQdUxrHc7jXXe9fAAXTDkI=
+#testpass.secret.alias=wso2carbon
+#testpass.secret.keystore=identity
+#
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/mgt-transports.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/mgt-transports.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/mgt-transports.xml
new file mode 100644
index 0000000..274d7fa
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/mgt-transports.xml
@@ -0,0 +1,87 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<!--
+  ~ This file contains the configuration of the transport connectors used by
+  ~ the embedded application server instance which hosts the Carbon management
+  ~ console
+  -->
+
+<transports>
+    <transport name="http" class="org.wso2.carbon.server.transports.http.HttpTransport">
+        <parameter name="port">9763</parameter>
+
+        <!--
+       Uncomment the following to enable Apache2 mod_proxy. The port on the Apache server is 80
+       in this case. 
+        -->
+        <!--<parameter name="proxyPort">80</parameter>-->
+
+        <parameter name="maxHttpHeaderSize">8192</parameter>
+        <parameter name="maxThreads">150</parameter>
+        <parameter name="minSpareThreads">25</parameter>
+        <parameter name="maxSpareThreads">75</parameter>
+        <parameter name="enableLookups">false</parameter>
+        <parameter name="disableUploadTimeout">false</parameter>
+        <parameter name="clientAuth">false</parameter>
+        <parameter name="maxKeepAliveRequests">100</parameter>
+        <parameter name="acceptCount">100</parameter>
+
+        <parameter name="compression">force</parameter>
+        <parameter name="compressionMinSize">2048</parameter>
+        <parameter name="noCompressionUserAgents">gozilla, traviata</parameter>
+        <parameter name="compressableMimeType">
+            text/html,text/javascript,application/x-javascript,application/javascript,application/xml,text/css,application/xslt+xml,text/xsl,image/gif,image/jpg,image/jpeg
+        </parameter>
+    </transport>
+
+    <transport name="https" class="org.wso2.carbon.server.transports.http.HttpsTransport">
+        <parameter name="port">9443</parameter>
+
+        <!--
+       Uncomment the following to enable Apache2 mod_proxy. The port on the Apache server is 443
+       in this case. 
+        -->
+        <!--<parameter name="proxyPort">443</parameter>-->
+        <!--
+       Uncomment the following to run on IBM J9 VM. Also, change the sslProtocol to SSL from the
+       Default value of TLS.
+        -->
+        <!--<parameter name="algorithm">IbmX509</parameter>-->
+        <parameter name="sslProtocol">TLS</parameter>
+        <parameter name="maxHttpHeaderSize">8192</parameter>
+        <parameter name="maxThreads">150</parameter>
+        <parameter name="minSpareThreads">25</parameter>
+        <parameter name="maxSpareThreads">75</parameter>
+        <parameter name="enableLookups">false</parameter>
+        <parameter name="disableUploadTimeout">false</parameter>
+        <parameter name="clientAuth">false</parameter>
+        <parameter name="maxKeepAliveRequests">100</parameter>
+        <parameter name="acceptCount">100</parameter>
+
+        <parameter name="compression">force</parameter>
+        <parameter name="compressionMinSize">2048</parameter>
+        <parameter name="noCompressionUserAgents">gozilla, traviata</parameter>
+        <parameter name="compressableMimeType">
+            text/html,text/javascript,application/x-javascript,application/javascript,application/xml,text/css,application/xslt+xml,text/xsl,image/gif,image/jpg,image/jpeg
+        </parameter>
+        <parameter name="keystore">${carbon.home}/resources/security/wso2carbon.jks</parameter>
+        <parameter name="keypass">wso2carbon</parameter>
+    </transport>
+</transports>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/mime.types
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/mime.types b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/mime.types
new file mode 100644
index 0000000..80a13e9
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/mime.types
@@ -0,0 +1,728 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+# Media type for wsdl files. This is not defined in the original mime.types file.
+chemical/x-alchemy				alc
+application/andrew-inset			ez
+application/wsdl+xml				wsdl
+application/activemessage
+application/applefile
+application/atomicmail
+application/batch-SMTP
+application/beep+xml
+application/cals-1840
+application/commonground
+application/cu-seeme				cu
+application/cybercash
+application/dca-rft
+application/dec-dx
+application/docbook+xml
+application/dsptype				tsp
+application/dvcs
+application/edi-consent
+application/edi-x12
+application/edifact
+application/eshop
+application/font-tdpfr
+application/futuresplash			spl
+application/ghostview
+application/hta					hta
+application/http
+application/hyperstudio
+application/iges
+application/index
+application/index.cmd
+application/index.obj
+application/index.response
+application/index.vnd
+application/iotp
+application/ipp
+application/isup
+application/java-archive			jar
+application/java-serialized-object		ser
+application/java-vm				class
+application/mac-binhex40			hqx
+application/mac-compactpro			cpt
+application/macwriteii
+application/marc
+application/mathematica				nb
+application/mathematica-old
+application/msaccess				mdb
+application/msword				doc dot
+application/news-message-id
+application/news-transmission
+application/ocsp-request
+application/ocsp-response
+application/octet-stream			bin
+application/oda					oda
+application/ogg					ogg
+application/parityfec
+application/pdf					pdf
+application/pgp-encrypted
+application/pgp-keys				key
+application/pgp-signature			pgp
+application/pics-rules				prf
+application/pkcs10
+application/pkcs7-mime
+application/pkcs7-signature
+application/pkix-cert
+application/pkix-crl
+application/pkixcmp
+application/postscript				ps ai eps
+application/prs.alvestrand.titrax-sheet
+application/prs.cww
+application/prs.nprend
+application/qsig
+application/rar					rar
+application/rdf+xml				rdf
+application/remote-printing
+application/riscos
+application/rss+xml				rss
+application/rtf
+application/sdp
+application/set-payment
+application/set-payment-initiation
+application/set-registration
+application/set-registration-initiation
+application/sgml
+application/sgml-open-catalog
+application/sieve
+application/slate
+application/smil				smi smil
+application/timestamp-query
+application/timestamp-reply
+application/vemmi
+application/whoispp-query
+application/whoispp-response
+application/wita
+application/wordperfect				wpd
+application/wordperfect5.1			wp5
+application/x400-bp
+application/xhtml+xml				xhtml xht
+application/xml					xml xsl xslt jrxml
+application/xml-dtd
+application/xml-external-parsed-entity
+application/zip					zip
+application/vnd.3M.Post-it-Notes
+application/vnd.accpac.simply.aso
+application/vnd.accpac.simply.imp
+application/vnd.acucobol
+application/vnd.aether.imp
+application/vnd.anser-web-certificate-issue-initiation
+application/vnd.anser-web-funds-transfer-initiation
+application/vnd.audiograph
+application/vnd.bmi
+application/vnd.businessobjects
+application/vnd.canon-cpdl
+application/vnd.canon-lips
+application/vnd.cinderella			cdy
+application/vnd.claymore
+application/vnd.commerce-battelle
+application/vnd.commonspace
+application/vnd.comsocaller
+application/vnd.contact.cmsg
+application/vnd.cosmocaller
+application/vnd.ctc-posml
+application/vnd.cups-postscript
+application/vnd.cups-raster
+application/vnd.cups-raw
+application/vnd.cybank
+application/vnd.dna
+application/vnd.dpgraph
+application/vnd.dxr
+application/vnd.ecdis-update
+application/vnd.ecowin.chart
+application/vnd.ecowin.filerequest
+application/vnd.ecowin.fileupdate
+application/vnd.ecowin.series
+application/vnd.ecowin.seriesrequest
+application/vnd.ecowin.seriesupdate
+application/vnd.enliven
+application/vnd.epson.esf
+application/vnd.epson.msf
+application/vnd.epson.quickanime
+application/vnd.epson.salt
+application/vnd.epson.ssf
+application/vnd.ericsson.quickcall
+application/vnd.eudora.data
+application/vnd.fdf
+application/vnd.ffsns
+application/vnd.flographit
+application/vnd.framemaker
+application/vnd.fsc.weblaunch
+application/vnd.fujitsu.oasys
+application/vnd.fujitsu.oasys2
+application/vnd.fujitsu.oasys3
+application/vnd.fujitsu.oasysgp
+application/vnd.fujitsu.oasysprs
+application/vnd.fujixerox.ddd
+application/vnd.fujixerox.docuworks
+application/vnd.fujixerox.docuworks.binder
+application/vnd.fut-misnet
+application/vnd.grafeq
+application/vnd.groove-account
+application/vnd.groove-identity-message
+application/vnd.groove-injector
+application/vnd.groove-tool-message
+application/vnd.groove-tool-template
+application/vnd.groove-vcard
+application/vnd.hhe.lesson-player
+application/vnd.hp-HPGL
+application/vnd.hp-PCL
+application/vnd.hp-PCLXL
+application/vnd.hp-hpid
+application/vnd.hp-hps
+application/vnd.httphone
+application/vnd.hzn-3d-crossword
+application/vnd.ibm.MiniPay
+application/vnd.ibm.afplinedata
+application/vnd.ibm.modcap
+application/vnd.informix-visionary
+application/vnd.intercon.formnet
+application/vnd.intertrust.digibox
+application/vnd.intertrust.nncp
+application/vnd.intu.qbo
+application/vnd.intu.qfx
+application/vnd.irepository.package+xml
+application/vnd.is-xpr
+application/vnd.japannet-directory-service
+application/vnd.japannet-jpnstore-wakeup
+application/vnd.japannet-payment-wakeup
+application/vnd.japannet-registration
+application/vnd.japannet-registration-wakeup
+application/vnd.japannet-setstore-wakeup
+application/vnd.japannet-verification
+application/vnd.japannet-verification-wakeup
+application/vnd.koan
+application/vnd.lotus-1-2-3
+application/vnd.lotus-approach
+application/vnd.lotus-freelance
+application/vnd.lotus-notes
+application/vnd.lotus-organizer
+application/vnd.lotus-screencam
+application/vnd.lotus-wordpro
+application/vnd.mcd
+application/vnd.mediastation.cdkey
+application/vnd.meridian-slingshot
+application/vnd.mif
+application/vnd.minisoft-hp3000-save
+application/vnd.mitsubishi.misty-guard.trustweb
+application/vnd.mobius.daf
+application/vnd.mobius.dis
+application/vnd.mobius.msl
+application/vnd.mobius.plc
+application/vnd.mobius.txf
+application/vnd.motorola.flexsuite
+application/vnd.motorola.flexsuite.adsi
+application/vnd.motorola.flexsuite.fis
+application/vnd.motorola.flexsuite.gotap
+application/vnd.motorola.flexsuite.kmr
+application/vnd.motorola.flexsuite.ttc
+application/vnd.motorola.flexsuite.wem
+application/vnd.mozilla.xul+xml			xul
+application/vnd.ms-artgalry
+application/vnd.ms-asf
+application/vnd.ms-excel			xls xlb xlt
+application/vnd.ms-lrm
+application/vnd.ms-pki.seccat			cat
+application/vnd.ms-pki.stl			stl
+application/vnd.ms-powerpoint			ppt pps
+application/vnd.ms-project
+application/vnd.ms-tnef
+application/vnd.ms-works
+application/vnd.mseq
+application/vnd.msign
+application/vnd.music-niff
+application/vnd.musician
+application/vnd.netfpx
+application/vnd.noblenet-directory
+application/vnd.noblenet-sealer
+application/vnd.noblenet-web
+application/vnd.novadigm.EDM
+application/vnd.novadigm.EDX
+application/vnd.novadigm.EXT
+application/vnd.oasis.opendocument.chart	odc
+application/vnd.oasis.opendocument.database	odb
+application/vnd.oasis.opendocument.formula	odf
+application/vnd.oasis.opendocument.graphics	odg
+application/vnd.oasis.opendocument.graphics-template otg
+application/vnd.oasis.opendocument.image	odi
+application/vnd.oasis.opendocument.presentation	odp
+application/vnd.oasis.opendocument.presentation-template otp
+application/vnd.oasis.opendocument.spreadsheet	ods
+application/vnd.oasis.opendocument.spreadsheet-template ots
+application/vnd.oasis.opendocument.text		odt
+application/vnd.oasis.opendocument.text-master	odm
+application/vnd.oasis.opendocument.text-template ott
+application/vnd.oasis.opendocument.text-web	oth
+application/vnd.osa.netdeploy
+application/vnd.palm
+application/vnd.pg.format
+application/vnd.pg.osasli
+application/vnd.powerbuilder6
+application/vnd.powerbuilder6-s
+application/vnd.powerbuilder7
+application/vnd.powerbuilder7-s
+application/vnd.powerbuilder75
+application/vnd.powerbuilder75-s
+application/vnd.previewsystems.box
+application/vnd.publishare-delta-tree
+application/vnd.pvi.ptid1
+application/vnd.pwg-xhtml-print+xml
+application/vnd.rapid
+application/vnd.rim.cod				cod
+application/vnd.s3sms
+application/vnd.seemail
+application/vnd.shana.informed.formdata
+application/vnd.shana.informed.formtemplate
+application/vnd.shana.informed.interchange
+application/vnd.shana.informed.package
+application/vnd.smaf				mmf
+application/vnd.sss-cod
+application/vnd.sss-dtf
+application/vnd.sss-ntf
+application/vnd.stardivision.calc		sdc
+application/vnd.stardivision.draw		sda
+application/vnd.stardivision.impress		sdd sdp
+application/vnd.stardivision.math		smf
+application/vnd.stardivision.writer		sdw vor
+application/vnd.stardivision.writer-global	sgl
+application/vnd.street-stream
+application/vnd.sun.xml.calc			sxc
+application/vnd.sun.xml.calc.template		stc
+application/vnd.sun.xml.draw			sxd
+application/vnd.sun.xml.draw.template		std
+application/vnd.sun.xml.impress			sxi
+application/vnd.sun.xml.impress.template	sti
+application/vnd.sun.xml.math			sxm
+application/vnd.sun.xml.writer			sxw
+application/vnd.sun.xml.writer.global		sxg
+application/vnd.sun.xml.writer.template		stw
+application/vnd.svd
+application/vnd.swiftview-ics
+application/vnd.symbian.install			sis
+application/vnd.triscape.mxs
+application/vnd.trueapp
+application/vnd.truedoc
+application/vnd.tve-trigger
+application/vnd.ufdl
+application/vnd.uplanet.alert
+application/vnd.uplanet.alert-wbxml
+application/vnd.uplanet.bearer-choice
+application/vnd.uplanet.bearer-choice-wbxml
+application/vnd.uplanet.cacheop
+application/vnd.uplanet.cacheop-wbxml
+application/vnd.uplanet.channel
+application/vnd.uplanet.channel-wbxml
+application/vnd.uplanet.list
+application/vnd.uplanet.list-wbxml
+application/vnd.uplanet.listcmd
+application/vnd.uplanet.listcmd-wbxml
+application/vnd.uplanet.signal
+application/vnd.vcx
+application/vnd.vectorworks
+application/vnd.vidsoft.vidconference
+application/vnd.visio				vsd
+application/vnd.vividence.scriptfile
+application/vnd.wap.sic
+application/vnd.wap.slc
+application/vnd.wap.wbxml			wbxml
+application/vnd.wap.wmlc			wmlc
+application/vnd.wap.wmlscriptc			wmlsc
+application/vnd.webturbo
+application/vnd.wrq-hp3000-labelled
+application/vnd.wso2.endpoint
+application/vnd.wso2.governance-archive		gar
+application/vnd.wso2-hyperlink
+application/vnd.wt.stf
+application/vnd.xara
+application/vnd.xfdl
+application/vnd.yellowriver-custom-menu
+application/x-123				wk
+application/x-abiword				abw
+application/x-apple-diskimage			dmg
+application/x-bcpio				bcpio
+application/x-bittorrent			torrent
+application/x-cdf				cdf
+application/x-cdlink				vcd
+application/x-chess-pgn				pgn
+application/x-core
+application/x-cpio				cpio
+application/x-csh				csh
+application/x-debian-package			deb udeb
+application/x-director				dcr dir dxr
+application/x-dms				dms
+application/x-doom				wad
+application/x-dvi				dvi
+application/x-executable
+application/x-flac				flac
+application/x-font				pfa pfb gsf pcf pcf.Z
+application/x-freemind				mm
+application/x-futuresplash			spl
+application/x-gnumeric				gnumeric
+application/x-go-sgf				sgf
+application/x-graphing-calculator		gcf
+application/x-gtar				gtar tgz taz
+application/x-hdf				hdf
+application/x-httpd-php				phtml pht php
+application/x-httpd-php-source			phps
+application/x-httpd-php3			php3
+application/x-httpd-php3-preprocessed		php3p
+application/x-httpd-php4			php4
+application/x-httpd-eruby			rhtml
+application/x-ica				ica
+application/x-internet-signup			ins isp
+application/x-iphone				iii
+application/x-iso9660-image			iso
+application/x-java-applet
+application/x-java-bean
+application/x-java-jnlp-file			jnlp
+application/x-javascript			js
+application/x-jmol				jmz
+application/x-kchart				chrt
+application/x-kdelnk
+application/x-killustrator			kil
+application/x-koan				skp skd skt skm
+application/x-kpresenter			kpr kpt
+application/x-kspread				ksp
+application/x-kword				kwd kwt
+application/x-latex				latex
+application/x-lha				lha
+application/x-lzh				lzh
+application/x-lzx				lzx
+application/x-maker				frm maker frame fm fb book fbdoc
+application/x-mif				mif
+application/x-ms-wmd				wmd
+application/x-ms-wmz				wmz
+application/x-msdos-program			com exe bat dll
+application/x-msi				msi
+application/x-netcdf				nc
+application/x-ns-proxy-autoconfig		pac
+application/x-nwc				nwc
+application/x-object				o
+application/x-oz-application			oza
+application/x-pkcs7-certreqresp			p7r
+application/x-pkcs7-crl				crl
+application/x-python-code			pyc pyo
+application/x-quicktimeplayer			qtl
+application/x-redhat-package-manager		rpm
+application/x-rx
+application/x-sh				sh
+application/x-shar				shar
+application/x-shellscript
+application/x-shockwave-flash			swf swfl
+application/x-stuffit				sit
+application/x-sv4cpio				sv4cpio
+application/x-sv4crc				sv4crc
+application/x-tar				tar
+application/x-tcl				tcl
+application/x-tex-gf				gf
+application/x-tex-pk				pk
+application/x-texinfo				texinfo texi
+application/x-trash				~ % bak old sik
+application/x-troff				t tr roff
+application/x-troff-man				man
+application/x-troff-me				me
+application/x-troff-ms				ms
+application/x-ustar				ustar
+application/x-videolan
+application/x-wais-source			src
+application/x-wingz				wz
+application/x-x509-ca-cert			crt
+application/x-xcf				xcf
+application/x-xfig				fig
+application/x-xpinstall				xpi
+application/x-xsd+xml				xsd
+
+audio/32kadpcm
+audio/basic					au snd
+audio/g.722.1
+audio/l16
+audio/midi					mid midi kar
+audio/mp4a-latm
+audio/mpa-robust
+audio/mpeg					mpga mpega mp2 mp3 m4a
+audio/mpegurl					m3u
+audio/parityfec
+audio/prs.sid					sid
+audio/telephone-event
+audio/tone
+audio/vnd.cisco.nse
+audio/vnd.cns.anp1
+audio/vnd.cns.inf1
+audio/vnd.digital-winds
+audio/vnd.everad.plj
+audio/vnd.lucent.voice
+audio/vnd.nortel.vbk
+audio/vnd.nuera.ecelp4800
+audio/vnd.nuera.ecelp7470
+audio/vnd.nuera.ecelp9600
+audio/vnd.octel.sbc
+audio/vnd.qcelp
+audio/vnd.rhetorex.32kadpcm
+audio/vnd.vmx.cvsd
+audio/x-aiff					aif aiff aifc
+audio/x-gsm					gsm
+audio/x-mpegurl					m3u
+audio/x-ms-wma					wma
+audio/x-ms-wax					wax
+audio/x-pn-realaudio-plugin
+audio/x-pn-realaudio				ra rm ram
+audio/x-realaudio				ra
+audio/x-scpls					pls
+audio/x-sd2					sd2
+audio/x-wav					wav
+
+chemical/x-alchemy				alc
+chemical/x-cache				cac cache
+chemical/x-cache-csf				csf
+chemical/x-cactvs-binary			cbin cascii ctab
+chemical/x-cdx					cdx
+chemical/x-cerius				cer
+chemical/x-chem3d				c3d
+chemical/x-chemdraw				chm
+chemical/x-cif					cif
+chemical/x-cmdf					cmdf
+chemical/x-cml					cml
+chemical/x-compass				cpa
+chemical/x-crossfire				bsd
+chemical/x-csml					csml csm
+chemical/x-ctx					ctx
+chemical/x-cxf					cxf cef
+#chemical/x-daylight-smiles			smi
+chemical/x-embl-dl-nucleotide			emb embl
+chemical/x-galactic-spc				spc
+chemical/x-gamess-input				inp gam gamin
+chemical/x-gaussian-checkpoint			fch fchk
+chemical/x-gaussian-cube			cub
+chemical/x-gaussian-input			gau gjc gjf
+chemical/x-gaussian-log				gal
+chemical/x-gcg8-sequence			gcg
+chemical/x-genbank				gen
+chemical/x-hin					hin
+chemical/x-isostar				istr ist
+chemical/x-jcamp-dx				jdx dx
+chemical/x-kinemage				kin
+chemical/x-macmolecule				mcm
+chemical/x-macromodel-input			mmd mmod
+chemical/x-mdl-molfile				mol
+chemical/x-mdl-rdfile				rd
+chemical/x-mdl-rxnfile				rxn
+chemical/x-mdl-sdfile				sd sdf
+chemical/x-mdl-tgf				tgf
+#chemical/x-mif					mif
+chemical/x-mmcif				mcif
+chemical/x-mol2					mol2
+chemical/x-molconn-Z				b
+chemical/x-mopac-graph				gpt
+chemical/x-mopac-input				mop mopcrt mpc dat zmt
+chemical/x-mopac-out				moo
+chemical/x-mopac-vib				mvb
+chemical/x-ncbi-asn1				asn
+chemical/x-ncbi-asn1-ascii			prt ent
+chemical/x-ncbi-asn1-binary			val aso
+chemical/x-ncbi-asn1-spec			asn
+chemical/x-pdb					pdb ent
+chemical/x-rosdal				ros
+chemical/x-swissprot				sw
+chemical/x-vamas-iso14976			vms
+chemical/x-vmd					vmd
+chemical/x-xtel					xtel
+chemical/x-xyz					xyz
+
+image/cgm
+image/g3fax
+image/gif					gif
+image/ief					ief
+image/jpeg					jpeg jpg jpe
+image/naplps
+image/pcx					pcx
+image/png					png
+image/prs.btif
+image/prs.pti
+image/svg+xml					svg svgz
+image/tiff					tiff tif
+image/vnd.cns.inf2
+image/vnd.djvu					djvu djv
+image/vnd.dwg
+image/vnd.dxf
+image/vnd.fastbidsheet
+image/vnd.fpx
+image/vnd.fst
+image/vnd.fujixerox.edmics-mmr
+image/vnd.fujixerox.edmics-rlc
+image/vnd.mix
+image/vnd.net-fpx
+image/vnd.svf
+image/vnd.wap.wbmp				wbmp
+image/vnd.xiff
+image/x-cmu-raster				ras
+image/x-coreldraw				cdr
+image/x-coreldrawpattern			pat
+image/x-coreldrawtemplate			cdt
+image/x-corelphotopaint				cpt
+image/x-icon					ico
+image/x-jg					art
+image/x-jng					jng
+image/x-ms-bmp					bmp
+image/x-photoshop				psd
+image/x-portable-anymap				pnm
+image/x-portable-bitmap				pbm
+image/x-portable-graymap			pgm
+image/x-portable-pixmap				ppm
+image/x-rgb					rgb
+image/x-xbitmap					xbm
+image/x-xpixmap					xpm
+image/x-xwindowdump				xwd
+
+inode/chardevice
+inode/blockdevice
+inode/directory-locked
+inode/directory
+inode/fifo
+inode/socket
+
+message/delivery-status
+message/disposition-notification
+message/external-body
+message/http
+message/s-http
+message/news
+message/partial
+message/rfc822
+
+model/iges					igs iges
+model/mesh					msh mesh silo
+model/vnd.dwf
+model/vnd.flatland.3dml
+model/vnd.gdl
+model/vnd.gs-gdl
+model/vnd.gtw
+model/vnd.mts
+model/vnd.vtu
+model/vrml					wrl vrml
+
+multipart/alternative
+multipart/appledouble
+multipart/byteranges
+multipart/digest
+multipart/encrypted
+multipart/form-data
+multipart/header-set
+multipart/mixed
+multipart/parallel
+multipart/related
+multipart/report
+multipart/signed
+multipart/voice-message
+
+text/calendar					ics icz
+text/comma-separated-values			csv
+text/css					css
+text/directory
+text/english
+text/enriched
+text/h323					323
+text/html					html htm shtml
+text/iuls					uls
+text/mathml					mml
+text/parityfec
+text/plain					asc txt text diff pot
+text/prs.lines.tag
+text/rfc822-headers
+text/richtext					rtx
+text/rtf					rtf
+text/scriptlet					sct wsc
+text/t140
+text/texmacs					tm ts
+text/tab-separated-values			tsv
+text/uri-list
+text/vnd.abc
+text/vnd.curl
+text/vnd.DMClientScript
+text/vnd.flatland.3dml
+text/vnd.fly
+text/vnd.fmi.flexstor
+text/vnd.in3d.3dml
+text/vnd.in3d.spot
+text/vnd.IPTC.NewsML
+text/vnd.IPTC.NITF
+text/vnd.latex-z
+text/vnd.motorola.reflex
+text/vnd.ms-mediapackage
+text/vnd.sun.j2me.app-descriptor		jad
+text/vnd.wap.si
+text/vnd.wap.sl
+text/vnd.wap.wml				wml
+text/vnd.wap.wmlscript				wmls
+text/x-bibtex					bib
+text/x-boo					boo
+text/x-c++hdr					h++ hpp hxx hh
+text/x-c++src					c++ cpp cxx cc
+text/x-chdr					h
+text/x-component				htc
+text/x-crontab
+text/x-csh					csh
+text/x-csrc					c
+text/x-dsrc					d
+text/x-haskell					hs
+text/x-java					java
+text/x-literate-haskell				lhs
+text/x-makefile
+text/x-moc					moc
+text/x-pascal					p pas
+text/x-pcs-gcd					gcd
+text/x-perl					pl pm
+text/x-python					py
+text/x-server-parsed-html
+text/x-setext					etx
+text/x-sh					sh
+text/x-tcl					tcl tk
+text/x-tex					tex ltx sty cls
+text/x-vcalendar				vcs
+text/x-vcard					vcf
+
+video/dl					dl
+video/dv					dif dv
+video/fli					fli
+video/gl					gl
+video/mpeg					mpeg mpg mpe
+video/mp4					mp4
+video/quicktime					qt mov
+video/mp4v-es
+video/parityfec
+video/pointer
+video/vnd.fvt
+video/vnd.motorola.video
+video/vnd.motorola.videop
+video/vnd.mpegurl				mxu
+video/vnd.mts
+video/vnd.nokia.interleaved-multimedia
+video/vnd.vivo
+video/x-la-asf					lsf lsx
+video/x-mng					mng
+video/x-ms-asf					asf asx
+video/x-ms-wm					wm
+video/x-ms-wmv					wmv
+video/x-ms-wmx					wmx
+video/x-ms-wvx					wvx
+video/x-msvideo					avi
+video/x-sgi-movie				movie
+
+x-conference/x-cooltalk				ice
+
+x-world/x-vrml					vrm vrml wrl

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/node/registry.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/node/registry.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/node/registry.xml
new file mode 100644
index 0000000..5c46f43
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/node/registry.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<wso2registry>
+
+    <currentDBConfig>wso2registry</currentDBConfig>
+    <readOnly>false</readOnly>
+    <registryRoot>/</registryRoot>
+
+    <dbConfig name="wso2registry">
+        <url>jdbc:h2:tcp://localhost/~/test</url>
+        <userName>sa</userName>
+        <password></password>
+        <driverName>org.h2.Driver</driverName>
+        <maxActive>50</maxActive>
+        <maxWait>60000</maxWait>
+        <minIdle>5</minIdle>
+    </dbConfig>
+
+   <!--<handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.apache.synapse</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.apache.esb</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.apache.axis2</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.apache.wsas</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.WSDLMediaTypeHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/wsdl+xml</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.XSDMediaTypeHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/x-xsd+xml</property>
+        </filter>
+    </handler> -->
+
+    
+    <versionResourcesOnChange>true</versionResourcesOnChange>
+
+    <!-- NOTE: You can edit the options under "StaticConfiguration" only before the
+     startup. -->
+    <staticConfiguration>
+        <versioningProperties>true</versioningProperties>
+        <versioningComments>true</versioningComments>
+        <versioningTags>true</versioningTags>
+        <versioningRatings>true</versioningRatings>
+    </staticConfiguration>
+</wso2registry>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/node/user-mgt.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/node/user-mgt.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/node/user-mgt.xml
new file mode 100644
index 0000000..35dafff
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/node/user-mgt.xml
@@ -0,0 +1,106 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<UserManager>
+	<Realm>
+		<Configuration>
+			<AdminRole>admin</AdminRole>
+			<AdminUser>
+				<UserName>admin</UserName>
+				<Password>admin</Password>
+			</AdminUser>
+			<EveryOneRoleName>everyone</EveryOneRoleName> <!-- By default users in thsi role sees the registry root -->
+			<ReadOnly>false</ReadOnly>
+			<MaxUserNameListLength>500</MaxUserNameListLength>
+			<Property name="url">jdbc:h2:tcp://localhost/~/test</Property>
+            <Property name="userName">sa</Property>
+            <Property name="password"></Property>
+            <Property name="driverName">org.h2.Driver</Property>
+            <Property name="maxActive">50</Property>
+            <Property name="maxWait">60000</Property>
+            <Property name="minIdle">5</Property>
+        </Configuration>
+        <UserStoreManager
+            class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
+            <Property name="SelectUserSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+	    <Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>
+            <Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>
+            <Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>
+            <Property name="GetUserProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+	        <Property name="GetUsersWithDefaultPasswordsSQL">SELECT UM_USER_NAME FROM UM_USER WHERE WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="UserNameUniqueAcrossTenantsSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
+            <Property name="GetUserIDFromUserNameSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetTenantIDFromUserNameSQL">SELECT UM_TENANT_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
+            <Property name="PasswordDigest">SHA-256</Property>
+            <Property name="StoreSaltedPassword">true</Property>
+            <Property name="UserNameUniqueAcrossTenants">false</Property>
+            <!-- writing sqls follow-->
+            <Property name="AddUserSQL">INSERT INTO UM_USER (UM_USER_NAME, UM_USER_PASSWORD, UM_SALT_VALUE, UM_REQUIRE_CHANGE, UM_CHANGED_TIME, UM_TENANT_ID) VALUES (?, ?, ?, ?, ?, ?)</Property>
+	    <Property name="AddRoleSQL">INSERT INTO UM_ROLE (UM_ROLE_NAME, UM_TENANT_ID) VALUES (?, ?)</Property>
+            <Property name="AddUserToRoleSQL">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?), ?)</Property>
+            <Property name="RemoveUserFromRoleSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="AddRoleToUserSQL">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?)</Property>
+            <Property name="RemoveRoleFromUserSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="DeleteRoleSQL">DELETE FROM UM_ROLE WHERE UM_ROLE_NAME = ? AND UM_TENANT_ID=?</Property>
+            <Property name="OnDeleteRoleRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="OnDeleteUserRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="OnDeleteUserRemoveUserAttributeSQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="DeleteUserSQL">DELETE FROM UM_USER WHERE UM_USER_NAME = ? AND UM_TENANT_ID=?</Property>
+            <Property name="UpdateUserPasswordSQL">UPDATE UM_USER SET UM_USER_PASSWORD= ?, UM_SALT_VALUE=?, UM_REQUIRE_CHANGE=?, UM_CHANGED_TIME=? WHERE UM_USER_NAME= ? AND UM_TENANT_ID=?</Property>
+	    <Property name="AddUserPropertySQL">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?, ?, ?, ?)</Property>
+            <Property name="UpdateUserPropertySQL">UPDATE UM_USER_ATTRIBUTE SET UM_ATTR_VALUE=? WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
+            <Property name="DeleteUserPropertySQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
+        </UserStoreManager>
+  <!--  <UserStoreManager
+            class="org.wso2.carbon.user.core.actdir.ActDirUserStoreManager">
+            <Property name="ConnectionURL">ldap://10.100.1.122:389</Property>
+            <Property name="ConnectionName">cn=Administrator,cn=users,dc=wso2,dc=lk</Property>
+            <Property name="ConnectionPassword">admin123</Property>
+            <Property name="UserSearchBase">dc=wso2,dc=lk</Property>
+            <Property name="FilterTenantsForUsers"></Property>
+       </UserStoreManager> -->
+        <!-- UserStoreManager
+            class="org.wso2.carbon.user.core.ldap.LDAPUserStoreManager">
+            <Property name="ConnectionURL">ldap://localhost:10389</Property>
+            <Property name="ConnectionName">uid=admin,ou=system</Property>
+            <Property name="ConnectionPassword">admin123</Property>
+            <Property name="UserSearchBase">ou=system</Property>
+             <Property name="UserNameSearchFilter">(&amp;(objectClass=person)(mail=?@{domain}))</Property>
+            <Property name="UserNameAttribute">mail</Property>
+        </UserStoreManager -->
+        <AuthorizationManager
+            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager"></AuthorizationManager>
+    </Realm>
+    <SystemPermission>
+        <Permission>login</Permission>
+        <Permission>manage-configuration</Permission>
+        <Permission>manage-security</Permission>
+        <Permission>upload-services</Permission>
+        <Permission>manage-services</Permission>
+        <Permission>manage-lc-configuration</Permission>
+        <Permission>manage-mediation</Permission>
+        <Permission>monitor-system</Permission>
+        <Permission>delegate-identity</Permission>
+    </SystemPermission>
+</UserManager>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/ports-config.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/ports-config.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/ports-config.xml
new file mode 100644
index 0000000..1f5ea77
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/ports-config.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<portsConfig>
+    <range>
+   	<start>49150</start>
+        <end>65535</end>
+    </range>
+    <Instance1>
+        <nioports>
+            <http>5443</http>
+            <https>5444</https>
+        </nioports>
+        <mgtports>
+            <http>6443</http>
+            <https>6444</https>
+        </mgtports>
+    </Instance1>
+    <Instance2>
+        <nioports>
+            <http>5445</http>
+            <https>5446</https>
+        </nioports>
+        <mgtports>
+            <http>6445</http>
+            <https>6446</https>
+        </mgtports>
+    </Instance2>
+    <Instance3>
+        <nioports>
+            <http>5447</http>
+            <https>5448</https>
+        </nioports>
+        <mgtports>
+            <http>6447</http>
+            <https>6448</https>
+        </mgtports>
+         
+    </Instance3>
+</portsConfig>
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/registry.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/registry.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/registry.xml
new file mode 100644
index 0000000..f2ea53e
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/registry.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<wso2registry>
+
+    <currentDBConfig>wso2registry</currentDBConfig>
+    <readOnly>false</readOnly>
+    <registryRoot>/</registryRoot>
+
+    <dbConfig name="wso2registry">
+        <url>jdbc:h2:repository/database/WSO2CARBON_DB</url>
+        <userName>wso2carbon</userName>
+        <password>wso2carbon</password>
+        <driverName>org.h2.Driver</driverName>
+        <maxActive>50</maxActive>
+        <maxWait>60000</maxWait>
+        <minIdle>5</minIdle>
+    </dbConfig>
+
+   <!--<handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.apache.synapse</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.apache.esb</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.apache.axis2</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.apache.wsas</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.WSDLMediaTypeHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/wsdl+xml</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.XSDMediaTypeHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/x-xsd+xml</property>
+        </filter>
+    </handler> -->
+
+    <!--remoteInstance url="https://localhost:9443/registry">
+        <id>instanceid</id>
+        <username>username</username>
+        <password>password</password>
+    </remoteInstance-->
+
+    <!--remoteInstance url="https://localhost:9443/registry">
+        <id>instanceid</id>
+        <dbConfig>wso2registry</dbConfig>
+        <readOnly>false</readOnly>
+        <registryRoot>/</registryRoot>
+    </remoteInstance-->
+
+    <!--mount path="/_system/config" overwrite="true|false|virtual">
+        <instanceId>instanceid</instanceId>
+        <targetPath>/_system/nodes</targetPath>
+    </mount-->
+
+    
+    <versionResourcesOnChange>true</versionResourcesOnChange>
+
+    <!-- NOTE: You can edit the options under "StaticConfiguration" only before the
+     startup. -->
+    <staticConfiguration>
+        <versioningProperties>true</versioningProperties>
+        <versioningComments>true</versioningComments>
+        <versioningTags>true</versioningTags>
+        <versioningRatings>true</versioningRatings>
+    </staticConfiguration>
+</wso2registry>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/secret-conf.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/secret-conf.properties b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/secret-conf.properties
new file mode 100644
index 0000000..b8ad7ed
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/secret-conf.properties
@@ -0,0 +1,37 @@
+#############################################################################
+## Security Configuration
+#############################################################################
+## The following property specifies a global password provider implementation
+## which will be used globally if not overriden in specific configurations
+##carbon.secretProvider=<any implementation of org.apache.synapse.commons.security.secret.SecretCallbackHandler>
+##Examples:
+##carbon.secretProvider=org.apache.synapse.commons.security.secret.handler.SecretManagerSecretCallbackHandler
+##carbon.secretProvider=org.apache.synapse.commons.security.secret.handler.JMXSecretCallbackHandler
+##carbon.secretProvider=org.apache.synapse.commons.security.secret.handler.JlineSecretCallbackHandler
+##carbon.secretProvider=org.apache.synapse.commons.security.secret.handler.JBossEncryptionSecretCallbackHandler
+#
+##Secret Repositories configuration
+#
+#secretRepositories=file
+#secretRepositories.file.provider=org.apache.synapse.commons.security.secret.repository.filebased.FileBaseSecretRepositoryProvider
+#secretRepositories.file.location=cipher-text.properties
+#
+##KeyStores configurations
+#
+#keystore.identity.location=resources/security/wso2carbon.jks
+#keystore.identity.type=JKS
+#keystore.identity.alias=wso2carbon
+#keystore.identity.store.password=wso2carbon
+##keystore.identity.store.secretProvider=<any implementation of org.apache.synapse.commons.security.secret.SecretCallbackHandler>
+#keystore.identity.key.password=wso2carbon
+##keystore.identity.key.secretProvider=<any implementation of org.apache.synapse.commons.security.secret.SecretCallbackHandler>
+##keystore.identity.parameters=enableHostnameVerifier=false;keyStoreCertificateFilePath=/home/esb.cer
+#
+#keystore.trust.location=resources/security/client-truststore.jks
+#keystore.trust.type=JKS
+#keystore.trust.alias=wso2carbon
+#keystore.trust.store.password=wso2carbon
+##keystore.trust.store.secretProvider=<any implementation of org.apache.synapse.commons.security.secret.SecretCallbackHandler>
+#
+#
+#

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/synapse.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/synapse.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/synapse.xml
new file mode 100644
index 0000000..aed5054
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/synapse.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<!-- An empty flat synapse configuration shipped with the WSO2 ESB -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+    
+    <task class="org.wso2.carbon.multiple.instance.endpoint.mgt.autoscale.LocalLoadAnalyzerTask" name="LocalLoadAnalyzer">
+        <property name="maxAppInstances" value="10"/>
+        <property name="minAppInstances" value="1"/>
+        <trigger interval="5"/>
+    </task>
+</definitions>
+<!-- You can add any flat sequences, endpoints, etc.. to this synapse.xml file if you do
+    *not* want to keep the artifacts in several files -->

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-config1.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-config1.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-config1.xml
new file mode 100644
index 0000000..515eb36
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-config1.xml
@@ -0,0 +1,48 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<throttlingConfig xmlns="http://wso2.com/carbon/multitenancy/throttling/config">
+	<tasks>
+		<task>
+			<parameters>
+				<parameter name="interval">15</parameter>
+			</parameters>
+			<dataProviders>
+				<dataProvider
+					class="org.wso2.stratos.throttling.manager.dataproviders.BandwidthDataProvider">
+				</dataProvider>
+				<!--
+					<dataProvider
+					class="org.wso2.stratos.throttling.manager.dataproviders.BillingDataProvider">
+					</dataProvider>
+				-->
+				<dataProvider
+					class="org.wso2.stratos.throttling.manager.dataproviders.DBContentVolumeDataProvider">
+				</dataProvider>
+				<dataProvider
+					class="org.wso2.stratos.throttling.test.utils.CustomDataProvider">
+				</dataProvider>
+				<!--
+					<dataProvider
+					class="org.wso2.stratos.throttling.manager.dataproviders.UsersCountDataProvider">
+					</dataProvider>
+				-->
+			</dataProviders>
+		</task>
+	</tasks>
+</throttlingConfig>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-config2.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-config2.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-config2.xml
new file mode 100644
index 0000000..515eb36
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-config2.xml
@@ -0,0 +1,48 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<throttlingConfig xmlns="http://wso2.com/carbon/multitenancy/throttling/config">
+	<tasks>
+		<task>
+			<parameters>
+				<parameter name="interval">15</parameter>
+			</parameters>
+			<dataProviders>
+				<dataProvider
+					class="org.wso2.stratos.throttling.manager.dataproviders.BandwidthDataProvider">
+				</dataProvider>
+				<!--
+					<dataProvider
+					class="org.wso2.stratos.throttling.manager.dataproviders.BillingDataProvider">
+					</dataProvider>
+				-->
+				<dataProvider
+					class="org.wso2.stratos.throttling.manager.dataproviders.DBContentVolumeDataProvider">
+				</dataProvider>
+				<dataProvider
+					class="org.wso2.stratos.throttling.test.utils.CustomDataProvider">
+				</dataProvider>
+				<!--
+					<dataProvider
+					class="org.wso2.stratos.throttling.manager.dataproviders.UsersCountDataProvider">
+					</dataProvider>
+				-->
+			</dataProviders>
+		</task>
+	</tasks>
+</throttlingConfig>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-config3.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-config3.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-config3.xml
new file mode 100644
index 0000000..515eb36
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-config3.xml
@@ -0,0 +1,48 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<throttlingConfig xmlns="http://wso2.com/carbon/multitenancy/throttling/config">
+	<tasks>
+		<task>
+			<parameters>
+				<parameter name="interval">15</parameter>
+			</parameters>
+			<dataProviders>
+				<dataProvider
+					class="org.wso2.stratos.throttling.manager.dataproviders.BandwidthDataProvider">
+				</dataProvider>
+				<!--
+					<dataProvider
+					class="org.wso2.stratos.throttling.manager.dataproviders.BillingDataProvider">
+					</dataProvider>
+				-->
+				<dataProvider
+					class="org.wso2.stratos.throttling.manager.dataproviders.DBContentVolumeDataProvider">
+				</dataProvider>
+				<dataProvider
+					class="org.wso2.stratos.throttling.test.utils.CustomDataProvider">
+				</dataProvider>
+				<!--
+					<dataProvider
+					class="org.wso2.stratos.throttling.manager.dataproviders.UsersCountDataProvider">
+					</dataProvider>
+				-->
+			</dataProviders>
+		</task>
+	</tasks>
+</throttlingConfig>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-rules1.drl
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-rules1.drl b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-rules1.drl
new file mode 100644
index 0000000..d187c17
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-rules1.drl
@@ -0,0 +1,60 @@
+import org.wso2.stratos.throttling.manager.dataobjects.*;
+import org.wso2.stratos.billing.mgt.dataobjects.*;
+import org.wso2.stratos.common.constants.*;
+
+
+rule clearRestrictions
+when
+$dataContext : ThrottlingDataContext();
+eval($dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY) < 8)
+
+then
+
+ThrottlingAccessValidation validation = $dataContext.getAccessValidation();
+validation.setTenantBlocked(StratosConstants.THROTTLING_IN_DATA_ACTION,
+            false, null);
+
+end
+
+
+rule restrictFileSize
+when
+$dataContext : ThrottlingDataContext();
+eval($dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY) > 8 &&
+                            $dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY)  < 10)
+
+then
+
+ThrottlingAccessValidation validation = $dataContext.getAccessValidation();
+validation.setTenantBlocked(StratosConstants.THROTTLING_IN_DATA_ACTION,
+            true, "Your data is big. Bigger than 8");
+
+end
+
+rule stranageTest1Rule
+when
+$package: MultitenancyPackage(name == "test1")
+$dataContext : ThrottlingDataContext()
+eval($dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY)  > 15 &&
+            $dataContext.getDataObject(ThrottlingDataEntryConstants.PACKAGE) == $package)
+
+then
+
+ThrottlingAccessValidation validation = $dataContext.getAccessValidation();
+validation.setTenantBlocked(StratosConstants.THROTTLING_IN_DATA_ACTION,
+            true, "the strange condition for test1 is met");
+
+end
+
+rule strangeTest2Rule
+when
+$package: MultitenancyPackage(name == "test2")
+$dataContext : ThrottlingDataContext()
+eval($dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY)  > 15 &&
+            $dataContext.getDataObject(ThrottlingDataEntryConstants.PACKAGE) == $package)
+then
+ThrottlingAccessValidation validation = $dataContext.getAccessValidation();
+validation.setTenantBlocked(StratosConstants.THROTTLING_IN_DATA_ACTION,
+            true, "the strange condition for test2 is met");
+
+end

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-rules2.drl
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-rules2.drl b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-rules2.drl
new file mode 100644
index 0000000..0b8804e
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-rules2.drl
@@ -0,0 +1,18 @@
+import org.wso2.stratos.throttling.manager.dataobjects.*;
+import org.wso2.stratos.common.constants.*;
+
+rule restrictBandwidth
+when
+
+$dataContext : ThrottlingDataContext()
+eval($dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_INCOMING_BANDWIDTH) > 12)
+
+then
+
+ThrottlingAccessValidation validation = $dataContext.getAccessValidation();
+long tenantIncomingBandwidth = $dataContext.getDataLong(
+		ThrottlingDataEntryConstants.TENANT_INCOMING_BANDWIDTH);
+validation.setTenantBlocked(StratosConstants.THROTTLING_IN_DATA_ACTION, true,
+		"Your incoming bw is big. Bigger than 12. your value: " + tenantIncomingBandwidth);
+
+end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-rules3.drl
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-rules3.drl b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-rules3.drl
new file mode 100644
index 0000000..481d903
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/throttling-rules3.drl
@@ -0,0 +1,17 @@
+import org.wso2.stratos.throttling.manager.dataobjects.*;
+import org.wso2.stratos.common.constants.*;
+
+rule restrictCapacity
+when
+
+$dataContext : ThrottlingDataContext()
+eval($dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY) > 12)
+
+then
+
+ThrottlingAccessValidation validation = $dataContext.getAccessValidation();
+long tenantCapacity = $dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY);
+validation.setTenantBlocked(StratosConstants.THROTTLING_IN_DATA_ACTION, true,
+            "Your resource volume is big. Bigger than 12. your value: " + tenantCapacity);
+
+end
\ No newline at end of file


[07/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/rules/RuleInvoker.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/rules/RuleInvoker.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/rules/RuleInvoker.java
deleted file mode 100644
index 9526970..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/rules/RuleInvoker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.rules;
-
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.rule.common.Rule;
-import org.wso2.carbon.rule.common.RuleSet;
-import org.wso2.carbon.rule.common.util.Constants;
-import org.wso2.carbon.rule.kernel.backend.RuleBackendRuntime;
-import org.wso2.carbon.rule.kernel.backend.RuleBackendRuntimeFactory;
-import org.wso2.carbon.rule.kernel.backend.Session;
-import org.wso2.carbon.rule.kernel.config.RuleEngineProvider;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-import org.wso2.carbon.throttling.manager.utils.Util;
-
-public class RuleInvoker {
-    private static final Log log = LogFactory.getLog(RuleInvoker.class);
-    Session session;
-
-    public RuleInvoker() throws ThrottlingException {
-        updateRules();
-    }
-
-    public synchronized void invoke(List<Object> knowledgeBase) throws ThrottlingException {
-
-        try {
-            session.execute(knowledgeBase);
-        } catch (Exception e) {
-            String msg = "Error occurred while executing the throttling rules: " + e.getMessage();
-            log.error(msg);
-            throw new ThrottlingException(msg, e);
-        }
-    }
-
-    public synchronized void updateRules() throws ThrottlingException {
-        
-        RuleEngineProvider ruleEngineProvider = 
-                Util.getRuleEngineConfigService().getRuleConfig().getRuleEngineProvider();
-        
-        Class ruleBackendRuntimeFactoryClass;
-        RuleBackendRuntime ruleBackendRuntime;
-        
-        try{
-            ruleBackendRuntimeFactoryClass = Class.forName(ruleEngineProvider.getClassName());
-            RuleBackendRuntimeFactory ruleBackendRuntimeFactory = 
-                    (RuleBackendRuntimeFactory) ruleBackendRuntimeFactoryClass.newInstance();
-            ruleBackendRuntime = 
-                    ruleBackendRuntimeFactory.getRuleBackendRuntime(ruleEngineProvider.getProperties(), 
-                                                                    Thread.currentThread().getContextClassLoader());
-
-            // create a rule set to add
-            RuleSet ruleSet = new RuleSet();
-            Rule rule = new Rule();
-            rule.setResourceType(Constants.RULE_RESOURCE_TYPE_REGULAR);
-
-            rule.setSourceType(Constants.RULE_SOURCE_TYPE_REGISTRY);
-            rule.setValue("gov:" + StratosConstants.THROTTLING_RULES_PATH);
-            ruleSet.addRule(rule);
-
-            ruleBackendRuntime.addRuleSet(ruleSet);
-
-            this.session = ruleBackendRuntime.createSession(Constants.RULE_STATEFUL_SESSION);
-
-        }catch(Exception e){
-
-            String msg = "Error occurred while initializing the rule executing environment: " + e.getMessage();
-            log.error(msg);
-            throw new ThrottlingException(msg, e);
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/rules/RuleProperty.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/rules/RuleProperty.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/rules/RuleProperty.java
deleted file mode 100644
index 159fc60..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/rules/RuleProperty.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.rules;
-
-public class RuleProperty {
-    String key;
-    String value;
-    
-    public RuleProperty(String key, String value) {
-        this.key = key;
-        this.value = value;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public void setKey(String key) {
-        this.key = key;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/scheduling/ThrottlingJob.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/scheduling/ThrottlingJob.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/scheduling/ThrottlingJob.java
deleted file mode 100644
index 60ab9db..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/scheduling/ThrottlingJob.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.scheduling;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.wso2.carbon.context.PrivilegedCarbonContext;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataContext;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-import org.wso2.carbon.throttling.manager.rules.KnowledgeBaseManager;
-import org.wso2.carbon.throttling.manager.rules.RuleInvoker;
-import org.wso2.carbon.throttling.manager.tasks.Task;
-import org.wso2.carbon.throttling.manager.utils.Util;
-import org.wso2.carbon.throttling.manager.validation.ValidationInfoManager;
-import org.wso2.carbon.user.core.UserStoreException;
-import org.wso2.carbon.user.core.tenant.Tenant;
-import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class ThrottlingJob implements Job {
-    private static final Log log = LogFactory.getLog(ThrottlingJob.class);
-    public static final String THROTTLING_TASK_CONTEXT_KEY = "throttlingTask";
-
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
-        carbonContext.setTenantId(MultitenantConstants.SUPER_TENANT_ID);
-        Task task = (Task) jobExecutionContext.getMergedJobDataMap().get(THROTTLING_TASK_CONTEXT_KEY);
-        executeTask(task);
-    }
-
-    public void executeTask(Task task) throws JobExecutionException {
-        // initialize and prepare the knowledge base.
-        List<Object> knowledgeBase = new ArrayList<Object>();
-        Map<Integer, ThrottlingDataContext> contextMap;
-        try {
-            contextMap = feedKnowledgeBase(task, knowledgeBase);
-        } catch (ThrottlingException e) {
-            String msg = "Error in feeding knowledge base.";
-            log.error(msg, e);
-            throw new JobExecutionException(msg, e);
-        }
-
-        // invoke the rule.
-        RuleInvoker ruleInvoker = task.getRuleInvoker();
-        try {
-            //updating the rule. this is important if we are having more than one managers running
-            ruleInvoker.updateRules();
-            ruleInvoker.invoke(knowledgeBase);
-            log.info("Throttling rules executed successfully");
-        } catch (ThrottlingException e) {
-            String msg = "Error in invoking the throttling rule invoker.";
-            log.error(msg, e);
-            throw new JobExecutionException(msg, e);
-        }
-        // now persist the access validation information
-        for (int tenantId : contextMap.keySet()) {
-            ThrottlingDataContext dataContext = contextMap.get(tenantId);
-            try {
-                ValidationInfoManager.persistValidationDetails(dataContext);
-            } catch (ThrottlingException e) {
-                String msg = "Error in persisting validation details. Tenant id: " + tenantId + ".";
-                log.error(msg, e);
-                throw new JobExecutionException(msg, e);
-            }
-        }
-    }
-
-    private Map<Integer, ThrottlingDataContext> feedKnowledgeBase(Task task,
-            List<Object> knowledgeBase) throws ThrottlingException {
-        Map<Integer, ThrottlingDataContext> contextMap =
-                new HashMap<Integer, ThrottlingDataContext>();
-        // execute the task for each tenant
-        Tenant[] tenants;
-        try {
-            tenants = Util.getAllTenants();
-        } catch (UserStoreException e) {
-            String msg = "Error in getting all the tenants.";
-            log.error(msg, e);
-            throw new ThrottlingException(msg, e);
-        }
-        // prepare the knowledge base using data on each tenant
-
-        for (Tenant tenant : tenants) {
-            if (!tenant.isActive()) {
-                continue;
-            }
-            int tenantId = tenant.getId();
-
-            ThrottlingDataContext throttlingDataContext =
-                    KnowledgeBaseManager.feedKnowledgeBase(tenantId, task, knowledgeBase);
-
-            // store the context in the map.
-            contextMap.put(tenantId, throttlingDataContext);
-        }
-        return contextMap;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/services/MultitenancyThrottlingService.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/services/MultitenancyThrottlingService.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/services/MultitenancyThrottlingService.java
deleted file mode 100644
index 0e85f3c..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/services/MultitenancyThrottlingService.java
+++ /dev/null
@@ -1,58 +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.throttling.manager.services;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.core.AbstractAdmin;
-import org.wso2.carbon.throttling.agent.client.ThrottlingRuleInvoker;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataContext;
-import org.wso2.carbon.throttling.manager.rules.KnowledgeBaseManager;
-import org.wso2.carbon.throttling.manager.rules.RuleInvoker;
-import org.wso2.carbon.throttling.manager.tasks.Task;
-import org.wso2.carbon.throttling.manager.utils.Util;
-import org.wso2.carbon.throttling.manager.validation.ValidationInfoManager;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class MultitenancyThrottlingService extends AbstractAdmin implements ThrottlingRuleInvoker {
-    
-    private static Log log = LogFactory.getLog(MultitenancyThrottlingService.class);
-
-    public void executeThrottlingRules(int tenantId) throws Exception {
-
-        //UserRegistry registry = (UserRegistry) getGovernanceUserRegistry();
-        int currentTenantId = tenantId;
-        
-        List<Task> tasks = Util.getTasks();
-        for (Task task: tasks) {
-            // initialize the knowledge base
-            List<Object> knowledgeBase = new ArrayList<Object>();
-            ThrottlingDataContext throttlingDataContext =
-                    KnowledgeBaseManager.feedKnowledgeBase(currentTenantId, task, knowledgeBase);
-
-            RuleInvoker ruleInvoker = task.getRuleInvoker();
-            ruleInvoker.invoke(knowledgeBase);
-
-            log.info("Throttling rules executed for tenant id: " + currentTenantId);
-            
-            ValidationInfoManager.persistValidationDetails(throttlingDataContext);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/services/ThrottlingRuleEditorService.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/services/ThrottlingRuleEditorService.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/services/ThrottlingRuleEditorService.java
deleted file mode 100644
index e7e0136..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/services/ThrottlingRuleEditorService.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.services;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.throttling.manager.rules.RuleInvoker;
-import org.wso2.carbon.throttling.manager.tasks.Task;
-import org.wso2.carbon.throttling.manager.utils.Util;
-
-import java.util.List;
-
-/**
- * This is a super tenant service to manage throttling rules
- */
-public class ThrottlingRuleEditorService {
-    private static final Log log = LogFactory.getLog(ThrottlingRuleEditorService.class);
-
-    /**
-     * Retrieve Throttling Rules
-     *
-     * @throws Exception, if retrieving the throttling rules failed.
-     * @return, rule content
-     */
-    public String retrieveThrottlingRules() throws Exception {
-        // getting the resource content.
-        UserRegistry systemRegistry = Util.getSuperTenantGovernanceSystemRegistry();
-        Resource ruleContentResource = systemRegistry.get(StratosConstants.THROTTLING_RULES_PATH);
-        Object ruleContent = ruleContentResource.getContent();
-        if (ruleContent instanceof String) {
-            return (String) ruleContent;
-        } else if (ruleContent instanceof byte[]) {
-            return new String((byte[]) ruleContent);
-        }
-        String msg = "Unidentified type for the registry resource content. type: " +
-                     ruleContent.getClass().getName();
-        log.error(msg);
-        throw new Exception(msg);
-    }
-
-    /**
-     * Update throttling rules.
-     *
-     * @param ruleContent - content of the rule.
-     * @throws Exception, if updating the throttling rules failed.
-     */
-    public void updateThrottlingRules(String ruleContent) throws Exception {
-        // updating the rule content
-        boolean updateSuccess = false;
-        UserRegistry systemRegistry = Util.getSuperTenantGovernanceSystemRegistry();
-        try {
-            systemRegistry.beginTransaction();
-            Resource ruleContentResource = systemRegistry.get(StratosConstants.THROTTLING_RULES_PATH);
-            ruleContentResource.setContent(ruleContent);
-            systemRegistry.put(StratosConstants.THROTTLING_RULES_PATH, ruleContentResource);
-
-            List<Task> tasks = Util.getTasks();
-            for (Task task : tasks) {
-                RuleInvoker ruleInvoker = task.getRuleInvoker();
-                ruleInvoker.updateRules();
-            }
-            updateSuccess = true;
-        } finally {
-            if (updateSuccess) {
-                systemRegistry.commitTransaction();
-            } else {
-                systemRegistry.rollbackTransaction();
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/tasks/Task.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/tasks/Task.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/tasks/Task.java
deleted file mode 100644
index 69df3fc..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/tasks/Task.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.tasks;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.throttling.manager.conf.ThrottlingTaskConfiguration;
-import org.wso2.carbon.throttling.manager.conf.ThrottlingTaskDataProviderConfiguration;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataContext;
-import org.wso2.carbon.throttling.manager.dataproviders.DataProvider;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-import org.wso2.carbon.throttling.manager.rules.RuleInvoker;
-import org.wso2.carbon.throttling.manager.utils.DataProviderIterator;
-
-public class Task {
-    private static final Log log = LogFactory.getLog(Task.class);
-    private static final int DEFAULT_INTERVAL = 15; // in minute
-    Map<String, String> parameters;
-    DataProviderIterator dataProviderIterator;
-    RuleInvoker ruleInvoker;
-
-    public Task(Map<String, String> parameters,
-            List<ThrottlingTaskDataProviderConfiguration> dataProviderConfigs)
-            throws ThrottlingException {
-        this.parameters = parameters;
-        this.dataProviderIterator = new DataProviderIterator(dataProviderConfigs);
-        // initialize the rule invokers
-        ruleInvoker = new RuleInvoker();
-    }
-
-    public void prepareData(ThrottlingDataContext dataContext) throws ThrottlingException {
-        dataProviderIterator.reset();
-        while (dataProviderIterator.hasNext()) {
-            final DataProvider dataProvider = (DataProvider) dataProviderIterator.next();
-            if (dataProvider == null) {
-                String msg =
-                        "Error in invoking the data provider. " + "dataProviderConfigs is null or "
-                                + "data provider is not yet loaded";
-                log.error(msg);
-                throw new ThrottlingException(msg);
-            }
-            dataProvider.invoke(dataContext);
-            if (dataContext.isProcessingComplete()) {
-                break;
-            }
-        }
-    }
-
-    public Map<String, String> getParameters() {
-        return parameters;
-    }
-
-    public int getTriggerInterval() {
-        if (this.parameters == null ||
-                this.parameters.get(ThrottlingTaskConfiguration.INTERVAL_PARAM_KEY) == null) {
-            return DEFAULT_INTERVAL * 60 * 1000;
-        }
-        return Integer.parseInt(
-                this.parameters.get(ThrottlingTaskConfiguration.INTERVAL_PARAM_KEY)) * 60 * 1000;
-    }
-    
-    public int getStartDelayInterval(){
-        if (this.parameters == null || 
-                this.parameters.get(ThrottlingTaskConfiguration.DELAY_PARAM_KEY) == null){
-            return DEFAULT_INTERVAL * 60 * 1000;
-        }
-        
-        return Integer.parseInt(
-                this.parameters.get(ThrottlingTaskConfiguration.DELAY_PARAM_KEY)) * 60 * 1000;
-    }
-
-    public RuleInvoker getRuleInvoker() {
-        return ruleInvoker;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/utils/DataProviderIterator.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/utils/DataProviderIterator.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/utils/DataProviderIterator.java
deleted file mode 100644
index 1f5ac0b..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/utils/DataProviderIterator.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.utils;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.throttling.manager.conf.ThrottlingTaskDataProviderConfiguration;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-
-// we are dynamically initializing handlers, so uses an iterator to iteration
-public class DataProviderIterator implements Iterator {
-    private static final Log log = LogFactory.getLog(DataProviderIterator.class);
-    private ThreadLocal<Integer> index = new ThreadLocal<Integer>() {
-        protected Integer initialValue() {
-            return 0;
-        }
-    };
-    
-    List<ThrottlingTaskDataProviderConfiguration> dataProviderConfigs;
-    
-    public DataProviderIterator(List<ThrottlingTaskDataProviderConfiguration> dataProviderConfigs) {
-        this.dataProviderConfigs = dataProviderConfigs;
-        reset();
-    }
-
-    public boolean hasNext() {
-        int i = index.get();
-        return (i < dataProviderConfigs.size());
-    }
-
-    public Object next() {
-        int i = index.get();
-        ThrottlingTaskDataProviderConfiguration handlerConfig = dataProviderConfigs.get(i++);
-        index.set(i);
-        try {
-            return handlerConfig.getDataProvider();
-        } catch (ThrottlingException e) {
-            String msg = "DataProvider for the dataProviderConfigs config is null. " +
-            		"dataProviderConfigs index: " + (i - 1) + ".";
-            log.error(msg);                        
-        }
-        return null;
-    }
-
-    public void remove() {
-        // doesn't need to be remove
-    }
-
-    // additional method
-    public void reset() {
-        index.set(0);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/utils/Util.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/utils/Util.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/utils/Util.java
deleted file mode 100644
index 15c1c19..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/utils/Util.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.utils;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.task.TaskDescription;
-import org.apache.synapse.task.TaskScheduler;
-import org.apache.synapse.task.TaskSchedulerFactory;
-import org.osgi.framework.BundleContext;
-import org.wso2.carbon.billing.core.BillingEngine;
-import org.wso2.carbon.billing.core.BillingException;
-import org.wso2.carbon.billing.core.BillingManager;
-import org.wso2.carbon.billing.core.dataobjects.Customer;
-import org.wso2.carbon.billing.core.dataobjects.Item;
-import org.wso2.carbon.billing.core.dataobjects.Subscription;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.registry.core.service.RegistryService;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.registry.core.utils.UUIDGenerator;
-import org.wso2.carbon.rule.kernel.config.RuleEngineConfigService;
-import org.wso2.carbon.user.core.UserStoreException;
-import org.wso2.carbon.user.core.service.RealmService;
-import org.wso2.carbon.user.core.tenant.Tenant;
-import org.wso2.carbon.user.core.tenant.TenantManager;
-import org.wso2.carbon.utils.CarbonUtils;
-import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
-import org.wso2.carbon.billing.mgt.api.MultitenancyBillingInfo;
-import org.wso2.carbon.billing.mgt.dataobjects.MultitenancyPackage;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.throttling.agent.client.ThrottlingRuleInvoker;
-import org.wso2.carbon.throttling.manager.conf.ThrottlingConfiguration;
-import org.wso2.carbon.throttling.manager.dataproviders.DataProvider;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-import org.wso2.carbon.throttling.manager.scheduling.ThrottlingJob;
-import org.wso2.carbon.throttling.manager.services.MultitenancyThrottlingService;
-import org.wso2.carbon.throttling.manager.tasks.Task;
-import org.wso2.carbon.usage.api.TenantUsageRetriever;
-
-import java.io.File;
-import java.lang.reflect.Constructor;
-import java.text.DateFormatSymbols;
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Util methods for throttling manager.
- */
-public class Util {
-    private static final Log log = LogFactory.getLog(Util.class);
-    private static RegistryService registryService;
-    private static RealmService realmService;
-    private static RuleEngineConfigService ruleEngineConfigService;
-    private static BillingManager billingManager;
-    private static BundleContext bundleContext;
-    private static TenantUsageRetriever tenantUsageRetriever;
-    private static MultitenancyBillingInfo mtBillingInfo;
-    private static final String THROTTLING_CONFIG = "usage-throttling-agent-config.xml";
-    private static final String THROTTLING_TASK_ID = "throttling-task";
-    private static ThrottlingConfiguration throttlingConfiguration;
-    private static final String THROTTLING_RULE_FILE = "throttling-rules.drl";
-
-    public static synchronized void setRegistryService(RegistryService service) {
-        if (registryService == null) {
-            registryService = service;
-        }
-    }
-
-    public static RegistryService getRegistryService() {
-        return registryService;
-    }
-
-    public static synchronized void setRealmService(RealmService service) {
-        if (realmService == null) {
-            realmService = service;
-        }
-    }
-
-    public static synchronized void setBundleContext(BundleContext context) {
-        if (bundleContext == null) {
-            bundleContext = context;
-        }
-    }
-
-    public static void setTenantUsageRetriever(TenantUsageRetriever tenantUsageRetriever) {
-        Util.tenantUsageRetriever = tenantUsageRetriever;
-    }
-
-    public static RealmService getRealmService() {
-        return realmService;
-    }
-
-    public static UserRegistry getSuperTenantGovernanceSystemRegistry() throws RegistryException {
-        return registryService.getGovernanceSystemRegistry();
-    }
-
-    public static TenantUsageRetriever getTenantUsageRetriever() {
-        return tenantUsageRetriever;
-    }
-
-    public static void setRuleEngineConfigService(
-            RuleEngineConfigService ruleEngineConfigService) {
-        Util.ruleEngineConfigService = ruleEngineConfigService;
-    }
-
-    public static RuleEngineConfigService getRuleEngineConfigService() {
-        return Util.ruleEngineConfigService;
-    }
-
-    public static BillingManager getBillingManager() {
-        return billingManager;
-    }
-
-    public static void setBillingManager(BillingManager billingManager) {
-        Util.billingManager = billingManager;
-    }
-
-    /**
-     * get current billing customer.
-     *
-     * @param tenantId, tenant id.
-     * @return Customer
-     * @throws RegistryException, if getting the current billing customer failed.
-     */
-    public static Customer getCurrentBillingCustomer(int tenantId) throws RegistryException {
-        // get the host name of the current domain
-        if (tenantId == MultitenantConstants.SUPER_TENANT_ID) {
-            return null;
-        }
-        Tenant tenant;
-        try {
-            tenant = (Tenant) realmService.getTenantManager().getTenant(tenantId);
-        } catch (org.wso2.carbon.user.api.UserStoreException e) {
-            String msg = "Error in getting the realm Information.";
-            log.error(msg, e);
-            throw new RegistryException(msg, e);
-        }
-        if (tenant == null) {
-            return null;
-        }
-        String customerName = tenant.getDomain();
-        BillingEngine billingEngine =
-                billingManager.getBillingEngine(StratosConstants.MULTITENANCY_VIEWING_TASK_ID);
-        Customer customer;
-        try {
-            if (billingEngine != null) {
-                List<Customer> customers = billingEngine.getCustomersWithName(customerName);
-                if (customers == null || customers.size() == 0) {
-                    customer = null;
-                } else {
-                    customer = customers.get(0);
-                }
-            } else {
-                customer=null;
-                String msg = "Error in getting billing Engine";
-                log.error(msg);
-            }
-        } catch (BillingException e) {
-            String msg = "Error in getting the current customer";
-            log.error(msg, e);
-            throw new RegistryException(msg, e);
-        }
-        return customer;
-    }
-
-    /**
-     * get current subscription type for the tenant.
-     *
-     * @param tenantId, tenant id
-     * @throws RegistryException, if getting the current subscription type failed.
-     * @return, Subscripiton
-     */
-    public static Subscription getCurrentSubscription(int tenantId) throws RegistryException {
-        BillingEngine billingEngine =
-                billingManager.getBillingEngine(StratosConstants.MULTITENANCY_SCHEDULED_TASK_ID);
-
-        Customer customer = getCurrentBillingCustomer(tenantId);
-        if (customer == null) {
-            return null;
-        }
-        List<Subscription> subscriptions;
-        try {
-            subscriptions = billingEngine.getActiveSubscriptions(customer);
-        } catch (BillingException e) {
-            String msg = "Error in getting the current subscription.";
-            log.error(msg, e);
-            throw new RegistryException(msg, e);
-        }
-        if (subscriptions == null || subscriptions.size() == 0) {
-            return null;
-        }
-        Subscription subscription = subscriptions.get(0);
-        if (subscription.getActiveUntil().getTime() <= System.currentTimeMillis()) {
-            return null;
-        }
-        int itemId = subscription.getItem().getId();
-        // fill with a correct item
-        Item item;
-        try {
-            item = billingEngine.getItem(itemId);
-        } catch (BillingException e) {
-            String msg = "Error in getting the item for item id: " + itemId + ".";
-            log.error(msg, e);
-            throw new RegistryException(msg, e);
-        }
-        subscription.setItem(item);
-        return subscription;
-    }
-
-    /**
-     * get current billing package.
-     *
-     * @param tenantId, tenant id.
-     * @return MultitenancyPackage
-     * @throws RegistryException, if getting the current billing package failed.
-     */
-    public static MultitenancyPackage getCurrentBillingPackage(int tenantId)
-            throws RegistryException {
-        if (mtBillingInfo == null) {
-            String msg =
-                    "Error in retrieving the current billing package. The package info is null.";
-            log.error(msg);
-            throw new RegistryException(msg);
-        }
-        List<MultitenancyPackage> multitenancyPackages = mtBillingInfo.getMultitenancyPackages();
-        Subscription subscription = getCurrentSubscription(tenantId);
-        Item currentPackage;
-        if (subscription == null) {
-            currentPackage = null;
-        } else {
-            currentPackage = subscription.getItem();
-        }
-        MultitenancyPackage currentMultitenancyPackage = null;
-        for (MultitenancyPackage multitenancyPackage : multitenancyPackages) {
-            if (multitenancyPackage.getName().toLowerCase().contains("free") &&
-                    currentPackage == null) {
-                currentMultitenancyPackage = multitenancyPackage;
-                break;
-            } else if (currentPackage != null &&
-                    multitenancyPackage.getName().equals(currentPackage.getName())) {
-                currentMultitenancyPackage = multitenancyPackage;
-                break;
-            }
-        }
-        return currentMultitenancyPackage;
-    }
-
-    /**
-     * get maximum users allowed for a tenant.
-     *
-     * @param tenantId, tenant id
-     * @throws RegistryException, if getting the maximum number of users failed.
-     * @return, maximum number of users allowed.
-     */
-    public static int getMaximumUsersAllow(int tenantId) throws RegistryException {
-        MultitenancyPackage multitenancyPackage = getCurrentBillingPackage(tenantId);
-        if (multitenancyPackage == null) {
-            String msg = "The multitenancy package is null.";
-            log.error(msg);
-            throw new RegistryException(msg);
-        }
-        return multitenancyPackage.getUsersLimit();
-    }
-
-    /**
-     * returns the maximum resource volume in bytes
-     *
-     * @param tenantId, tenant id
-     * @return Resource volume limit.
-     * @throws RegistryException, if getting the maximum resource limit failed.
-     */
-    public static long getMaximumResourceVolume(int tenantId) throws RegistryException {
-        MultitenancyPackage multitenancyPackage = getCurrentBillingPackage(tenantId);
-        if (multitenancyPackage == null) {
-            String msg = "The multitenancy package is null.";
-            log.error(msg);
-            throw new RegistryException(msg);
-        }
-        // converting the mb to bytes
-        return ((long) multitenancyPackage.getResourceVolumeLimit()) * 1024 * 1024;
-    }
-
-    /**
-     * get the current month
-     *
-     * @param calendar, Calendar
-     * @return, year-month
-     */
-    public static String getCurrentMonthString(Calendar calendar) {
-        int currentMonth = calendar.get(Calendar.MONTH);
-
-        String[] monthArr = new DateFormatSymbols().getMonths();
-        String month = monthArr[currentMonth];
-        return calendar.get(Calendar.YEAR) + "-" + month;
-    }
-
-    public static void registerTaskOSGIService(Task task) {
-        if (bundleContext != null) {
-            bundleContext.registerService(Task.class.getName(), task, null);
-        }
-    }
-
-    public static void registerHandlerOSGIService(DataProvider handler) {
-        if (bundleContext != null) {
-            bundleContext.registerService(DataProvider.class.getName(), handler, null);
-        }
-    }
-
-    public static void setMultitenancyBillingInfo(MultitenancyBillingInfo mtBillingInfo) {
-        Util.mtBillingInfo = mtBillingInfo;
-    }
-
-    /**
-     * Construct the object for the given class
-     *
-     * @param className - name of the class
-     * @return the constructed object.
-     * @throws ThrottlingException, if constructing the object failed.
-     */
-    public static Object constructObject(String className) throws ThrottlingException {
-        Class cl;
-        Constructor co;
-        Object obj;
-        try {
-            cl = Class.forName(className);
-        } catch (ClassNotFoundException e) {
-            String msg = "The class: " + className + " is not in the classpath.";
-            log.error(msg, e);
-            throw new ThrottlingException(msg, e);
-        }
-
-        try {
-            co = cl.getConstructor();
-        } catch (NoSuchMethodException e) {
-            String msg = "The default constructor for the  is not available for " + className + ".";
-            log.error(msg, e);
-            throw new ThrottlingException(msg, e);
-        }
-        try {
-            obj = co.newInstance();
-        } catch (Exception e) {
-            String msg = "Error in initializing the object for " + className + ".";
-            log.error(msg);
-            throw new ThrottlingException(msg, e);
-        }
-        return obj;
-    }
-
-    public static void registerThrottlingRuleInvoker() {
-        // construct an instance of throttling service as the rule invoker.
-        bundleContext.registerService(ThrottlingRuleInvoker.class.getName(),
-                new MultitenancyThrottlingService(), null);
-    }
-
-    /**
-     * Initialize throttling
-     *
-     * @throws ThrottlingException, if initializing failed.
-     */
-    public static void initializeThrottling() throws ThrottlingException {
-
-        // load the configuration and initialize the billing engine + do the
-        // necessary scheduling.
-        String configFile = CarbonUtils.getCarbonConfigDirPath() + File.separator +
-                StratosConstants.MULTITENANCY_CONFIG_FOLDER + File.separator + THROTTLING_CONFIG;
-        // the configuration init will initialize task objects.
-        throttlingConfiguration = new ThrottlingConfiguration(configFile);
-        List<Task> throttlingTasks = throttlingConfiguration.getThrottlingTasks();
-
-        // now initialize the scheduling per each task
-        for (Task throttlingTask : throttlingTasks) {
-            initializeScheduling(throttlingTask);
-        }
-    }
-
-    private static void initializeScheduling(Task throttlingTask) {
-        // generate tasks
-        if (throttlingTask.getTriggerInterval() < 0) {
-            log.info("Throttling manager Validation info service Disabled");
-        } else {
-            String taskName = UUIDGenerator.generateUUID();
-            String groupId = UUIDGenerator.generateUUID();
-
-            TaskDescription taskDescription = new TaskDescription();
-            taskDescription.setName(taskName);
-            taskDescription.setGroup(groupId);
-            // we are triggering only at the period
-
-            taskDescription.setInterval(throttlingTask.getTriggerInterval());
-
-            //Delay first run by given minutes
-            Calendar startTime = Calendar.getInstance();
-            startTime.add(Calendar.MILLISECOND, throttlingTask.getStartDelayInterval());
-            taskDescription.setStartTime(startTime.getTime());
-
-            Map<String, Object> resources = new HashMap<String, Object>();
-            resources.put(ThrottlingJob.THROTTLING_TASK_CONTEXT_KEY, throttlingTask);
-
-            TaskScheduler taskScheduler = TaskSchedulerFactory.getTaskScheduler(THROTTLING_TASK_ID);
-            if (!taskScheduler.isInitialized()) {
-                Properties properties = new Properties();
-                taskScheduler.init(properties);
-            }
-            taskScheduler.scheduleTask(taskDescription, resources, ThrottlingJob.class);
-        }
-    }
-
-    /**
-     * get all the tenants
-     *
-     * @return Tenant[]
-     * @throws UserStoreException, if getting the tenants failed.
-     */
-    public static Tenant[] getAllTenants() throws UserStoreException {
-        TenantManager tenantManager = realmService.getTenantManager();
-        try {
-            return (Tenant[]) tenantManager.getAllTenants();
-        } catch (org.wso2.carbon.user.api.UserStoreException e) {
-            throw new UserStoreException(e);
-        }
-    }
-
-    public static List<Task> getTasks() {
-        return throttlingConfiguration.getThrottlingTasks();
-    }
-
-    /**
-     * Load throttling rules
-     *
-     * @throws Exception, if loading the throttling rules failed.
-     */
-    public static void loadThrottlingRules() throws Exception {
-        UserRegistry systemRegistry = getSuperTenantGovernanceSystemRegistry();
-        if (systemRegistry.resourceExists(StratosConstants.THROTTLING_RULES_PATH)) {
-            return;
-        }
-        String throttlingRuleFile = CarbonUtils.getCarbonConfigDirPath() +
-                File.separator + THROTTLING_RULE_FILE;
-        byte[] content = CarbonUtils.getBytesFromFile(new File(throttlingRuleFile));
-        Resource ruleResource = systemRegistry.newResource();
-        ruleResource.setContent(content);
-        systemRegistry.put(StratosConstants.THROTTLING_RULES_PATH, ruleResource);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/validation/ValidationInfoManager.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/validation/ValidationInfoManager.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/validation/ValidationInfoManager.java
deleted file mode 100644
index ed3d741..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/java/org/wso2/carbon/throttling/manager/validation/ValidationInfoManager.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.manager.validation;
-
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.registry.core.Registry;
-import org.wso2.carbon.registry.core.RegistryConstants;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.stratos.common.util.MeteringAccessValidationUtils;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingAccessValidation;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataContext;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-import org.wso2.carbon.throttling.manager.utils.Util;
-
-public class ValidationInfoManager {
-    private static final Log log = LogFactory.getLog(ValidationInfoManager.class);
-
-    public static void loadValidationDetails(ThrottlingDataContext throttlingDataContext)
-            throws ThrottlingException {
-        int tenantId = throttlingDataContext.getTenantId();
-        // retrieve validation info for the tenant
-        String tenantValidationInfoResourcePath =
-                StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
-                        RegistryConstants.PATH_SEPARATOR + tenantId;
-
-        ThrottlingAccessValidation accessValidation = throttlingDataContext.getAccessValidation();
-        if (accessValidation == null) {
-            accessValidation = new ThrottlingAccessValidation();
-            throttlingDataContext.setAccessValidation(accessValidation);
-        }
-        try {
-            Registry governanceSystemRegistry = Util.getSuperTenantGovernanceSystemRegistry();
-            if (governanceSystemRegistry.resourceExists(tenantValidationInfoResourcePath)) {
-                Resource tenantValidationInfoResource =
-                        governanceSystemRegistry.get(tenantValidationInfoResourcePath);
-                Properties properties = tenantValidationInfoResource.getProperties();
-                Set<String> actions = MeteringAccessValidationUtils.getAvailableActions(properties);
-
-                for (String action : actions) {
-                    String blockActionStr =
-                            tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
-                                    .generateIsBlockedPropertyKey(action));
-
-                    String blockActionMsg =
-                            tenantValidationInfoResource.getProperty(MeteringAccessValidationUtils
-                                    .generateErrorMsgPropertyKey(action));
-                    accessValidation.setTenantBlocked(action, "true".equals(blockActionStr),
-                            blockActionMsg);
-
-                }
-            }
-        } catch (RegistryException e) {
-            String msg =
-                    "Error in getting the tenant validation info.  tenant id: " + tenantId + ".";
-            log.error(msg, e);
-            throw new ThrottlingException(msg, e);
-        }
-    }
-
-    public static void persistValidationDetails(ThrottlingDataContext throttlingDataContext)
-            throws ThrottlingException {
-        int tenantId = throttlingDataContext.getTenantId();
-        // retrieve validation info for the tenant
-        String tenantValidationInfoResourcePath =
-                StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
-                        RegistryConstants.PATH_SEPARATOR + tenantId;
-
-        ThrottlingAccessValidation accessValidation = throttlingDataContext.getAccessValidation();
-        try {
-            Registry governanceSystemRegistry = Util.getSuperTenantGovernanceSystemRegistry();
-
-            Resource tenantValidationInfoResource;
-            if (governanceSystemRegistry.resourceExists(tenantValidationInfoResourcePath)) {
-                tenantValidationInfoResource =
-                        governanceSystemRegistry.get(tenantValidationInfoResourcePath);
-            } else {
-                tenantValidationInfoResource = governanceSystemRegistry.newResource();
-            }
-
-            Set<String> actions = accessValidation.getActions();
-            for (String action : actions) {
-                boolean blockAction = accessValidation.isTenantBlocked(action);
-                String blockActionMsg = accessValidation.getTenantBlockedMsg(action);
-
-                tenantValidationInfoResource.setProperty(MeteringAccessValidationUtils
-                        .generateIsBlockedPropertyKey(action), blockAction ? "true" : "false");
-
-                tenantValidationInfoResource.setProperty(MeteringAccessValidationUtils
-                        .generateErrorMsgPropertyKey(action), blockActionMsg);
-            }
-            governanceSystemRegistry.put(tenantValidationInfoResourcePath,
-                    tenantValidationInfoResource);
-        } catch (RegistryException e) {
-            String msg =
-                    "Error in storing the tenant validation info.  tenant id: " + tenantId + ".";
-            log.error(msg, e);
-            throw new ThrottlingException(msg, e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/resources/META-INF/component.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/resources/META-INF/component.xml
deleted file mode 100644
index 37f00b6..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/resources/META-INF/component.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~  Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-  ~
-  ~  Licensed under the Apache License, Version 2.0 (the "License");
-  ~  you may not use this file except in compliance with the License.
-  ~  You may obtain a copy of the License at
-  ~
-  ~       http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~  Unless required by applicable law or agreed to in writing, software
-  ~  distributed under the License is distributed on an "AS IS" BASIS,
-  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~  See the License for the specific language governing permissions and
-  ~  limitations under the License.
-  -->
-
-<component xmlns="http://products.wso2.org/carbon">
-    <ManagementPermissions>
-        <ManagementPermission>
-            <DisplayName>Configure</DisplayName>
-            <ResourceId>/permission/protected/configure</ResourceId>
-        </ManagementPermission>
-        <ManagementPermission>
-            <DisplayName>Throttling-Rules</DisplayName>
-            <ResourceId>/permission/protected/configure/throttling-rules</ResourceId>
-        </ManagementPermission>
-        <ManagementPermission>
-            <DisplayName>Manage</DisplayName>
-            <ResourceId>/permission/protected/manage</ResourceId>
-        </ManagementPermission>
-        <ManagementPermission>
-            <DisplayName>Throttling</DisplayName>
-            <ResourceId>/permission/protected/manage/throttling</ResourceId>
-        </ManagementPermission>
-    </ManagementPermissions>
-</component>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/resources/META-INF/services.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/resources/META-INF/services.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/resources/META-INF/services.xml
deleted file mode 100644
index 0badf15..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/main/resources/META-INF/services.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ! ! Copyright 2006 The Apache Software Foundation. ! ! Licensed under 
-	the Apache License, Version 2.0 (the "License"); ! you may not use this file 
-	except in compliance with the License. ! You may obtain a copy of the License 
-	at ! ! http://www.apache.org/licenses/LICENSE-2.0 ! ! Unless required by 
-	applicable law or agreed to in writing, software ! distributed under the 
-	License is distributed on an "AS IS" BASIS, ! WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. ! See the License for the specific 
-	language governing permissions and ! limitations under the License. ! -->
-<serviceGroup>
-
-	<service name="MultitenancyThrottlingService" scope="transportsession">
-		<transports>
-			<transport>https</transport>
-		</transports>
-		<parameter name="ServiceClass" locked="false">
-			org.wso2.carbon.throttling.manager.services.MultitenancyThrottlingService
-		</parameter>
-		<parameter name="adminService" locked="true">true</parameter>
-		<parameter name="AuthorizationAction" locked="true">/permission/protected/manage/throttling
-		</parameter>
-
-        <operation name="executeThrottlingRules">
-            <parameter name="superTenantService" locked="true">true</parameter>
-        </operation>
-	</service>
-
-	<service name="ThrottlingRuleEditorService" scope="transportsession">
-		<transports>
-			<transport>https</transport>
-		</transports>
-		<parameter name="ServiceClass" locked="false">
-			org.wso2.carbon.throttling.manager.services.ThrottlingRuleEditorService
-		</parameter>
-		<parameter name="adminService" locked="true">true</parameter>
-		<parameter name="AuthorizationAction" locked="true">/permission/protected/configure/throttling-rules
-		</parameter>
-
-        <operation name="retrieveThrottlingRules">
-            <parameter name="superTenantService" locked="true">true</parameter>
-        </operation>
-
-        <operation name="updateThrottlingRules">
-            <parameter name="superTenantService" locked="true">true</parameter>
-        </operation>
-	</service>
-	
-	<parameter name="hiddenService" locked="true">true</parameter>
-</serviceGroup>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/java/org/wso2/carbon/throttling/test/ThrottlingTest.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/java/org/wso2/carbon/throttling/test/ThrottlingTest.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/java/org/wso2/carbon/throttling/test/ThrottlingTest.java
deleted file mode 100644
index c024f25..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/java/org/wso2/carbon/throttling/test/ThrottlingTest.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.test;
-
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.user.core.tenant.Tenant;
-import org.wso2.carbon.utils.CarbonUtils;
-import org.wso2.carbon.throttling.manager.conf.ThrottlingConfiguration;
-import org.wso2.carbon.throttling.manager.scheduling.ThrottlingJob;
-import org.wso2.carbon.throttling.manager.tasks.Task;
-import org.wso2.carbon.throttling.test.utils.BaseTestCase;
-
-public class ThrottlingTest extends BaseTestCase {
-    public void testLimitResourceSizeRules() throws Exception {
-        Tenant tenant = new Tenant();
-        tenant.setAdminName("admin");
-        tenant.setDomain("abc1.com");
-        tenant.setAdminPassword("admin");
-        tenant.setEmail("admin@abc1.com");
-        tenant.setActive(true);
-
-        int tenantId = realmService.getTenantManager().addTenant(tenant);
-        realmService.getTenantManager().activateTenant(tenantId);
-        registry = registryService.getGovernanceUserRegistry("admin", tenantId);
-
-        String configFile = CarbonUtils.getCarbonConfigDirPath() + "/throttling-config1.xml";
-        String ruleFile = CarbonUtils.getCarbonConfigDirPath() + "/throttling-rules1.drl";
-        // the configuration init will initialize task objects.
-        //ThrottlingConfiguration ignore = new ThrottlingConfiguration(configFile);
-        Task task = getThrottlingTask(configFile, ruleFile);
-
-        Resource r1 = registry.newResource();
-        r1.setContent("12345678");   // 8 byte is ok
-        registry.put("/bang", r1);
-
-        new ThrottlingJob().executeTask(task);
-
-        try {
-            putEmptyResource();
-            assertTrue(true);
-        } catch (Exception e) {
-            e.printStackTrace();
-            assertTrue(false);
-        }
-
-        r1.setContent("123456789");   // 9 byte is not ok
-        registry.put("/bang", r1);
-
-        new ThrottlingJob().executeTask(task);
-        try {
-            putEmptyResource();
-            assertTrue(false); // we expect the exception
-        } catch (Exception e) {
-            assertTrue(true);
-            assertEquals("Your data is big. Bigger than 8", e.getMessage());
-        }
-
-        registry.delete("/bang");
-        new ThrottlingJob().executeTask(task);
-
-        r1.setContent("1234567891011");   // > 10 byte is not ok
-        registry.put("/bang", r1);
-        new ThrottlingJob().executeTask(task);
-        try {
-            putEmptyResource();
-            assertTrue(true);
-        } catch (Exception e) {
-            assertTrue(false);
-            e.printStackTrace();
-        }
-        registry.delete("/bang");
-        new ThrottlingJob().executeTask(task);
-
-        r1.setContent("1234567890123456");
-        registry.put("/bang", r1);
-        new ThrottlingJob().executeTask(task);
-        try {
-            putEmptyResource();
-            assertTrue(false); // we expect the exception
-        } catch (Exception e) {
-            assertTrue(true);
-            assertEquals("the strange condition for test1 is met", e.getMessage());
-        }
-        registry.delete("/bang");
-        new ThrottlingJob().executeTask(task);
-
-        r1.setContent("12345678901234567");
-        registry.put("/bang", r1);
-        new ThrottlingJob().executeTask(task);
-        try {
-            putEmptyResource();
-            assertTrue(false); // we expect the exception
-        } catch (Exception e) {
-            assertTrue(true);
-            assertEquals("the strange condition for test2 is met", e.getMessage());
-        }
-    }
-
-    public void testBandwidthRules() throws Exception {
-
-        Tenant tenant = new Tenant();
-        tenant.setAdminName("admin");
-        tenant.setDomain("abc2.com");
-        tenant.setAdminPassword("admin");
-        tenant.setEmail("admin@abc2.com");
-        tenant.setActive(true);
-
-        int tenantId = realmService.getTenantManager().addTenant(tenant);
-        realmService.getTenantManager().activateTenant(tenantId);
-        registry = registryService.getGovernanceUserRegistry("admin", tenantId);
-
-        String configFile = CarbonUtils.getCarbonConfigDirPath() + "/throttling-config2.xml";
-        String ruleFile = CarbonUtils.getCarbonConfigDirPath() + "/throttling-rules2.drl";
-        // the configuration init will initialize task objects.
-        //ThrottlingConfiguration ignore = new ThrottlingConfiguration(configFile);
-        Task task = getThrottlingTask(configFile, ruleFile);
-
-        Resource r1 = registry.newResource();
-        r1.setContent("12345678");   // 8 byte in
-        registry.put("/bang", r1);
-        new ThrottlingJob().executeTask(task);
-        try {
-            putEmptyResource();
-            assertTrue(true);
-        } catch (Exception e) {
-            assertTrue(false);
-            e.printStackTrace();
-        }
-
-        r1.setContent("12345678");   // another 8 byte in
-        registry.put("/bang", r1);
-        new ThrottlingJob().executeTask(task);
-        try {
-            putEmptyResource();
-            assertTrue(false); // we expect the exception
-        } catch (Exception e) {
-            assertTrue(true);
-            assertEquals("Your incoming bw is big. Bigger than 12. your value: 16", e.getMessage());
-        }
-
-        // setting another 8 bytes, this should give the early message rather than a new one
-
-        new ThrottlingJob().executeTask(task);
-        r1.setContent("12345678");   // another 8 byte in
-        try {
-            registry.put("/bang", r1);
-            assertTrue(false); // we expect the exception
-        } catch (Exception e) {
-            assertTrue(true);
-            // and same exception message (no bigger number than 16)
-            assertEquals("Your incoming bw is big. Bigger than 12. your value: 16", e.getMessage());
-        }
-    }
-
-    public void testDBVolume() throws Exception {
-
-        Tenant tenant = new Tenant();
-        tenant.setAdminName("admin");
-        tenant.setDomain("abc3.com");
-        tenant.setAdminPassword("admin");
-        tenant.setEmail("admin@abc3.com");
-        tenant.setActive(true);
-
-        int tenantId = realmService.getTenantManager().addTenant(tenant);
-        realmService.getTenantManager().activateTenant(tenantId);
-        registry = registryService.getGovernanceUserRegistry("admin", tenantId);
-
-        String configFile = CarbonUtils.getCarbonConfigDirPath() + "/throttling-config3.xml";
-        String ruleFile = CarbonUtils.getCarbonConfigDirPath() + "/throttling-rules3.drl";
-        // the configuration init will initialize task objects.
-        //ThrottlingConfiguration ignore = new ThrottlingConfiguration(configFile);
-        Task task = getThrottlingTask(configFile, ruleFile);
-
-        Resource r1 = registry.newResource();
-        r1.setContent("12345678");   // 8 byte in
-
-        registry.put("/bang", r1);
-        new ThrottlingJob().executeTask(task);
-        try {
-            putEmptyResource();
-            assertTrue(true);
-        } catch (Exception e) {
-            assertTrue(false);
-            e.printStackTrace();
-        }
-
-        r1.setContent("12345678");   // another 8 byte in
-        registry.put("/bang2", r1);
-        new ThrottlingJob().executeTask(task);
-        try {
-            putEmptyResource();
-            assertTrue(false); // we expect the exception
-        } catch (Exception e) {
-            assertTrue(true);
-            assertEquals("Your resource volume is big. Bigger than 12. your value: 16", e.getMessage());
-        }
-
-        // setting another 8 bytes, this should give the early message rather than a new one
-        // if the pre handlers are doing the job. because the value 16 will be increased only
-        // it goes through the pre dataProviderConfigs
-
-        new ThrottlingJob().executeTask(task);
-        r1.setContent("12345678");   // another 8 byte in
-        try {
-            registry.put("/bang3", r1);
-            assertTrue(false); // we expect the exception
-        } catch (Exception e) {
-            assertTrue(true);
-            // and same exception message (no bigger number than 16)
-            assertEquals("Your resource volume is big. Bigger than 12. your value: 16", e.getMessage());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/java/org/wso2/carbon/throttling/test/utils/BaseTestCase.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/java/org/wso2/carbon/throttling/test/utils/BaseTestCase.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/java/org/wso2/carbon/throttling/test/utils/BaseTestCase.java
deleted file mode 100644
index d38a5f9..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/java/org/wso2/carbon/throttling/test/utils/BaseTestCase.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.test.utils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.List;
-
-import javax.sql.DataSource;
-
-import junit.framework.TestCase;
-
-import org.wso2.carbon.registry.core.Registry;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.config.RegistryContext;
-import org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService;
-import org.wso2.carbon.registry.core.jdbc.InMemoryEmbeddedRegistryService;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.user.core.service.RealmService;
-import org.wso2.carbon.utils.CarbonUtils;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.throttling.manager.conf.ThrottlingConfiguration;
-import org.wso2.carbon.registry.core.jdbc.dataaccess.JDBCDataAccessManager;
-import org.wso2.carbon.throttling.manager.tasks.Task;
-import org.wso2.carbon.throttling.manager.utils.Util;
-
-public class BaseTestCase extends TestCase {
-
-    protected static RegistryContext ctx;
-    protected EmbeddedRegistryService registryService;
-    protected Registry registry; // an admin registry
-    protected RealmService realmService;
-
-    public void setUp() throws Exception {
-        if (System.getProperty("carbon.home") == null) {
-            File file = new File("src/test/resources/carbon-home");
-            if (file.exists()) {
-                System.setProperty("carbon.home", file.getAbsolutePath());
-            }
-        }
-
-        InputStream is;
-        try {
-            is = new FileInputStream("src/test/resources/registry.xml");
-        } catch (Exception e) {
-            is = null;
-        }
-        /*
-         * RealmService realmService = new InMemoryRealmService();
-         * RegistryContext registryContext = RegistryContext.getBaseInstance(is,
-         * realmService); registryContext.setSetup(true);
-         * registryContext.selectDBConfig("h2-db");
-         */
-
-        registryService = new InMemoryEmbeddedRegistryService(is);
-        Util.setRegistryService(registryService);
-        org.wso2.carbon.usage.util.Util.setRegistryService(registryService);
-        org.wso2.carbon.usage.agent.util.Util.initializeAllListeners();
-//    TODO    org.wso2.carbon.usage.agent.util.Util.setRegistryService(registryService);
-
-        realmService = RegistryContext.getBaseInstance().getRealmService();
-        Util.setRealmService(realmService);
-        DataSource registryDataSource =
-                ((JDBCDataAccessManager) RegistryContext.getBaseInstance().getDataAccessManager())
-                        .getDataSource();
-        UserRegistry superTenantGovernanceRegistry = registryService.getGovernanceSystemRegistry();
-//   TODO      Util.setTenantUsageRetriever(new TenantUsageRetriever(registryDataSource,
-//                superTenantGovernanceRegistry, registryService));
-
-        /*RuleServerManager ruleServerManager = new RuleServerManager();
-        RuleServerConfiguration configuration =
-                new RuleServerConfiguration(new JSR94BackendRuntimeFactory());
-        ruleServerManager.init(configuration);
-        Util.setRuleEngineConfigService(ruleServerManager);
-        */
-    }
-
-    public Task getThrottlingTask(String configFile, String ruleFile) throws Exception {
-        saveTrottlingRules(ruleFile);
-        ThrottlingConfiguration throttlingConfiguration = new ThrottlingConfiguration(configFile);
-        List<Task> throttlingTasks = throttlingConfiguration.getThrottlingTasks();
-        return throttlingTasks.get(0);
-    }
-    
-    public void saveTrottlingRules(String throttlingRuleFile) throws Exception {
-        UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
-
-        byte[] content = CarbonUtils.getBytesFromFile(new File(throttlingRuleFile));
-        Resource ruleResource = systemRegistry.newResource();
-        ruleResource.setContent(content);
-        systemRegistry.put(StratosConstants.THROTTLING_RULES_PATH, ruleResource);
-    }
-
-    public void putEmptyResource() throws Exception {
-        Resource r = (Resource) registry.newResource();
-        registry.put("/empty", r);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/java/org/wso2/carbon/throttling/test/utils/CustomDataProvider.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/java/org/wso2/carbon/throttling/test/utils/CustomDataProvider.java b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/java/org/wso2/carbon/throttling/test/utils/CustomDataProvider.java
deleted file mode 100644
index 71972a1..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/java/org/wso2/carbon/throttling/test/utils/CustomDataProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.wso2.carbon.throttling.test.utils;
-
-import org.wso2.carbon.billing.mgt.dataobjects.MultitenancyPackage;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataContext;
-import org.wso2.carbon.throttling.manager.dataobjects.ThrottlingDataEntryConstants;
-import org.wso2.carbon.throttling.manager.dataproviders.DataProvider;
-import org.wso2.carbon.throttling.manager.exception.ThrottlingException;
-
-public class CustomDataProvider extends DataProvider {
-    public void invoke(ThrottlingDataContext dataContext) throws ThrottlingException {
-        long dataSize = dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY);
-
-        if (dataSize % 2 == 0) {
-            MultitenancyPackage multiPackage = new MultitenancyPackage();
-            multiPackage.setName("test1");
-            multiPackage.setBandwidthLimit(50);
-
-            dataContext.addDataObject(ThrottlingDataEntryConstants.PACKAGE, multiPackage);
-        } else {
-            MultitenancyPackage multiPackage = new MultitenancyPackage();
-            multiPackage.setName("test2");
-
-            dataContext.addDataObject(ThrottlingDataEntryConstants.PACKAGE, multiPackage);
-            multiPackage.setBandwidthLimit(50);
-        }
-
-    }
-}


[04/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/postgresql.sql
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/postgresql.sql b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/postgresql.sql
deleted file mode 100644
index 4f897da..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/dbscripts/postgresql.sql
+++ /dev/null
@@ -1,427 +0,0 @@
-DROP TABLE IF EXISTS REG_CLUSTER_LOCK;
-CREATE TABLE REG_CLUSTER_LOCK (
-             REG_LOCK_NAME VARCHAR (20),
-             REG_LOCK_STATUS VARCHAR (20),
-             REG_LOCKED_TIME TIMESTAMP,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (REG_LOCK_NAME)
-);
-
-DROP TABLE IF EXISTS REG_LOG;
-DROP SEQUENCE IF EXISTS REG_LOG_PK_SEQ;
-CREATE SEQUENCE REG_LOG_PK_SEQ;
-CREATE TABLE REG_LOG (
-             REG_LOG_ID INTEGER DEFAULT NEXTVAL('REG_LOG_PK_SEQ'),
-             REG_PATH VARCHAR (2000),
-             REG_USER_ID VARCHAR (20) NOT NULL,
-             REG_LOGGED_TIME TIMESTAMP NOT NULL,
-             REG_ACTION INTEGER NOT NULL,
-             REG_ACTION_DATA VARCHAR (500),
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID)
-);
-
-DROP TABLE IF EXISTS REG_PATH;
-DROP SEQUENCE IF EXISTS REG_PATH_PK_SEQ;
-CREATE SEQUENCE REG_PATH_PK_SEQ;
-CREATE TABLE REG_PATH(
-             REG_PATH_ID INTEGER DEFAULT NEXTVAL('REG_PATH_PK_SEQ'),
-             REG_PATH_VALUE VARCHAR(2000) NOT NULL,
-             REG_PATH_PARENT_ID INTEGER,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID)
-);
-
-CREATE INDEX REG_PATH_IND_BY_PATH_VALUE ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID);
-CREATE INDEX REG_PATH_IND_BY_PATH_PARENT_ID  ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID);
-
-DROP TABLE IF EXISTS REG_CONTENT;
-DROP SEQUENCE IF EXISTS REG_CONTENT_PK_SEQ;
-CREATE SEQUENCE REG_CONTENT_PK_SEQ;
-CREATE TABLE REG_CONTENT (
-             REG_CONTENT_ID INTEGER DEFAULT NEXTVAL('REG_CONTENT_PK_SEQ'),
-             REG_CONTENT_DATA BYTEA,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
-);
-
-DROP TABLE IF EXISTS REG_CONTENT_HISTORY;
-CREATE TABLE REG_CONTENT_HISTORY (
-             REG_CONTENT_ID INTEGER NOT NULL,
-             REG_CONTENT_DATA BYTEA,
-             REG_DELETED   SMALLINT,
-             REG_TENANT_ID INTEGER DEFAULT 0,
-             CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
-);
-
-DROP TABLE IF EXISTS REG_RESOURCE;
-DROP SEQUENCE IF EXISTS REG_RESOURCE_PK_SEQ;
-CREATE SEQUENCE REG_RESOURCE_PK_SEQ;
-CREATE TABLE REG_RESOURCE (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR(256),
-            REG_VERSION         INTEGER DEFAULT NEXTVAL('REG_RESOURCE_PK_SEQ'),
-            REG_MEDIA_TYPE      VARCHAR(500),
-            REG_CREATOR         VARCHAR(20) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR(20),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
-);
-
-ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_IND_BY_NAME  ON REG_RESOURCE(REG_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME  ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
-
-DROP TABLE IF EXISTS REG_RESOURCE_HISTORY;
-CREATE TABLE REG_RESOURCE_HISTORY (
-            REG_PATH_ID         INTEGER NOT NULL,
-            REG_NAME            VARCHAR(256),
-            REG_VERSION         INTEGER NOT NULL,
-            REG_MEDIA_TYPE      VARCHAR(500),
-            REG_CREATOR         VARCHAR(20) NOT NULL,
-            REG_CREATED_TIME    TIMESTAMP NOT NULL,
-            REG_LAST_UPDATOR    VARCHAR(20),
-            REG_LAST_UPDATED_TIME    TIMESTAMP NOT NULL,
-            REG_DESCRIPTION     VARCHAR(1000),
-            REG_CONTENT_ID      INTEGER,
-            REG_DELETED         SMALLINT,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
-);
-
-ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME  ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME  ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
-
-DROP TABLE IF EXISTS REG_COMMENT;
-DROP SEQUENCE IF EXISTS REG_COMMENT_PK_SEQ;
-CREATE SEQUENCE REG_COMMENT_PK_SEQ;
-CREATE TABLE REG_COMMENT (
-            REG_ID        INTEGER DEFAULT NEXTVAL('REG_COMMENT_PK_SEQ'),
-            REG_COMMENT_TEXT      VARCHAR(500) NOT NULL,
-            REG_USER_ID           VARCHAR(20) NOT NULL,
-            REG_COMMENTED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-DROP TABLE IF EXISTS REG_RESOURCE_COMMENT;
-CREATE TABLE REG_RESOURCE_COMMENT (
-            REG_COMMENT_ID          INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-);
-
-ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION  ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID);
-
-DROP TABLE IF EXISTS REG_RATING;
-DROP SEQUENCE IF EXISTS REG_RATING_PK_SEQ;
-CREATE SEQUENCE REG_RATING_PK_SEQ;
-CREATE TABLE REG_RATING (
-            REG_ID     INTEGER DEFAULT NEXTVAL('REG_RATING_PK_SEQ'),
-            REG_RATING        INTEGER NOT NULL,
-            REG_USER_ID       VARCHAR(20) NOT NULL,
-            REG_RATED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-DROP TABLE IF EXISTS REG_RESOURCE_RATING;
-CREATE TABLE REG_RESOURCE_RATING (
-            REG_RATING_ID           INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-);
-
-ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION  ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID);
-
-DROP TABLE IF EXISTS REG_TAG;
-DROP SEQUENCE IF EXISTS REG_TAG_PK_SEQ;
-CREATE SEQUENCE REG_TAG_PK_SEQ;
-CREATE TABLE REG_TAG (
-            REG_ID         INTEGER DEFAULT NEXTVAL('REG_TAG_PK_SEQ'),
-            REG_TAG_NAME       VARCHAR(500) NOT NULL,
-            REG_USER_ID        VARCHAR(20) NOT NULL,
-            REG_TAGGED_TIME    TIMESTAMP NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-DROP TABLE IF EXISTS REG_RESOURCE_TAG;
-CREATE TABLE REG_RESOURCE_TAG (
-            REG_TAG_ID              INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-);
-
-ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION  ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID);
-
-DROP TABLE IF EXISTS REG_PROPERTY;
-DROP SEQUENCE IF EXISTS REG_PROPERTY_PK_SEQ;
-CREATE SEQUENCE REG_PROPERTY_PK_SEQ;
-CREATE TABLE REG_PROPERTY (
-            REG_ID         INTEGER DEFAULT NEXTVAL('REG_PROPERTY_PK_SEQ'),
-            REG_NAME       VARCHAR(100) NOT NULL,
-            REG_VALUE        VARCHAR(1000),
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID)
-);
-
-DROP TABLE IF EXISTS REG_RESOURCE_PROPERTY;
-CREATE TABLE REG_RESOURCE_PROPERTY (
-            REG_PROPERTY_ID         INTEGER NOT NULL,
-            REG_VERSION             INTEGER,
-            REG_PATH_ID             INTEGER,
-            REG_RESOURCE_NAME       VARCHAR(256),
-            REG_TENANT_ID INTEGER DEFAULT 0
-);
-
-ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION  ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID);
-
-
-DROP TABLE IF EXISTS REG_ASSOCIATION;
-DROP SEQUENCE IF EXISTS REG_ASSOCIATION_PK_SEQ;
-CREATE SEQUENCE REG_ASSOCIATION_PK_SEQ;
-CREATE TABLE REG_ASSOCIATION (
-            REG_ASSOCIATION_ID INTEGER DEFAULT NEXTVAL('REG_ASSOCIATION_PK_SEQ'),
-            REG_SOURCEPATH VARCHAR (2000) NOT NULL,
-            REG_TARGETPATH VARCHAR (2000) NOT NULL,
-            REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID)
-);
-
-DROP TABLE IF EXISTS REG_SNAPSHOT;
-DROP SEQUENCE IF EXISTS REG_SNAPSHOT_PK_SEQ;
-CREATE SEQUENCE REG_SNAPSHOT_PK_SEQ;
-CREATE TABLE REG_SNAPSHOT (
-            REG_SNAPSHOT_ID     INTEGER DEFAULT NEXTVAL('REG_SNAPSHOT_PK_SEQ'),
-            REG_PATH_ID            INTEGER NOT NULL,
-            REG_RESOURCE_NAME      VARCHAR(255),
-            REG_RESOURCE_VIDS     BYTEA NOT NULL,
-            REG_TENANT_ID INTEGER DEFAULT 0,
-            CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID)
-);
-
-CREATE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME  ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
-
-ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
-
-
--- ################################
--- USER MANAGER TABLES
--- ################################
-
-DROP TABLE IF EXISTS UM_TENANT;
-DROP SEQUENCE IF EXISTS UM_TENANT_PK_SEQ;
-CREATE SEQUENCE UM_TENANT_PK_SEQ;
-CREATE TABLE UM_TENANT (
-			UM_ID INTEGER DEFAULT NEXTVAL('UM_TENANT_PK_SEQ'),
-			UM_DOMAIN_NAME VARCHAR(255) NOT NULL,
-            UM_EMAIL VARCHAR(255),
-            UM_ACTIVE BOOLEAN DEFAULT FALSE,
-			PRIMARY KEY (UM_ID),
-			UNIQUE(UM_DOMAIN_NAME));
-
-DROP TABLE IF EXISTS UM_USER CASCADE;			
-DROP SEQUENCE IF EXISTS UM_USER_PK_SEQ;
-CREATE SEQUENCE UM_USER_PK_SEQ;
-CREATE TABLE UM_USER ( 
-             UM_ID INTEGER DEFAULT NEXTVAL('UM_USER_PK_SEQ'), 
-             UM_USER_NAME VARCHAR(255) NOT NULL, 
-             UM_USER_PASSWORD VARCHAR(255) NOT NULL,
-             UM_SALT_VALUE VARCHAR(31),
-             UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE,
-             UM_CHANGED_TIME TIMESTAMP NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             PRIMARY KEY (UM_ID, UM_TENANT_ID), 
-             UNIQUE(UM_USER_NAME, UM_TENANT_ID)
-); 
-
-DROP TABLE IF EXISTS UM_ROLE CASCADE;
-DROP SEQUENCE IF EXISTS UM_ROLE_PK_SEQ;
-CREATE SEQUENCE UM_ROLE_PK_SEQ;
-CREATE TABLE UM_ROLE ( 
-             UM_ID INTEGER DEFAULT NEXTVAL('UM_ROLE_PK_SEQ'), 
-             UM_ROLE_NAME VARCHAR(255) NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,  
-             PRIMARY KEY (UM_ID, UM_TENANT_ID),
-             UNIQUE(UM_ROLE_NAME, UM_TENANT_ID) 
-);
-
-DROP TABLE IF EXISTS UM_PERMISSION CASCADE;
-DROP SEQUENCE IF EXISTS UM_PERMISSION_PK_SEQ;
-CREATE SEQUENCE UM_PERMISSION_PK_SEQ;
-CREATE TABLE UM_PERMISSION ( 
-             UM_ID INTEGER DEFAULT NEXTVAL('UM_PERMISSION_PK_SEQ'), 
-             UM_RESOURCE_ID VARCHAR(255) NOT NULL, 
-             UM_ACTION VARCHAR(255) NOT NULL, 
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-); 
-
-CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION 
-                    ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID); 
-
-					
-DROP TABLE IF EXISTS UM_ROLE_PERMISSION;
-DROP SEQUENCE IF EXISTS UM_ROLE_PERMISSION_PK_SEQ;
-CREATE SEQUENCE UM_ROLE_PERMISSION_PK_SEQ;
-CREATE TABLE UM_ROLE_PERMISSION ( 
-             UM_ID INTEGER DEFAULT NEXTVAL('UM_ROLE_PERMISSION_PK_SEQ'), 
-             UM_PERMISSION_ID INTEGER NOT NULL, 
-             UM_ROLE_NAME VARCHAR(255) NOT NULL,
-             UM_IS_ALLOWED SMALLINT NOT NULL, 
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID), 
-             PRIMARY KEY (UM_ID, UM_TENANT_ID) 
-); 
-
--- REMOVED UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID) 
-DROP TABLE IF EXISTS UM_USER_PERMISSION;
-DROP SEQUENCE IF EXISTS UM_USER_PERMISSION_PK_SEQ;
-CREATE SEQUENCE UM_USER_PERMISSION_PK_SEQ;
-CREATE TABLE UM_USER_PERMISSION ( 
-             UM_ID INTEGER DEFAULT NEXTVAL('UM_USER_PERMISSION_PK_SEQ'), 
-             UM_PERMISSION_ID INTEGER NOT NULL, 
-             UM_USER_NAME VARCHAR(255) NOT NULL,
-             UM_IS_ALLOWED SMALLINT NOT NULL,          
-             UM_TENANT_ID INTEGER DEFAULT 0, 
-             FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID), 
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
--- REMOVED UNIQUE (UM_PERMISSION_ID, UM_USER_ID) 
-DROP TABLE IF EXISTS UM_USER_ROLE;
-DROP SEQUENCE IF EXISTS UM_USER_ROLE_PK_SEQ;
-CREATE SEQUENCE UM_USER_ROLE_PK_SEQ;
-CREATE TABLE UM_USER_ROLE ( 
-             UM_ID INTEGER DEFAULT NEXTVAL('UM_USER_ROLE_PK_SEQ'), 
-             UM_ROLE_ID INTEGER NOT NULL, 
-             UM_USER_ID INTEGER NOT NULL,
-             UM_TENANT_ID INTEGER DEFAULT 0,  
-             UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID), 
-             FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID), 
-             FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), 
-             PRIMARY KEY (UM_ID, UM_TENANT_ID)
-); 
-
-DROP TABLE IF EXISTS UM_USER_ATTRIBUTE;
-DROP SEQUENCE IF EXISTS UM_USER_ATTRIBUTE_PK_SEQ;
-CREATE SEQUENCE UM_USER_ATTRIBUTE_PK_SEQ;
-CREATE TABLE UM_USER_ATTRIBUTE ( 
-            UM_ID INTEGER DEFAULT NEXTVAL('UM_USER_ATTRIBUTE_PK_SEQ'), 
-            UM_ATTR_NAME VARCHAR(255) NOT NULL, 
-            UM_ATTR_VALUE VARCHAR(1024), 
-            UM_PROFILE_ID VARCHAR(255), 
-            UM_USER_ID INTEGER, 
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-); 
-
-
-DROP TABLE IF EXISTS UM_DIALECT CASCADE;
-DROP SEQUENCE IF EXISTS UM_DIALECT_PK_SEQ;
-CREATE SEQUENCE UM_DIALECT_PK_SEQ;
-CREATE TABLE UM_DIALECT( 
-            UM_ID INTEGER DEFAULT NEXTVAL('UM_DIALECT_PK_SEQ'), 
-            UM_DIALECT_URI VARCHAR(255) NOT NULL, 
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            UNIQUE(UM_DIALECT_URI, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-); 
-
-DROP TABLE IF EXISTS UM_CLAIM;
-DROP SEQUENCE IF EXISTS UM_CLAIM_PK_SEQ;
-CREATE SEQUENCE UM_CLAIM_PK_SEQ;
-CREATE TABLE UM_CLAIM( 
-            UM_ID INTEGER DEFAULT NEXTVAL('UM_CLAIM_PK_SEQ'), 
-            UM_DIALECT_ID INTEGER NOT NULL, 
-            UM_CLAIM_URI VARCHAR(255) NOT NULL, 
-            UM_DISPLAY_TAG VARCHAR(255), 
-            UM_DESCRIPTION VARCHAR(255), 
-            UM_MAPPED_ATTRIBUTE VARCHAR(255), 
-            UM_REG_EX VARCHAR(255), 
-            UM_SUPPORTED SMALLINT, 
-            UM_REQUIRED SMALLINT, 
-            UM_DISPLAY_ORDER INTEGER,
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID), 
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-); 
-
-DROP TABLE IF EXISTS UM_PROFILE_CONFIG;
-DROP SEQUENCE IF EXISTS UM_PROFILE_CONFIG_PK_SEQ;
-CREATE SEQUENCE UM_PROFILE_CONFIG_PK_SEQ;
-CREATE TABLE UM_PROFILE_CONFIG( 
-            UM_ID INTEGER DEFAULT NEXTVAL('UM_PROFILE_CONFIG_PK_SEQ'), 
-            UM_DIALECT_ID INTEGER NOT NULL, 
-            UM_PROFILE_NAME VARCHAR(255), 
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-); 
-
-DROP TABLE IF EXISTS UM_CLAIM_BEHAVIOR;    
-DROP SEQUENCE IF EXISTS UM_CLAIM_BEHAVIOR_PK_SEQ;
-CREATE SEQUENCE UM_CLAIM_BEHAVIOR_PK_SEQ;
-CREATE TABLE UM_CLAIM_BEHAVIOR( 
-            UM_ID INTEGER DEFAULT NEXTVAL('UM_CLAIM_BEHAVIOR_PK_SEQ'), 
-            UM_PROFILE_ID INTEGER, 
-            UM_CLAIM_ID INTEGER, 
-            UM_BEHAVIOUR SMALLINT, 
-            UM_TENANT_ID INTEGER DEFAULT 0, 
-            FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID, UM_TENANT_ID), 
-            FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID, UM_TENANT_ID), 
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-); 
-
-DROP TABLE IF EXISTS UM_HYBRID_ROLE;
-DROP SEQUENCE IF EXISTS UM_HYBRID_ROLE_PK_SEQ;
-CREATE SEQUENCE UM_HYBRID_ROLE_PK_SEQ;
-CREATE TABLE UM_HYBRID_ROLE(
-            UM_ID INTEGER DEFAULT NEXTVAL('UM_HYBRID_ROLE_PK_SEQ'),
-            UM_ROLE_NAME VARCHAR(255),
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-
-DROP TABLE IF EXISTS UM_HYBRID_USER_ROLE;
-DROP SEQUENCE IF EXISTS UM_HYBRID_USER_ROLE_PK_SEQ;
-CREATE SEQUENCE UM_HYBRID_USER_ROLE_PK_SEQ;
-CREATE TABLE UM_HYBRID_USER_ROLE(
-            UM_ID INTEGER DEFAULT NEXTVAL('UM_HYBRID_USER_ROLE_PK_SEQ'),
-            UM_USER_NAME VARCHAR(255),
-            UM_ROLE_ID INTEGER NOT NULL,
-            UM_TENANT_ID INTEGER DEFAULT 0,
-            UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID),
-            FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
-            PRIMARY KEY (UM_ID, UM_TENANT_ID)
-);
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/README
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/README b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/README
deleted file mode 100644
index bdd5963..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/README
+++ /dev/null
@@ -1,22 +0,0 @@
-CARBON_HOME/repository is the main repository for all kind of deployments and
-configurations in Carbon. This includes all Axis2 artifacts, Synapse artifacts etc. In
-addition to that, Axis2 configurations, Carbon configurations etc are also hosted
-under this folder.
-
-1. lib
-   Directory contains all the client side Axis2 libraries. These libraries will be copied here after
-   starting the server once or by running 'ant' from CARBON_HOME/bin.
-
-2. deployment
-   Directory can be used to deploy Axis2 (can have Synapse, BPel stuff as well) artifacts for both
-   server side and client side. See deployment/README for more details.
-
-3. conf
-   Directory contains all the configuration files. axis2.xml, carbon.xml etc.
-
-4. components
-   Directory contains all OSGi related stuff. Carbon bundles, OSGi configuration
-   files and p2 stuff. See components/README for more details.
-
-5. logs
-   Directory contains all Carbon logs.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/README
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/README b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/README
deleted file mode 100644
index 3faeb49..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/README
+++ /dev/null
@@ -1,39 +0,0 @@
-CARBON_HOME/repository/conf directory contains all the Carbon configuration files
-
-1. axis2.xml
-   The Apache Axis2 configuration file. Apache Axis2 is used at the core
-   of WSO2 Carbon.
-
-2. carbon.xml
-   The Carbon server configuration file
-
-3. mime.types
-   Defines MIME types to file extension mappings.
-
-4. README
-   This file
-
-5. registry.xml
-   The Carbon registry configuration file. This will be used when the WSO2
-   Embedded Registry is used.
-
-6. synapse.xml
-   The Apache Synapse configuration file. This will be used if Apache Synapse
-   or WSO2 ESB related Carbon components are deployed.
-
-7. mgt-transports.xml
-   Used in standalone mode to configure HTTP/S transports for the Carbon management console
-
-8. user-mgt.xml
-   The User Manager configuration file used for configuring user management
-   details.
-
-9. wrapper.conf
-   The Java Service Wrapper (JSW) configuration file. JSW is used for running
-   Carbon as a Unix daemon or Windows NT service.
-
-10. secret-conf.properties
-   The Secret Manager Configuration that is used by secret vault component
-
-11  cipher-text.properties
-   File based secret repository 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/axis2.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/axis2.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/axis2.xml
deleted file mode 100644
index aa5c426..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/axis2.xml
+++ /dev/null
@@ -1,630 +0,0 @@
-<!--
-  ~ Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<axisconfig name="AxisJava2.0">
-
-    <!-- ================================================= -->
-    <!-- Globally engaged modules -->
-    <!-- ================================================= -->
-    <module ref="addressing"/>
-
-    <!-- ================================================= -->
-    <!-- Parameters -->
-    <!-- ================================================= -->
-    <parameter name="hotdeployment">${hotdeployment}</parameter>
-    <parameter name="hotupdate">${hotupdate}</parameter>
-    <parameter name="enableMTOM" locked="false">optional</parameter>
-    <parameter name="cacheAttachments">true</parameter>
-    <parameter name="attachmentDIR">work/mtom</parameter>
-    <parameter name="sizeThreshold">4000</parameter>
-
-    <!--
-    Defines how the persistence of WS-ReliableMessaging is handled
-
-    Possible value are: inmemory & persistent
-    -->
-    <!-- Following parameter will completely disable REST handling in both the servlets-->
-    <parameter name="disableREST" locked="false">false</parameter>
-
-    <parameter name="Sandesha2StorageManager">inmemory</parameter>
-
-    <!-- This deployment interceptor will be called whenever before a module is initialized or
-     service is deployed -->
-    <listener class="org.wso2.carbon.core.deployment.DeploymentInterceptor"/>
-
-    <!-- setting servicePath. contextRoot is defined in the carbon.xml file -->
-    <parameter name="servicePath">services</parameter>
-
-    <!--the directory in which .aar services are deployed inside axis2 repository-->
-    <parameter name="ServicesDirectory">axis2services</parameter>
-
-    <!--the directory in which modules are deployed inside axis2 repository-->
-    <parameter name="ModulesDirectory">axis2modules</parameter>
-
-    <parameter name="userAgent" locked="true">
-        @product.name@-@product.version@
-    </parameter>
-    <parameter name="server" locked="true">
-        @product.name@-@product.version@
-    </parameter>
-
-    <!-- ========================================================================-->
-
-    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
-    <!--that behaviour.-->
-    <parameter name="sendStacktraceDetailsWithFaults">false</parameter>
-
-    <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
-    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
-    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
-    <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
-    <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
-
-    <!--Set the flag to true if you want to enable transport level session mangment-->
-    <parameter name="manageTransportSession">true</parameter>
-
-    <!-- Synapse Configuration file -->
-    <parameter name="SynapseConfig.ConfigurationFile" locked="false">./repository/conf/synapse.xml</parameter>
-
-    <!-- Synapse Home parameter -->
-    <parameter name="SynapseConfig.HomeDirectory" locked="false">.</parameter>
-
-    <!-- Resolve root used to resolve synapse references like schemas inside a WSDL -->
-    <parameter name="SynapseConfig.ResolveRoot" locked="false">.</parameter>
-
-    <!-- Synapse Server name parameter -->
-    <parameter name="SynapseConfig.ServerName" locked="false">WSO2 Carbon Server</parameter>
-
-    <!--By default, JAXWS services are created by reading annotations. WSDL and schema are generated-->
-    <!--using a separate WSDL generator only when ?wsdl is called. Therefore, even if you engage-->
-    <!--policies etc.. to AxisService, it doesn't appear in the WSDL. By setting the following property-->
-    <!--to true, you can create the AxisService using the generated WSDL and remove the need for a-->
-    <!--WSDL generator. When ?wsdl is called, WSDL is generated in the normal way.-->
-    <parameter name="useGeneratedWSDLinJAXWS">true</parameter>
-
-    <!-- Deployer for the dataservice. -->
-    <!--<deployer extension="dbs" directory="dataservices" class="org.wso2.dataservices.DBDeployer"/>-->
-
-    <!-- Axis1 deployer for Axis2-->
-    <!--<deployer extension="wsdd" class="org.wso2.carbon.axis1services.Axis1Deployer" directory="axis1services"/>-->
-
-    <!-- POJO service deployer for Jar -->
-    <!--<deployer extension="jar" class="org.apache.axis2.deployment.POJODeployer" directory="pojoservices"/>-->
-
-    <!-- POJO service deployer for Class  -->
-    <!--<deployer extension="class" class="org.apache.axis2.deployment.POJODeployer" directory="pojoservices"/>-->
-
-    <!-- JAXWS service deployer  -->
-    <!--<deployer extension=".jar" class="org.apache.axis2.jaxws.framework.JAXWSDeployer" directory="servicejars"/>-->
-    <!-- ================================================= -->
-    <!-- Message Receivers -->
-    <!-- ================================================= -->
-    <!--This is the Default Message Receiver for the system , if you want to have MessageReceivers for -->
-    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
-    <!--any operation -->
-    <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
-
-    <messageReceivers>
-        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only"
-                         class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
-        <messageReceiver mep="http://www.w3.org/ns/wsdl/robust-in-only"
-                         class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
-        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
-                         class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
-    </messageReceivers>
-
-    <messageFormatters>
-        <messageFormatter contentType="application/x-www-form-urlencoded"
-                         class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
-        <messageFormatter contentType="multipart/form-data"
-                         class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
-        <messageFormatter contentType="application/xml"
-                         class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
-        <messageFormatter contentType="text/xml"
-                         class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
-        <messageFormatter contentType="application/soap+xml"
-                         class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
-	<!--messageFormatter contentType="application/x-www-form-urlencoded"
-                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
-        <!--messageFormatter contentType="multipart/form-data"
-                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
-	<!--messageFormatter contentType="application/xml"
-                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
-	<!--messageFormatter contentType="text/html"
-                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
-	<!--messageFormatter contentType="application/soap+xml"
-                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
-	 <!--messageFormatter contentType="x-application/hessian"
-			class="org.apache.synapse.format.hessian.HessianMessageFormatter"/-->
-        <!--<messageFormatter contentType="">
-			class="org.apache.synapse.format.hessian.HessianMessageFormatter"/-->
-   </messageFormatters>
-
-    <messageBuilders>
-        <messageBuilder contentType="application/xml"
-                        class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
-        <messageBuilder contentType="application/x-www-form-urlencoded"
-                        class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
-        <messageBuilder contentType="multipart/form-data"
-                        class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
-        <!--messageBuilder contentType="application/xml"
-     		        class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
-	<!--messageBuilder contentType="application/x-www-form-urlencoded"
-                        class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
-	<!--messageBuilder contentType="multipart/form-data"
-                        class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
-	<!--messageBuilder contentType="multipart/related"
-                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
-	<!--messageBuilder contentType="application/soap+xml"
-                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
-	<!--messageBuilder contentType="text/plain"
-                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
-	<!--messageBuilder contentType="text/xml"
-                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
-	<!--messageFormatter contentType="text/plain"
-                        class="org.apache.axis2.format.PlainTextBuilder"/-->
-	<!--messageBuilder contentType="x-application/hessian"
-		       class="org.apache.synapse.format.hessian.HessianMessageBuilder"/-->
-    </messageBuilders>
-
-
-    <!-- ================================================= -->
-    <!-- In Transports -->
-    <!-- ================================================= -->
-    <transportReceiver name="http"
-                       class="org.wso2.carbon.core.transports.http.HttpTransportListener">
-        <!--
-           Uncomment the following if you are deploying this within an application server. You
-           need to specify the HTTP port of the application server
-        -->
-        <parameter name="port">9763</parameter>
-
-        <!--
-       Uncomment the following to enable Apache2 mod_proxy. The port on the Apache server is 80
-       in this case.
-        -->
-        <!--<parameter name="proxyPort">80</parameter>-->
-    </transportReceiver>
-
-    <!--Please uncomment this in Multiple Instance Scenario if you want to use NIO Transport Recievers and 
- 	Remove the current transport REceivers in axis2.xml -->    
-    <!--transportReceiver name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOListener">
-        <parameter name="port" locked="false">8280</parameter>
-        <parameter name="non-blocking" locked="false">true</parameter>
-    </transportReceiver>
-    
-    <transportReceiver name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLListener">
-        <parameter name="port" locked="false">8243</parameter>
-        <parameter name="non-blocking" locked="false">true</parameter>
-        <parameter name="keystore" locked="false">
-            <KeyStore>
-                <Location>resources/security/wso2carbon.jks</Location>
-                <Type>JKS</Type>
-                <Password>wso2carbon</Password>
-                <KeyPassword>wso2carbon</KeyPassword>
-            </KeyStore>
-        </parameter>
-        <parameter name="truststore" locked="false">
-            <TrustStore>
-                <Location>resources/security/client-truststore.jks</Location>
-                <Type>JKS</Type>
-                <Password>wso2carbon</Password>
-            </TrustStore>
-        </parameter>
-    </transportReceiver-->
-    
-
-
-    <transportReceiver name="https"
-                       class="org.wso2.carbon.core.transports.http.HttpsTransportListener">
-        <!--
-           Uncomment the following if you are deploying this within an application server. You
-           need to specify the HTTPS port of the application server
-        -->
-        <parameter name="port">9443</parameter>
-
-        <!--
-       Uncomment the following to enable Apache2 mod_proxy. The port on the Apache server is 443
-       in this case.
-        -->
-        <!--<parameter name="proxyPort">443</parameter>-->
-    </transportReceiver>
-
-    <!--
-       Uncomment the following segment to enable TCP transport.
-       Note : Addressing module should be engaged for TCP transport to work
-    -->
-    <!--<transportReceiver name="tcp"
-                       class="org.apache.axis2.transport.tcp.TCPServer">
-        <parameter name="port">6667</parameter>
-    </transportReceiver>-->
-
-    <!--
-     To Enable SimpleMailListener, please change the configuration
-     parameters and uncomment the following
-    -->
-    <!--<transportReceiver name="mailto" class="org.apache.axis2.transport.mail.SimpleMailListener">
-        <parameter name="mail.pop3.host">localhost</parameter>
-        <parameter name="mail.pop3.user">red</parameter>
-        <parameter name="mail.store.protocol">pop3</parameter>
-        <parameter name="transport.mail.pop3.password">red</parameter>
-        <parameter name="transport.mail.replyToAddress">red@localhost</parameter>
-        <parameter name="transport.listener.interval">3000</parameter>
-    </transportReceiver>-->
-
-    <!--
-      Uncomment this and configure as appropriate for JMS transport support,
-      after setting up your JMS environment (e.g. ActiveMQ)
-    -->
-    <!--<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
-        <parameter name="myTopicConnectionFactory">
-        	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
-        	<parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
-        </parameter>
-
-        <parameter name="myQueueConnectionFactory">
-        	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
-        	<parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
-        </parameter>
-
-        <parameter name="default">
-        	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
-        	<parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
-        </parameter>
-    </transportReceiver>-->
-
-    <!-- ================================================= -->
-    <!-- Out Transports -->
-    <!-- ================================================= -->
-
-    <transportSender name="tcp"
-                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
-    <transportSender name="local"
-                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
-    <!--<transportSender name="jms"
-                     class="org.apache.axis2.transport.jms.JMSSender"/>-->
-    <transportSender name="http"
-                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
-        <parameter name="PROTOCOL">HTTP/1.1</parameter>
-        <parameter name="Transfer-Encoding">chunked</parameter>
-        <!-- This parameter has been added to overcome problems encounted in SOAP action parameter -->
-        <parameter name="OmitSOAP12Action">true</parameter>
-    </transportSender>
-    <transportSender name="https"
-                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
-        <parameter name="PROTOCOL">HTTP/1.1</parameter>
-        <parameter name="Transfer-Encoding">chunked</parameter>
-        <!-- This parameter has been added to overcome problems encounted in SOAP action parameter -->
-        <parameter name="OmitSOAP12Action">true</parameter>
-    </transportSender>
-
-    <!--<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
-        <parameter name="mail.smtp.host">localhost</parameter>
-    </transportSender>-->
-
-
-    <!--Please uncomment this in Multiple Instance Scenario if you want to use NIO sender -->
-    <!--  
-    <transportSender name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
-        <parameter name="non-blocking" locked="false">true</parameter>
-    </transportSender>
-    <transportSender name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLSender">
-        <parameter name="non-blocking" locked="false">true</parameter>
-        <parameter name="keystore" locked="false">
-            <KeyStore>
-                <Location>resources/security/wso2carbon.jks</Location>
-                <Type>JKS</Type>
-                <Password>wso2carbon</Password>
-                <KeyPassword>wso2carbon</KeyPassword>
-            </KeyStore>
-        </parameter>
-        <parameter name="truststore" locked="false">
-            <TrustStore>
-                <Location>resources/security/client-truststore.jks</Location>
-                <Type>JKS</Type>
-                <Password>wso2carbon</Password>
-            </TrustStore>
-        </parameter>
-    </transportSender>
-	-->
-
-
-
-    <!-- ================================================= -->
-    <!-- Phases  -->
-    <!-- ================================================= -->
-    <phaseOrder type="InFlow">
-        <!--  System pre defined phases       -->
-        <phase name="Transport">
-            <handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
-                <order phase="Transport"/>
-            </handler>
-            <handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
-                <order phase="Transport"/>
-            </handler>
-        </phase>
-        <phase name="Addressing">
-             <handler name="AddressingBasedDispatcher"
-                     class="org.wso2.carbon.core.multitenancy.MultitenantAddressingBasedDispatcher">
-                 <order phase="Addressing"/>
-            </handler>
-        </phase>
-        <phase name="Security"/>
-        <phase name="PreDispatch"/>
-        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
-            <handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
-            <handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
-            <handler name="RequestURIOperationDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
-            <handler name="SOAPMessageBodyBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
-
-            <handler name="HTTPLocationBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
-
-            <handler name="MultitenantDispatcher"
-                     class="org.wso2.carbon.core.multitenancy.MultitenantDispatcher"/>
-        </phase>
-        <!--  System pre defined phases       -->
-        <phase name="RMPhase"/>
-        <phase name="OpPhase"/>
-        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
-        <phase name="OperationInPhase"/>
-    </phaseOrder>
-    <phaseOrder type="OutFlow">
-        <phase name="RMPhase"/>
-        <phase name="OpPhase"/>
-        <!--      user can add his own phases to this area  -->
-        <phase name="OperationOutPhase"/>
-        <!--system predefined phase-->
-        <!--these phase will run irrespective of the service-->
-        <phase name="PolicyDetermination"/>
-        <phase name="MessageOut"/>
-	    <phase name="Security">
-            <!--<handler name="test"
-                     class="org.wso2.carbon.core.multitenancy.MultitenantMeteringHandler">
-                <order phase="Security"/>
-            </handler>-->
-        </phase>
-    </phaseOrder>
-    <phaseOrder type="InFaultFlow">
-        <!--  System pre defined phases       -->
-        <phase name="Transport">
-            <handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
-                <order phase="Transport"/>
-            </handler>
-            <handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
-                <order phase="Transport"/>
-            </handler>
-            <!--<handler name="POXSecHandler"
-                     class="org.wso2.carbon.core.security.pox.POXSecurityHandler">
-                <order phase="Transport"/>
-            </handler>-->
-        </phase>
-
-        <phase name="Addressing">
-             <handler name="AddressingBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
-                 <order phase="Addressing"/>
-            </handler>
-        </phase>
-        <phase name="Security"/>
-        <phase name="PreDispatch"/>
-        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
-            <handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
-            <handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
-            <handler name="RequestURIOperationDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
-            <handler name="SOAPMessageBodyBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
-
-            <handler name="HTTPLocationBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
-            <!--handler name="AdminServiceAuthenticationHandler"
-                     class="org.wso2.carbon.core.auth.AuthenticationHandler"/-->
-        </phase>
-        <phase name="RMPhase"/>
-        <phase name="OpPhase"/>
-        <!--      user can add his own phases to this area  -->
-        <phase name="OperationInFaultPhase"/>
-    </phaseOrder>
-    <phaseOrder type="OutFaultFlow">
-        <phase name="RMPhase"/>
-        <!--      user can add his own phases to this area  -->
-        <phase name="OperationOutFaultPhase"/>
-        <phase name="PolicyDetermination"/>
-        <phase name="MessageOut"/>
-        <phase name="Security"/>
-    </phaseOrder>
-
-    <!-- ================================================= -->
-    <!-- Clustering  -->
-    <!-- ================================================= -->
-    <!--
-     To enable clustering for this node, set the value of "enable" attribute of the "clustering"
-     element to "true". The initialization of a node in the cluster is handled by the class
-     corresponding to the "class" attribute of the "clustering" element. It is also responsible for
-     getting this node to join the cluster.
-     -->
-    <clustering class="org.apache.axis2.clustering.tribes.TribesClusteringAgent" enable="false">
-
-        <!--
-           This parameter indicates whether the cluster has to be automatically initalized
-           when the AxisConfiguration is built. If set to "true" the initialization will not be
-           done at that stage, and some other party will have to explictly initialize the cluster.
-        -->
-        <parameter name="AvoidInitiation">true</parameter>
-
-        <!--
-           The membership scheme used in this setup. The only values supported at the moment are
-           "multicast" and "wka"
-
-           1. multicast - membership is automatically discovered using multicasting
-           2. wka - Well-Known Address based multicasting. Membership is discovered with the help
-                    of one or more nodes running at a Well-Known Address. New members joining a
-                    cluster will first connect to a well-known node, register with the well-known node
-                    and get the membership list from it. When new members join, one of the well-known
-                    nodes will notify the others in the group. When a member leaves the cluster or
-                    is deemed to have left the cluster, it will be detected by the Group Membership
-                    Service (GMS) using a TCP ping mechanism.
-        -->
-        <parameter name="membershipScheme">multicast</parameter>
-
-        <!--
-         The clustering domain/group. Nodes in the same group will belong to the same multicast
-         domain. There will not be interference between nodes in different groups.
-        -->
-        <parameter name="domain">wso2.carbon.domain</parameter>
-
-        <!--
-           When a Web service request is received, and processed, before the response is sent to the
-           client, should we update the states of all members in the cluster? If the value of
-           this parameter is set to "true", the response to the client will be sent only after
-           all the members have been updated. Obviously, this can be time consuming. In some cases,
-           such this overhead may not be acceptable, in which case the value of this parameter
-           should be set to "false"
-        -->
-        <parameter name="synchronizeAll">true</parameter>
-
-        <!--
-          The maximum number of times we need to retry to send a message to a particular node
-          before giving up and considering that node to be faulty
-        -->
-        <parameter name="maxRetries">10</parameter>
-
-        <!-- The multicast address to be used -->
-        <parameter name="mcastAddress">228.0.0.4</parameter>
-
-        <!-- The multicast port to be used -->
-        <parameter name="mcastPort">45564</parameter>
-
-        <!-- The frequency of sending membership multicast messages (in ms) -->
-        <parameter name="mcastFrequency">500</parameter>
-
-        <!-- The time interval within which if a member does not respond, the member will be
-         deemed to have left the group (in ms)
-         -->
-        <parameter name="memberDropTime">3000</parameter>
-
-        <!--
-           The IP address of the network interface to which the multicasting has to be bound to.
-           Multicasting would be done using this interface.
-        -->
-	<!--
-        <parameter name="mcastBindAddress">127.0.0.1</parameter>
-	-->
-        <!-- The host name or IP address of this member -->
-        <!--
-	<parameter name="localMemberHost">127.0.0.1</parameter>
-	-->
-        <!--
-        The TCP port used by this member. This is the port through which other nodes will
-        contact this member
-         -->
-        <parameter name="localMemberPort">4000</parameter>
-
-        <!--
-        Preserve message ordering. This will be done according to sender order.
-        -->
-        <parameter name="preserveMessageOrder">true</parameter>
-
-        <!--
-        Maintain atmost-once message processing semantics
-        -->
-        <parameter name="atmostOnceMessageSemantics">true</parameter>
-
-        <!--
-        Properties specific to this member
-        -->
-        <parameter name="properties">
-            <property name="backendServerURL" value="https://${hostName}:${httpsPort}/services/"/>
-            <property name="mgtConsoleURL" value="https://${hostName}:${httpsPort}/"/>
-        </parameter>
-
-        <!--
-           The list of static or well-known members. These entries will only be valid if the
-           "membershipScheme" above is set to "wka"
-        -->
-        <members>
-            <member>
-                <hostName>127.0.0.1</hostName>
-                <port>4000</port>
-            </member>
-            <member>
-                <hostName>127.0.0.1</hostName>
-                <port>4001</port>
-            </member>
-        </members>
-
-        <!--
-        Enable the groupManagement entry if you need to run this node as a cluster manager.
-        Multiple application domains with different GroupManagementAgent implementations
-        can be defined in this section.
-        -->
-        <groupManagement enable="false">
-            <applicationDomain name="apache.axis2.application.domain"
-                               description="Axis2 group"
-                               agent="org.apache.axis2.clustering.management.DefaultGroupManagementAgent"/>
-        </groupManagement>
-
-        <!--
-           This interface is responsible for handling management of a specific node in the cluster
-           The "enable" attribute indicates whether Node management has been enabled
-        -->
-        <nodeManager class="org.apache.axis2.clustering.management.DefaultNodeManager"
-                     enable="true"/>
-
-        <!--
-           This interface is responsible for handling state replication. The property changes in
-           the Axis2 context hierarchy in this node, are propagated to all other nodes in the cluster.
-
-           The "excludes" patterns can be used to specify the prefixes (e.g. local_*) or
-           suffixes (e.g. *_local) of the properties to be excluded from replication. The pattern
-           "*" indicates that all properties in a particular context should not be replicated.
-
-            The "enable" attribute indicates whether context replication has been enabled
-        -->
-        <stateManager class="org.apache.axis2.clustering.state.DefaultStateManager"
-                      enable="true">
-            <replication>
-                <defaults>
-                    <exclude name="local_*"/>
-                    <exclude name="LOCAL_*"/>
-                </defaults>
-                <context class="org.apache.axis2.context.ConfigurationContext">
-                    <exclude name="local_*"/>
-                </context>
-                <context class="org.apache.axis2.context.ServiceGroupContext">
-                    <exclude name="local_*"/>
-                </context>
-                <context class="org.apache.axis2.context.ServiceContext">
-                    <exclude name="local_*"/>
-                </context>
-            </replication>
-        </stateManager>
-    </clustering>
-</axisconfig>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/axis2_client.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/axis2_client.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/axis2_client.xml
deleted file mode 100644
index f3eaaa5..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/axis2_client.xml
+++ /dev/null
@@ -1,280 +0,0 @@
-<!--
-  ~ Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<axisconfig name="AxisJava2.0">
-    <!-- ================================================= -->
-    <!-- Parameters -->
-    <!-- ================================================= -->
-    <parameter name="hotdeployment">true</parameter>
-    <parameter name="hotupdate">false</parameter>
-    <parameter name="enableMTOM">false</parameter>
-
-    <!--If turned on with use the Accept header of the request to determine the contentType of the
-    response-->
-    <parameter name="httpContentNegotiation">false</parameter>
-
-    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
-    <!--that behaviour.-->
-    <parameter name="sendStacktraceDetailsWithFaults">true</parameter>
-
-    <!--If there aren't any information available to find out the fault reason, we set the message of the exception-->
-    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
-    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
-    <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
-    <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
-
-    <!--This is the user name and password of admin console-->
-    <parameter name="userName">admin</parameter>
-    <parameter name="password">axis2</parameter>
-
-    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
-    <!--ServicesDirectory only works on the following cases-->
-    <!---File based configurator and in that case the value should be a file URL (http:// not allowed)-->
-    <!---When creating URL Based configurator with URL “file://”  -->
-    <!--- War based configurator with expanded case , -->
-
-    <!--All the other scenarios it will be ignored.-->
-    <!--<parameter name="ServicesDirectory">service</parameter>-->
-    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
-    <!--<parameter name="ModulesDirectory">modules</parameter>-->
-
-    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
-    <!--root which can configured using the following contextRoot parameter-->
-    <!--<parameter name="contextRoot">axis2</parameter>-->
-
-    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distinguish those endpoints-->
-    <!--<parameter name="servicePath">services</parameter>-->
-    <!--<parameter name="restPath">rest</parameter>-->
-
-    <!-- Following parameter will completely disable REST handling in Axis2-->
-    <parameter name="disableREST" locked="false">false</parameter>
-
-    <!--POJO deployer , this will alow users to drop .class file and make that into a service-->
-    <deployer extension=".class" directory="pojo" class="org.apache.axis2.deployment.POJODeployer"/>
-
-    <!-- Following parameter will set the host name for the epr-->
-    <!--<parameter name="hostname" locked="true">myhost.com</parameter>-->
-
-    <!-- ================================================= -->
-    <!-- Message Receivers -->
-    <!-- ================================================= -->
-    <!--This is the Default Message Receiver for the system , if you want to have MessageReceivers for -->
-    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
-    <!--any operation -->
-    <!--Note : You can override this for particular service by adding the same element with your requirement-->
-    <messageReceivers>
-        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
-                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
-        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
-                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
-        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
-                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
-        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
-                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
-    </messageReceivers>
-
-    <!-- ================================================= -->
-    <!-- Message Formatter -->
-    <!-- ================================================= -->
-    <!--Following content type to message formatter mapping can be used to implement support for different message -->
-    <!--format  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
-    <messageFormatters>
-        <messageFormatter contentType="application/x-www-form-urlencoded"
-                          class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
-        <messageFormatter contentType="multipart/form-data"
-                          class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
-        <messageFormatter contentType="application/xml"
-                          class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
-        <messageFormatter contentType="text/xml"
-                          class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
-        <messageFormatter contentType="application/soap+xml"
-                          class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
-    </messageFormatters>
-
-    <!-- ================================================= -->
-    <!-- Message Builders -->
-    <!-- ================================================= -->
-    <!--Following content type to builder mapping can be used to implement support for different message -->
-    <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
-    <messageBuilders>
-        <messageBuilder contentType="application/xml"
-                        class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
-        <messageBuilder contentType="application/x-www-form-urlencoded"
-                        class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
-        <!--Left commented because it adds the depandancy of servlet-api to other modules.
-        Please uncomment to Receive messages in multipart/form-data format-->
-        <!--<messageBuilder contentType="multipart/form-data"-->
-        <!--class="org.apache.axis2.builder.MultipartFormDataBuilder"/>-->
-    </messageBuilders>
-
-    <!-- ================================================= -->
-    <!-- Target Resolvers -->
-    <!-- ================================================= -->
-    <!-- Uncomment the following and specify the class name for your TargetResolver to add -->
-    <!-- a TargetResolver. TargetResolvers are used to process the To EPR for example to -->
-    <!-- choose a server in a cluster -->
-    <!--<targetResolvers>-->
-    <!--<targetResolver class="" />-->
-    <!--</targetResolvers>-->
-
-
-    <!-- ================================================= -->
-    <!-- Transport Ins -->
-    <!-- ================================================= -->
-    <transportReceiver name="http"
-                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
-        <parameter name="port">6071</parameter>
-        <!--If you want to give your own host address for EPR generation-->
-        <!--uncomment following parameter , and set as you required.-->
-        <!--<parameter name="hostname">http://myApp.com/ws</parameter>-->
-    </transportReceiver>
-
-    <!--Uncomment if you want to have TCP transport support-->
-    <!--<transportReceiver name="tcp"
-                       class="org.apache.axis2.transport.tcp.TCPServer">
-        <parameter name="port">6061</parameter>-->
-    <!--If you want to give your own host address for EPR generation-->
-    <!--uncomment following parameter , and set as you required.-->
-    <!--<parameter name="hostname">tcp://myApp.com/ws</parameter>-->
-    <!--</transportReceiver>-->
-
-    <!-- ================================================= -->
-    <!-- Transport Outs -->
-    <!-- ================================================= -->
-
-    <!--<transportSender name="jms"-->
-    <!--class="org.apache.axis2.transport.jms.JMSSender"/>-->
-    <transportSender name="tcp"
-                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
-    <transportSender name="local"
-                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
-    <transportSender name="http"
-                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
-        <parameter name="PROTOCOL">HTTP/1.1</parameter>
-        <parameter name="Transfer-Encoding">chunked</parameter>
-        <parameter name="SO_TIMEOUT">60000</parameter>
-        <parameter name="CONNECTION_TIMEOUT">60000</parameter>
-    </transportSender>
-    <transportSender name="https"
-                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
-        <parameter name="PROTOCOL">HTTP/1.1</parameter>
-        <parameter name="Transfer-Encoding">chunked</parameter>
-        <parameter name="SO_TIMEOUT">60000</parameter>
-        <parameter name="CONNECTION_TIMEOUT">60000</parameter>
-    </transportSender>
-    <!--<transportSender name="java"-->
-    <!--class="org.apache.axis2.transport.java.JavaTransportSender"/>-->
-
-
-    <!-- ================================================= -->
-    <!--  SOAP Role Configuration                          -->
-    <!-- ================================================= -->
-    <!-- Use the following pattern to configure this axis2
-         instance to act in particular roles. Note that in
-         the absence of any configuration, Axis2 will act 
-         only in the ultimate receiver role -->
-    <!--
-    <SOAPRoleConfiguration isUltimateReceiver="true">
-    	<role>http://my/custom/role</role>
-    </SOAPRoleConfiguration>
-	-->
-
-    <!-- ================================================= -->
-    <!-- Phases  -->
-    <!-- ================================================= -->
-    <phaseOrder type="InFlow">
-        <!--  System pre-defined phases       -->
-        <phase name="Transport">
-            <handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
-                <order phase="Transport"/>
-            </handler>
-            <handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
-                <order phase="Transport"/>
-            </handler>
-        </phase>
-        <phase name="Addressing">
-            <handler name="AddressingBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
-                <order phase="Addressing"/>
-            </handler>
-        </phase>
-        <phase name="Security"/>
-        <phase name="PreDispatch"/>
-        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
-            <handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
-            <handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
-            <handler name="RequestURIOperationDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
-            <handler name="SOAPMessageBodyBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
-
-            <handler name="HTTPLocationBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
-        </phase>
-        <phase name="RMPhase"/>
-        <!--  System pre defined phases       -->
-        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
-        <phase name="OperationInPhase"/>
-    </phaseOrder>
-    <phaseOrder type="OutFlow">
-        <!--      user can add his own phases to this area  -->
-        <phase name="OperationOutPhase"/>
-        <!--system predefined phase-->
-        <!--these phase will run irrespective of the service-->
-        <phase name="RMPhase"/>
-        <phase name="PolicyDetermination"/>
-        <phase name="MessageOut"/>
-        <phase name="Security"/>
-    </phaseOrder>
-    <phaseOrder type="InFaultFlow">
-        <phase name="Addressing">
-            <handler name="AddressingBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
-                <order phase="Addressing"/>
-            </handler>
-        </phase>
-        <phase name="Security"/>
-        <phase name="PreDispatch"/>
-        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
-            <handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
-            <handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
-            <handler name="RequestURIOperationDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
-            <handler name="SOAPMessageBodyBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
-
-            <handler name="HTTPLocationBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
-        </phase>
-        <phase name="RMPhase"/>
-        <!--      user can add his own phases to this area  -->
-        <phase name="OperationInFaultPhase"/>
-    </phaseOrder>
-    <phaseOrder type="OutFaultFlow">
-        <!--      user can add his own phases to this area  -->
-        <phase name="OperationOutFaultPhase"/>
-        <phase name="RMPhase"/>
-        <phase name="PolicyDetermination"/>
-        <phase name="MessageOut"/>
-        <phase name="Security"/>
-    </phaseOrder>
-</axisconfig>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/broker-config.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/broker-config.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/broker-config.xml
deleted file mode 100644
index 2656b0e..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/broker-config.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<!--
-  ~ Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<eventBroker xmlns="http://wso2.org/ns/2009/09/eventing">
-    <eventStream name="RegistryEventBroker">
-        <subscriptionManager class="org.wso2.carbon.event.broker.subscriptions.EmbeddedRegistryBasedSubscriptionManager">
-            <parameter name="topicHeaderName">topic</parameter>
-            <parameter name="topicHeaderNS">http://wso2.org/ns/2009/09/eventing/notify</parameter>
-            <parameter name="subscriptionStoragePath">/repository/components/org.wso2.carbon.event</parameter>
-        </subscriptionManager>
-        <!-- Uncomment to to RemoteRegistryBasedSubscriptionManager -->
-        <!--subscriptionManager class="org.wso2.carbon.event.broker.subscriptions.RemoteRegistryBasedSubscriptionManager">
-            <parameter name="topicHeaderName">topic</parameter>
-            <parameter name="topicHeaderNS">http://wso2.org/ns/2009/09/eventing/notify</parameter>
-            <parameter name="subscriptionStoragePath">/repository/components/org.wso2.carbon.event</parameter>
-            <parameter name="registryURL">http://remote-ip:port/registry/</parameter>
-            <parameter name="username">username</parameter>
-            <parameter name="password">password</parameter>
-        </subscriptionManager-->
-        <eventDispatcher>org.wso2.carbon.registry.eventing.RegistryEventDispatcher</eventDispatcher>
-        <notificationManager class="org.wso2.carbon.event.broker.CarbonNotificationManager">
-            <parameter name="minSpareThreads">25</parameter>
-            <parameter name="maxThreads">150</parameter>
-            <parameter name="maxQueuedRequests">100</parameter>
-            <!-- Keep Alive time in nano seconds -->
-            <parameter name="keepAliveTime">1000</parameter>
-            <!-- Specify path of security policy file to enable security. -->
-            <!--parameter name="securityPolicy">policypath</parameter-->
-
-            <!-- Parameters specific to the Registry Event Broker configuration -->
-            <!-- Set this as false to disable displaying of registry URL in notification e-mails -->
-            <parameter name="showRegistryURL" locked="true">true</parameter>
-            <!-- Set this to print the powered-by message in notification e-mails. -->
-            <parameter name="registryPoweredBy" locked="true">This message is automatically generated by the ${product.name}.</parameter>
-            <!-- Set this to customize the URL printed in notification e-mails. -->
-            <!--parameter name="registryURL" locked="true">https://localhost:9443/carbon/</parameter-->
-        </notificationManager>
-    </eventStream>
-</eventBroker>


[10/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/user-mgt.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/user-mgt.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/user-mgt.xml
new file mode 100644
index 0000000..d190d87
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/user-mgt.xml
@@ -0,0 +1,117 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+        
+<UserManager>
+    <Realm>
+        <Configuration>
+                <AdminRole>admin</AdminRole>
+                <AdminUser>
+                     <UserName>admin</UserName>
+                     <Password>admin</Password>
+                </AdminUser>
+            <EveryOneRoleName>everyone</EveryOneRoleName> <!-- By default users in thsi role sees the registry root -->
+            <ReadOnly>false</ReadOnly>
+            <MaxUserNameListLength>500</MaxUserNameListLength>
+            <Property name="url">jdbc:h2:repository/database/WSO2CARBON_DB</Property>
+            <Property name="userName">wso2carbon</Property>
+            <Property name="password">wso2carbon</Property>
+            <Property name="driverName">org.h2.Driver</Property>
+            <Property name="maxActive">50</Property>
+            <Property name="maxWait">60000</Property>
+            <Property name="minIdle">5</Property>
+        </Configuration>
+        <UserStoreManager
+            class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
+            <!-- Readonly Properties -->
+            <Property name="IsEmailUserName">false</Property>
+            <Property name="DomainCalculation">default</Property>
+            <Property name="SelectUserSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+	        <Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>
+            <Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>
+            <Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>
+            <Property name="GetUserProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+	        <Property name="GetUsersWithDefaultPasswordsSQL">SELECT UM_USER_NAME FROM UM_USER WHERE WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="UserNameUniqueAcrossTenantsSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
+            <Property name="GetUserIDFromUserNameSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetTenantIDFromUserNameSQL">SELECT UM_TENANT_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
+            <!-- writing sqls follow-->
+            <Property name="PasswordDigest">SHA-256</Property>
+            <Property name="StoreSaltedPassword">true</Property>
+            <Property name="UserNameUniqueAcrossTenants">false</Property>
+            <Property name="PasswordJavaRegEx">[\S]{5,30}$</Property>
+            <Property name="PasswordJavaScriptRegEx">[\\S]{5,30}</Property>
+            <Property name="AddUserSQL">INSERT INTO UM_USER (UM_USER_NAME, UM_USER_PASSWORD, UM_SALT_VALUE, UM_REQUIRE_CHANGE, UM_CHANGED_TIME, UM_TENANT_ID) VALUES (?, ?, ?, ?, ?, ?)</Property>
+	        <Property name="AddRoleSQL">INSERT INTO UM_ROLE (UM_ROLE_NAME, UM_TENANT_ID) VALUES (?, ?)</Property>
+            <Property name="AddUserToRoleSQL">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?), ?)</Property>
+            <Property name="AddUserToRoleSQL-mssql">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(?)</Property>
+            <Property name="RemoveUserFromRoleSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="AddRoleToUserSQL">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?)</Property>
+            <Property name="AddRoleToUserSQL-mssql">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?)</Property>
+            <Property name="RemoveRoleFromUserSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="DeleteRoleSQL">DELETE FROM UM_ROLE WHERE UM_ROLE_NAME = ? AND UM_TENANT_ID=?</Property>
+            <Property name="OnDeleteRoleRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="OnDeleteUserRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="OnDeleteUserRemoveUserAttributeSQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="DeleteUserSQL">DELETE FROM UM_USER WHERE UM_USER_NAME = ? AND UM_TENANT_ID=?</Property>
+            <Property name="UpdateUserPasswordSQL">UPDATE UM_USER SET UM_USER_PASSWORD= ?, UM_SALT_VALUE=?, UM_REQUIRE_CHANGE=?, UM_CHANGED_TIME=? WHERE UM_USER_NAME= ? AND UM_TENANT_ID=?</Property>
+	        <Property name="AddUserPropertySQL">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?, ?, ?, ?)</Property>
+            <Property name="AddUserPropertySQL-mssql">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?), (?), (?), (?)</Property>
+            <Property name="UpdateUserPropertySQL">UPDATE UM_USER_ATTRIBUTE SET UM_ATTR_VALUE=? WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
+            <Property name="DeleteUserPropertySQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
+        </UserStoreManager>
+        <!-- UserStoreManager
+            class="org.wso2.carbon.user.core.ldap.LDAPUserStoreManager">
+            <Property name="ConnectionURL">ldap://localhost:10389</Property>
+            <Property name="ConnectionName">uid=admin,ou=system</Property>
+            <Property name="ConnectionPassword">admin123</Property>
+            <Property name="UserSearchBase">ou=system</Property>
+            <Property name="UserNameListFilter">(objectClass=person)</Property>
+            <Property name="UserNameAttribute">uid</Property>
+            <Property name="ReadLDAPGroups">false</Property>
+            <Property name="GroupSearchBase">ou=system</Property>
+            <Property name="GroupSearchFilter">(objectClass=groupOfNames)</Property>
+            <Property name="GroupNameAttribute">cn</Property>
+            <Property name="MembershipAttribute">member</Property>
+        </UserStoreManager -->
+        <!-- Active directory configuration follows -->
+        <!-- UserStoreManager
+            class="org.wso2.carbon.user.core.ldap.LDAPUserStoreManager">
+            <Property name="ConnectionURL">ldap://10.100.1.211:389</Property>
+            <Property name="ConnectionName">cn=Administrator,cn=users,dc=wso2,dc=lk</Property>
+            <Property name="ConnectionPassword">admin123</Property>
+            <Property name="UserSearchBase">cn=users,dc=wso2,dc=lk</Property>
+            <Property name="UserNameListFilter">(objectClass=person)</Property>
+            <Property name="UserNameAttribute">sAMAccountName</Property>
+            <Property name="ReadLDAPGroups">true</Property>
+            <Property name="GroupSearchBase">cn=users,dc=wso2,dc=lk</Property>
+            <Property name="GroupSearchFilter">(objectcategory=group)</Property>
+            <Property name="GroupNameAttribute">cn</Property>
+            <Property name="MemberOfAttribute">memberOf</Property>
+        </UserStoreManager -->
+        <AuthorizationManager
+            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager">
+        </AuthorizationManager> 
+    </Realm>
+</UserManager>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/wrapper.conf
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/wrapper.conf b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/wrapper.conf
new file mode 100644
index 0000000..e2f4715
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/conf/wrapper.conf
@@ -0,0 +1,125 @@
+#********************************************************************
+# Wrapper Properties
+#********************************************************************
+# Java Application
+wrapper.java.command=%JAVA_HOME%/bin/java
+
+# set the working directory to the CARBON_HOME
+wrapper.working.dir=../..
+
+# Java Main class.  This class must implement the WrapperListener interface
+#  or guarantee that the WrapperManager class is initialized.  Helper
+#  classes are provided to do this for you.  See the Integration section
+#  of the documentation for details.
+wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
+
+# Java Classpath (include wrapper.jar)  Add class path elements as
+#  needed starting from 1
+wrapper.java.classpath.1=lib/wrapper-3.2.3.jar
+wrapper.java.classpath.2=lib
+wrapper.java.classpath.3=lib/*.jar
+wrapper.java.classpath.4=lib/patches
+wrapper.java.classpath.5=lib/patches/*.jar
+wrapper.java.classpath.8=repository/conf
+# Java Library Path (location of Wrapper.DLL or libwrapper.so)
+wrapper.java.library.path.1=bin/native
+
+# Java Additional Parameters
+wrapper.java.additional.1=-Xms256m
+wrapper.java.additional.2=-Xmx512m
+wrapper.java.additional.3=-XX:MaxPermSize=128m
+wrapper.java.additional.4=-Dcarbon.home=.
+wrapper.java.additional.5=-Djava.endorsed.dirs=lib/endorsed
+wrapper.java.additional.6=-Dcom.sun.management.jmxremote
+wrapper.java.additional.7=-Dwso2.server.standalone=true
+wrapper.java.additional.8=-Djava.io.tmpdir=tmp
+#wrapper.java.additional.9=-Dlog4j.configuration=repository/conf/log4j.properties
+wrapper.java.additional.9=-Dwso2.transports.xml=repository/conf/mgt-transports.xml
+wrapper.java.additional.10=-Dcarbon.registry.root=/
+
+# Initial Java Heap Size (in MB)
+wrapper.java.initmemory=256
+
+# Maximum Java Heap Size (in MB)
+wrapper.java.maxmemory=512
+
+# Application parameters.  Add parameters as needed starting from 1
+wrapper.app.parameter.1=org.wso2.carbon.server.Main
+wrapper.app.parameter.2=RUN
+
+#********************************************************************
+# Wrapper Logging Properties
+#********************************************************************
+# Format of output for the console.
+# (See http://wrapper.tanukisoftware.org/doc/english/prop-console-format.html for formats)
+wrapper.console.format=M
+
+# Log Level for console output.  (See docs for log levels)
+wrapper.console.loglevel=INFO
+
+# Log file to use for wrapper output logging.
+wrapper.logfile=./repository/logs/wrapper.log
+
+# Format of output for the log file.  (See docs for formats)
+wrapper.logfile.format=LPTM
+
+# Log Level for log file output.  (See docs for log levels)
+wrapper.logfile.loglevel=INFO
+
+# Maximum size that the log file will be allowed to grow to before
+#  the log is rolled. Size is specified in bytes.  The default value
+#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
+#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
+wrapper.logfile.maxsize=5m
+
+# Maximum number of rolled log files which will be allowed before old
+#  files are deleted.  The default value of 0 implies no limit.
+wrapper.logfile.maxfiles=0
+
+# Log Level for sys/event log output.  (See docs for log levels)
+wrapper.syslog.loglevel=NONE
+
+#********************************************************************
+# Wrapper Windows Properties
+#********************************************************************
+# Title to use when running as a console
+wrapper.console.title=WSO2 Carbon
+
+#********************************************************************
+# Wrapper Windows NT/2000/XP Service Properties
+#********************************************************************
+# WARNING - Do not modify any of these properties when an application
+#  using this configuration file has been installed as a service.
+#  Please uninstall the service before modifying this section.  The
+#  service can then be reinstalled.
+
+# Name of the service
+wrapper.ntservice.name=WSO2Carbon
+
+# Display name of the service
+wrapper.ntservice.displayname=WSO2 Carbon
+
+# Description of the service
+wrapper.ntservice.description=WSO2 Carbon
+
+
+# Service dependencies.  Add dependencies as needed starting from 1
+wrapper.ntservice.dependency.1=
+
+# Mode in which the service is installed.  AUTO_START or DEMAND_START
+wrapper.ntservice.starttype=AUTO_START
+
+# Allow the service to interact with the desktop.
+wrapper.ntservice.interactive=true
+
+#Setting this property will cause the Wrapper to allocate and display a console 
+# window when running as an NT service. The console will only be visible if 
+# the wrapper.ntservice.interactive  property is also set to true. Defaults to false.
+wrapper.ntservice.console=false
+
+# Specifies the priority at which the Wrapper and its JVM will be run at when 
+# run as an NT service or as a console application. Possible values are 
+# LOW, BELOW_NORMAL, NORMAL, ABOVE_NORMAL, HIGH, and REALTIME. 
+# Defaults to NORMAL. BELOW_NORMAL and ABOVE_NORMAL are not supported on Windows NT, 95 or 98.
+wrapper.ntservice.process_priority=HIGH
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/logs/README
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/logs/README b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/logs/README
new file mode 100644
index 0000000..8871a93
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/carbon-home/repository/logs/README
@@ -0,0 +1 @@
+CARBON_HOME/repository/logs contains all log files created during execution
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/registry.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/registry.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/registry.xml
new file mode 100644
index 0000000..f8a374c
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/registry.xml
@@ -0,0 +1,250 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<wso2registry>
+    <currentDBConfig>h2-db</currentDBConfig>
+    
+    <readOnly>false</readOnly>
+    <enableCache>true</enableCache>
+    <registryRoot>/beep</registryRoot>
+
+    <dbConfig name="derby-embedded-db">
+        <url>jdbc:derby:databasetest/CARBON_TEST;create=true</url>
+        <!--userName>su</userName>
+        <password>su</password-->
+        <driverName>org.apache.derby.jdbc.EmbeddedDriver</driverName>
+        <maxActive>80</maxActive>
+        <maxWait>60000</maxWait>
+        <minIdle>5</minIdle>
+    </dbConfig>
+
+    <dbConfig name="in-memory">
+        <url>jdbc:hsqldb:mem:aname</url>
+        <userName>sa</userName>
+        <password/>
+        <driverName>org.hsqldb.jdbcDriver</driverName>
+    </dbConfig>
+
+    <dbConfig name="sample">
+        <url>jdbc:hsqldb:$basedir$/sample/sample-db;shutdown=true</url>
+        <userName>sa</userName>
+        <password/>
+        <driverName>org.hsqldb.jdbcDriver</driverName>
+    </dbConfig>
+
+    <dbConfig name="derby-db">
+        <url>jdbc:derby://localhost:1527/derbyDB;create=true</url>
+        <userName>userName</userName>
+        <password>password</password>
+        <driverName>org.apache.derby.jdbc.ClientDriver</driverName>
+        <maxActive>80</maxActive>
+        <maxWait>60000</maxWait>
+        <minIdle>5</minIdle>
+    </dbConfig>
+
+    <dbConfig name="mysql-db">
+        <url>jdbc:mysql://localhost:3306/regdb</url>
+        <userName>regadmin</userName>
+        <password>regadmin</password>
+        <driverName>com.mysql.jdbc.Driver</driverName>
+        <maxActive>80</maxActive>
+        <maxWait>60000</maxWait>
+        <minIdle>5</minIdle>
+    </dbConfig>
+
+    <dbConfig name="registry-datasource">
+        <dataSource>dataSourceName</dataSource>
+    </dbConfig>
+
+    <dbConfig name="oracle-db">
+        <url>jdbc:oracle:thin:@hostname:1521:registry</url>
+        <userName>username</userName>
+        <password>password</password>
+        <driverName>oracle.jdbc.driver.OracleDriver</driverName>
+        <maxActive>100</maxActive>
+        <maxWait>60000</maxWait>
+        <minIdle>5</minIdle>
+    </dbConfig>
+
+	<dbConfig name="mssql-db">
+        <url>jdbc:jtds:sqlserver://localhost:1433/registry</url>
+        <userName>registry</userName>
+        <password>registry</password>
+        <driverName>net.sourceforge.jtds.jdbc.Driver</driverName>
+        <maxActive>100</maxActive>
+        <maxWait>60000</maxWait>
+        <minIdle>5</minIdle>
+    </dbConfig>
+
+    <dbConfig name="h2-db">
+        <url>jdbc:h2:target/databasetest/CARBON_TEST</url>
+        <!--userName>sa</userName>
+        <password>sa</password-->
+        <driverName>org.h2.Driver</driverName>
+        <maxActive>80</maxActive>
+        <maxWait>60000</maxWait>
+        <minIdle>5</minIdle>
+    </dbConfig>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.apache.synapse</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.wso2.esb</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.apache.axis2</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.wso2.wsas</property>
+        </filter>
+    </handler>
+
+    <!--handler class="org.wso2.carbon.registry.extensions.handlers.IndexingHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">text/plain</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.XMLIndexingHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/xml</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.PDFIndexingHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/pdf</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.MSWordIndexingHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/msword</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.MSExcelIndexingHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.ms-excel</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.MSPowerpointIndexingHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.ms-powerpoint</property>
+        </filter>
+    </handler-->
+    
+	<handler class="org.wso2.carbon.registry.extensions.handlers.WSDLMediaTypeHandler">
+		<property name="schemaLocationConfiguration" type="xml">
+            <location>/test_schemas/</location>
+	    </property>
+		<property name="wsdlLocationConfiguration" type="xml">
+            <location>/test_wsdls/</location>
+	    </property>
+		<filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/wsdl+xml</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.ZipWSDLMediaTypeHandler">
+        <property name="wsdlMediaType">application/wsdl+xml</property>
+        <property name="schemaLocationConfiguration" type="xml">
+            <location>/test_schemas/</location>
+        </property>
+        <property name="wsdlLocationConfiguration" type="xml">
+            <location>/test_wsdls/</location>
+        </property>
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.wso2.governance-archive</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.ServiceMediaTypeHandler">
+      <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+	<property name="mediaType">application/vnd.wso2-service+xml</property>
+      </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.PolicyMediaTypeHandler">
+	<property name="policyLocationConfiguration" type="xml">
+            <location>/test_policies/</location>
+	</property>
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/policy+xml</property>
+        </filter>
+    </handler>
+
+	<handler class="org.wso2.carbon.registry.extensions.handlers.XSDMediaTypeHandler">
+        <property name="locationConfiguration" type="xml">
+            <locationType>absolute</locationType>
+            <location>/test_schemas/</location>
+        </property>
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/x-xsd+xml</property>
+        </filter>
+    </handler>
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.EndpointMediaTypeHandler">
+        <property name="endpointMediaType">application/vnd.wso2.endpoint</property>
+        <property name="endpointLocationConfiguration" type="xml">
+            <location>/test_endpoints/</location>
+        </property>
+        <filter class="org.wso2.carbon.registry.extensions.filters.EndpointMediaTypeMatcher">
+        </filter>
+    </handler>
+
+
+    <handler class="org.wso2.carbon.registry.extensions.handlers.ExternalLinkHandler">
+        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
+            <property name="mediaType">application/vnd.wso2-hyperlink</property>
+        </filter>
+    </handler>
+
+	<!--remoteInstance url="https://host:port/registry">
+	<id>instanceid</id>
+	<username>username</username>
+	<password>password</password>
+    </remoteInstance-->
+
+    <staticConfiguration>
+        <versioningProperties>true</versioningProperties>
+        <versioningComments>true</versioningComments>
+        <versioningTags>true</versioningTags>
+        <versioningRatings>true</versioningRatings>
+        <!-- Location you want to add service and default location will be /governance/services/ -->
+        <servicePath>/test_services</servicePath>
+    </staticConfiguration>
+		
+
+    <versionResourcesOnChange>true</versionResourcesOnChange>
+
+</wso2registry>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/adv-jdbc-readonly-test.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/adv-jdbc-readonly-test.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/adv-jdbc-readonly-test.xml
new file mode 100644
index 0000000..e8e4ebd
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/adv-jdbc-readonly-test.xml
@@ -0,0 +1,60 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<UserManager>
+    <Realm>
+        <Configuration>
+            <AdminRole>adminx</AdminRole>
+            <AdminUser>
+                <UserName>adminx</UserName>
+                <Password>adminy</Password>
+            </AdminUser>
+            <EveryOneRoleName>everyonex</EveryOneRoleName>
+            <ReadOnly>true</ReadOnly>
+	    <MaxUserNameListLength>500</MaxUserNameListLength>
+            <Property name="url">jdbc:h2:target/advjdbcrotest/CARBON_TEST</Property>
+            <Property name="driverName">org.h2.Driver</Property>
+            <Property name="maxActive">50</Property>
+            <Property name="maxWait">60000</Property>
+            <Property name="minIdle">5</Property>
+        </Configuration>
+        <UserStoreManager
+            class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
+             <Property name="url">jdbc:h2:target/advjdbcrotest/CARBON_TEST</Property>
+            <Property name="driverName">org.h2.Driver</Property>
+            <Property name="maxActive">50</Property>
+            <Property name="maxWait">60000</Property>
+            <Property name="minIdle">5</Property>
+            <Property name="PasswordDigest">MD5</Property>
+            <Property name="GetPasswordSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>
+            <Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>
+            <Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>
+            <Property name="PasswordDigest">MD5</Property>           
+        </UserStoreManager>
+        <AuthorizationManager
+            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager"></AuthorizationManager>
+    </Realm>
+</UserManager>
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/jdbc-readonly-test.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/jdbc-readonly-test.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/jdbc-readonly-test.xml
new file mode 100644
index 0000000..d2f931c
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/jdbc-readonly-test.xml
@@ -0,0 +1,60 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<UserManager>
+    <Realm>
+        <Configuration>
+            <AdminRole>adminx</AdminRole>
+            <AdminUser>
+                <UserName>adminx</UserName>
+                <Password>adminy</Password>
+            </AdminUser>
+            <SystemUserName>system</SystemUserName>
+            <EveryOneRoleName>everyonex</EveryOneRoleName>
+            <ReadOnly>true</ReadOnly>
+            <MaxUserNameListLength>500</MaxUserNameListLength>
+            <Property name="url">jdbc:h2:target/ReadOnlyTest/CARBON_TEST</Property>
+            <Property name="driverName">org.h2.Driver</Property>
+            <Property name="maxActive">50</Property>
+            <Property name="maxWait">60000</Property>
+            <Property name="minIdle">5</Property>
+        </Configuration>
+        <UserStoreManager
+            class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
+            <Property name="url">jdbc:h2:target/ReadOnlyTest/CARBON_TEST</Property>
+            <Property name="driverName">org.h2.Driver</Property>
+            <Property name="maxActive">50</Property>
+            <Property name="maxWait">60000</Property>
+            <Property name="minIdle">5</Property>
+            <Property name="PasswordDigest">MD5</Property>
+            <Property name="GetPasswordSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>
+            <Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>
+            <Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>
+            <Property name="PasswordDigest">SHA-256</Property>           
+        </UserStoreManager>
+        <AuthorizationManager
+            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager"></AuthorizationManager>
+    </Realm>
+</UserManager>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/user-mgt-registry-test.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/user-mgt-registry-test.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/user-mgt-registry-test.xml
new file mode 100644
index 0000000..57f1973
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/user-mgt-registry-test.xml
@@ -0,0 +1,95 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<UserManager>
+	<Realm>
+		<Configuration>
+			<AdminRole>admin</AdminRole>
+			<AdminUser>
+				<UserName>admin</UserName>
+				<Password>admin</Password>
+			</AdminUser>
+			<EveryOneRoleName>everyone</EveryOneRoleName>
+            <ReadOnly>false</ReadOnly>
+            <MaxUserNameListLength>500</MaxUserNameListLength>
+			<Property name="url">jdbc:h2:target/databasetest/CARBON_TEST</Property>
+			<Property name="driverName">org.h2.Driver</Property>
+			<Property name="maxActive">50</Property>
+			<Property name="maxWait">60000</Property>
+			<Property name="minIdle">5</Property>
+        </Configuration>
+        <UserStoreManager
+            class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
+            <Property name="PasswordJavaRegEx">[\S]{5,30}$</Property>
+            <Property name="PasswordJavaScriptRegEx">[\\S]{5,30}</Property>
+            <Property name="SelectUserSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>
+            <Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>
+            <Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>
+            <Property name="GetUserProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="GetUsersWithDefaultPasswordsSQL">SELECT UM_USER_NAME FROM UM_USER WHERE WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="UserNameUniqueAcrossTenantsSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
+            <Property name="GetUserIDFromUserNameSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetTenantIDFromUserNameSQL">SELECT UM_TENANT_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
+            <Property name="PasswordDigest">SHA-256</Property>
+            <Property name="StoreSaltedPassword">true</Property>
+            <Property name="UserNameUniqueAcrossTenants">false</Property>
+            <Property name="IsEmailUserName">false</Property>
+            <Property name="SuperDomain">wso2.com</Property>
+            <Property name="IsUsersOfRoleListing">true</Property>
+            <!-- writing sqls follow-->
+            <Property name="AddUserSQL">INSERT INTO UM_USER (UM_USER_NAME, UM_USER_PASSWORD, UM_SALT_VALUE, UM_REQUIRE_CHANGE, UM_CHANGED_TIME, UM_TENANT_ID) VALUES (?, ?, ?, ?, ?, ?)</Property>
+            <Property name="AddRoleSQL">INSERT INTO UM_ROLE (UM_ROLE_NAME, UM_TENANT_ID) VALUES (?, ?)</Property>
+            <Property name="AddUserToRoleSQL">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?), ?)</Property>
+            <Property name="AddUserToRoleSQL-mssql">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(?)</Property>
+            <Property name="RemoveUserFromRoleSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="AddRoleToUserSQL">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?)</Property>
+            <Property name="AddRoleToUserSQL-mssql">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?)</Property>
+            <Property name="RemoveRoleFromUserSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="DeleteRoleSQL">DELETE FROM UM_ROLE WHERE UM_ROLE_NAME = ? AND UM_TENANT_ID=?</Property>
+            <Property name="OnDeleteRoleRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="OnDeleteUserRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="OnDeleteUserRemoveUserAttributeSQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="DeleteUserSQL">DELETE FROM UM_USER WHERE UM_USER_NAME = ? AND UM_TENANT_ID=?</Property>
+            <Property name="UpdateUserPasswordSQL">UPDATE UM_USER SET UM_USER_PASSWORD= ?, UM_SALT_VALUE=?, UM_REQUIRE_CHANGE=?, UM_CHANGED_TIME=? WHERE UM_USER_NAME= ? AND UM_TENANT_ID=?</Property>
+            <Property name="AddUserPropertySQL">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?, ?, ?, ?)</Property>
+            <Property name="AddUserPropertySQL-mssql">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?), (?), (?), (?)</Property>
+            <Property name="UpdateUserPropertySQL">UPDATE UM_USER_ATTRIBUTE SET UM_ATTR_VALUE=? WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
+            <Property name="DeleteUserPropertySQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
+        </UserStoreManager>
+        <AuthorizationManager
+            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager"></AuthorizationManager>
+    </Realm>
+    <SystemPermission>
+        <Permission>login</Permission>
+        <Permission>manage-configuration</Permission>
+        <Permission>manage-security</Permission>
+        <Permission>upload-services</Permission>
+        <Permission>manage-services</Permission>
+        <Permission>manage-lc-configuration</Permission>
+        <Permission>manage-mediation</Permission>
+        <Permission>monitor-system</Permission>
+        <Permission>delegate-identity</Permission>
+    </SystemPermission>
+</UserManager>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/user-mgt-test.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/user-mgt-test.xml b/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/user-mgt-test.xml
new file mode 100644
index 0000000..3663a7f
--- /dev/null
+++ b/components/org.apache.stratos.throttling.manager/src/test/resources/user-test/user-mgt-test.xml
@@ -0,0 +1,96 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<UserManager>
+	<Realm>
+		<Configuration>
+			<AdminRole>admin</AdminRole>
+			<AdminUser>
+				<UserName>admin</UserName>
+				<Password>admin</Password>
+			</AdminUser>
+			<EveryOneRoleName>everyone</EveryOneRoleName>
+            <ReadOnly>false</ReadOnly>
+            <MaxUserNameListLength>500</MaxUserNameListLength>
+			<!-- Property name="url"> Different test cases must have different urls. 
+			Because creating the database in same directory while running TestCase after another gives errors in some architectures</Property-->
+			<Property name="driverName">org.h2.Driver</Property>
+			<Property name="maxActive">50</Property>
+			<Property name="maxWait">60000</Property>
+			<Property name="minIdle">5</Property>
+        </Configuration>
+        <UserStoreManager
+            class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
+            <Property name="PasswordJavaRegEx">[\S]{5,30}$</Property>
+            <Property name="PasswordJavaScriptRegEx">[\\S]{5,30}</Property>
+            <Property name="SelectUserSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>
+            <Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>
+            <Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
+            <Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>
+            <Property name="GetUserProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="GetUsersWithDefaultPasswordsSQL">SELECT UM_USER_NAME FROM UM_USER WHERE WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="UserNameUniqueAcrossTenantsSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
+            <Property name="GetUserIDFromUserNameSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
+            <Property name="GetTenantIDFromUserNameSQL">SELECT UM_TENANT_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
+            <Property name="PasswordDigest">SHA-256</Property>
+            <Property name="StoreSaltedPassword">true</Property>
+            <Property name="UserNameUniqueAcrossTenants">false</Property>
+            <Property name="IsEmailUserName">false</Property>
+            <Property name="SuperDomain">wso2.com</Property>
+            <Property name="IsUsersOfRoleListing">true</Property>
+            <!-- writing sqls follow-->
+            <Property name="AddUserSQL">INSERT INTO UM_USER (UM_USER_NAME, UM_USER_PASSWORD, UM_SALT_VALUE, UM_REQUIRE_CHANGE, UM_CHANGED_TIME, UM_TENANT_ID) VALUES (?, ?, ?, ?, ?, ?)</Property>
+            <Property name="AddRoleSQL">INSERT INTO UM_ROLE (UM_ROLE_NAME, UM_TENANT_ID) VALUES (?, ?)</Property>
+            <Property name="AddUserToRoleSQL">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?), ?)</Property>
+            <Property name="AddUserToRoleSQL-mssql">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(?)</Property>
+            <Property name="RemoveUserFromRoleSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="AddRoleToUserSQL">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?)</Property>
+            <Property name="AddRoleToUserSQL-mssql">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?)</Property>
+            <Property name="RemoveRoleFromUserSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="DeleteRoleSQL">DELETE FROM UM_ROLE WHERE UM_ROLE_NAME = ? AND UM_TENANT_ID=?</Property>
+            <Property name="OnDeleteRoleRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="OnDeleteUserRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="OnDeleteUserRemoveUserAttributeSQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
+            <Property name="DeleteUserSQL">DELETE FROM UM_USER WHERE UM_USER_NAME = ? AND UM_TENANT_ID=?</Property>
+            <Property name="UpdateUserPasswordSQL">UPDATE UM_USER SET UM_USER_PASSWORD= ?, UM_SALT_VALUE=?, UM_REQUIRE_CHANGE=?, UM_CHANGED_TIME=? WHERE UM_USER_NAME= ? AND UM_TENANT_ID=?</Property>
+            <Property name="AddUserPropertySQL">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?, ?, ?, ?)</Property>
+            <Property name="AddUserPropertySQL-mssql">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?), (?), (?), (?)</Property>
+            <Property name="UpdateUserPropertySQL">UPDATE UM_USER_ATTRIBUTE SET UM_ATTR_VALUE=? WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
+            <Property name="DeleteUserPropertySQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
+        </UserStoreManager>
+        <AuthorizationManager
+            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager"></AuthorizationManager>
+    </Realm>
+    <SystemPermission>
+        <Permission>login</Permission>
+        <Permission>manage-configuration</Permission>
+        <Permission>manage-security</Permission>
+        <Permission>upload-services</Permission>
+        <Permission>manage-services</Permission>
+        <Permission>manage-lc-configuration</Permission>
+        <Permission>manage-mediation</Permission>
+        <Permission>monitor-system</Permission>
+        <Permission>delegate-identity</Permission>
+    </SystemPermission>
+</UserManager>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.ui/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.ui/pom.xml b/components/org.apache.stratos.throttling.ui/pom.xml
new file mode 100644
index 0000000..784042b
--- /dev/null
+++ b/components/org.apache.stratos.throttling.ui/pom.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+  #  Licensed to the Apache Software Foundation (ASF) under one
+  #  or more contributor license agreements.  See the NOTICE file
+  #  distributed with this work for additional information
+  #  regarding copyright ownership.  The ASF licenses this file
+  #  to you under the Apache License, Version 2.0 (the
+  #  "License"); you may not use this file except in compliance
+  #  with the License.  You may obtain a copy of the License at
+  #  
+  #  http://www.apache.org/licenses/LICENSE-2.0
+  #  
+  #  Unless required by applicable law or agreed to in writing,
+  #  software distributed under the License is distributed on an
+  #  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  #  KIND, either express or implied.  See the License for the
+  #  specific language governing permissions and limitations
+  #  under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>stratos-components-parent</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.apache.stratos.throttling.ui</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache Stratos - Throttling - User Interface</name>
+
+    <build>
+		<plugins>
+		    <plugin>
+		        <groupId>org.apache.felix</groupId>
+		        <artifactId>maven-bundle-plugin</artifactId>
+		        
+		        <extensions>true</extensions>
+		        <configuration>
+		            <instructions>
+		                <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+		                <Bundle-Name>${project.artifactId}</Bundle-Name>
+		                <Export-Package>
+		                    org.apache.stratos.throttling.ui.*,
+		                </Export-Package>
+		                <Import-Package>
+		                	org.wso2.carbon.throttling.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>
+   	    <version>1.4.0.wso2v1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.common.ui</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.core</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.equinox</groupId>
+            <artifactId>javax.servlet</artifactId>
+	    <version>3.0.0.v201112011016</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2.wso2</groupId>
+            <artifactId>axis2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom.wso2</groupId>
+            <artifactId>axiom</artifactId>
+	    <version>1.2.11.wso2v4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.ui</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.core</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.common</artifactId>
+	    <version>${apache.stratos.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.throttling.stub</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.ui/src/main/java/org/apache/stratos/throttling/ui/clients/ThrottlingRuleEditorClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.ui/src/main/java/org/apache/stratos/throttling/ui/clients/ThrottlingRuleEditorClient.java b/components/org.apache.stratos.throttling.ui/src/main/java/org/apache/stratos/throttling/ui/clients/ThrottlingRuleEditorClient.java
new file mode 100644
index 0000000..5afc7cc
--- /dev/null
+++ b/components/org.apache.stratos.throttling.ui/src/main/java/org/apache/stratos/throttling/ui/clients/ThrottlingRuleEditorClient.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.throttling.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.throttling.stub.services.ThrottlingRuleEditorServiceStub;
+import org.wso2.carbon.ui.CarbonUIUtil;
+import org.wso2.carbon.utils.ServerConstants;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.http.HttpSession;
+
+public class ThrottlingRuleEditorClient {
+    private static final Log log = LogFactory.getLog(ThrottlingRuleEditorClient.class);
+
+    private ThrottlingRuleEditorServiceStub stub;
+    private String epr;
+
+    public ThrottlingRuleEditorClient(String cookie, String backendServerURL,
+            ConfigurationContext configContext) throws RegistryException {
+
+        epr = backendServerURL + "ThrottlingRuleEditorService";
+
+        try {
+            stub = new ThrottlingRuleEditorServiceStub(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 throttling rule editor service client. " +
+                            axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+    public ThrottlingRuleEditorClient(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 + "ThrottlingRuleEditorService";
+
+        try {
+            stub = new ThrottlingRuleEditorServiceStub(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 throttling rule editor service client. " +
+                            axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+    public String retrieveThrottlingRules() throws Exception {
+        return stub.retrieveThrottlingRules();
+    }
+
+    public void updateThrottlingRules(String ruleContent) throws Exception {
+        stub.updateThrottlingRules(ruleContent);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.ui/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.ui/src/main/resources/META-INF/component.xml b/components/org.apache.stratos.throttling.ui/src/main/resources/META-INF/component.xml
new file mode 100644
index 0000000..47c20c1
--- /dev/null
+++ b/components/org.apache.stratos.throttling.ui/src/main/resources/META-INF/component.xml
@@ -0,0 +1,37 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<component xmlns="http://products.wso2.org/carbon">
+    <!-- sample menu configuration -->
+    <menus>
+        <menu>
+            <id>multitenancy_throttling_menu</id>
+            <i18n-key>throttling.menu.key</i18n-key>
+            <i18n-bundle>org.apache.stratos.throttling.ui.i18n.Resources</i18n-bundle>
+            <parent-menu>configure_menu</parent-menu>
+            <link>../mt-throttling/throttling.jsp</link>
+            <region>region1</region>
+            <order>8</order>
+            <style-class>manage</style-class>
+            <icon>../mt-throttling/images/throttling.gif</icon>
+            <require-permission>/permission/protected/configure/throttling-rules</require-permission>
+            <require-super-tenant>true</require-super-tenant>
+        </menu>
+    </menus>
+
+</component>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.ui/src/main/resources/ThrottlingRuleEditorService.wsdl
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.ui/src/main/resources/ThrottlingRuleEditorService.wsdl b/components/org.apache.stratos.throttling.ui/src/main/resources/ThrottlingRuleEditorService.wsdl
new file mode 100644
index 0000000..a9f511a
--- /dev/null
+++ b/components/org.apache.stratos.throttling.ui/src/main/resources/ThrottlingRuleEditorService.wsdl
@@ -0,0 +1,148 @@
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://services.manager.throttling.carbon.wso2.org" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://services.manager.throttling.carbon.wso2.org">
+    <wsdl:documentation>ThrottlingRuleEditorService</wsdl:documentation>
+    <wsdl:types>
+        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.manager.throttling.carbon.wso2.org">
+            <xs:element name="updateThrottlingRulesException">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="updateThrottlingRulesException" nillable="true" type="ns:Exception" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:complexType name="Exception">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string" />
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="updateThrottlingRules">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="ruleContent" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="retrieveThrottlingRulesException">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="retrieveThrottlingRulesException" nillable="true" type="ns:Exception" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="retrieveThrottlingRules">
+                <xs:complexType>
+                    <xs:sequence />
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="retrieveThrottlingRulesResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:schema>
+    </wsdl:types>
+    <wsdl:message name="updateThrottlingRulesRequest">
+        <wsdl:part name="parameters" element="ns:updateThrottlingRules" />
+    </wsdl:message>
+    <wsdl:message name="updateThrottlingRulesException">
+        <wsdl:part name="parameters" element="ns:updateThrottlingRulesException" />
+    </wsdl:message>
+    <wsdl:message name="retrieveThrottlingRulesRequest">
+        <wsdl:part name="parameters" element="ns:retrieveThrottlingRules" />
+    </wsdl:message>
+    <wsdl:message name="retrieveThrottlingRulesResponse">
+        <wsdl:part name="parameters" element="ns:retrieveThrottlingRulesResponse" />
+    </wsdl:message>
+    <wsdl:message name="retrieveThrottlingRulesException">
+        <wsdl:part name="parameters" element="ns:retrieveThrottlingRulesException" />
+    </wsdl:message>
+    <wsdl:portType name="ThrottlingRuleEditorServicePortType">
+        <wsdl:operation name="updateThrottlingRules">
+            <wsdl:input message="ns:updateThrottlingRulesRequest" wsaw:Action="urn:updateThrottlingRules" />
+            <wsdl:fault message="ns:updateThrottlingRulesException" name="updateThrottlingRulesException" wsaw:Action="urn:updateThrottlingRulesupdateThrottlingRulesException" />
+        </wsdl:operation>
+        <wsdl:operation name="retrieveThrottlingRules">
+            <wsdl:input message="ns:retrieveThrottlingRulesRequest" wsaw:Action="urn:retrieveThrottlingRules" />
+            <wsdl:output message="ns:retrieveThrottlingRulesResponse" wsaw:Action="urn:retrieveThrottlingRulesResponse" />
+            <wsdl:fault message="ns:retrieveThrottlingRulesException" name="retrieveThrottlingRulesException" wsaw:Action="urn:retrieveThrottlingRulesretrieveThrottlingRulesException" />
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="ThrottlingRuleEditorServiceSoap11Binding" type="ns:ThrottlingRuleEditorServicePortType">
+        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+        <wsdl:operation name="updateThrottlingRules">
+            <soap:operation soapAction="urn:updateThrottlingRules" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:fault name="updateThrottlingRulesException">
+                <soap:fault use="literal" name="updateThrottlingRulesException" />
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="retrieveThrottlingRules">
+            <soap:operation soapAction="urn:retrieveThrottlingRules" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="retrieveThrottlingRulesException">
+                <soap:fault use="literal" name="retrieveThrottlingRulesException" />
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="ThrottlingRuleEditorServiceSoap12Binding" type="ns:ThrottlingRuleEditorServicePortType">
+        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+        <wsdl:operation name="updateThrottlingRules">
+            <soap12:operation soapAction="urn:updateThrottlingRules" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:fault name="updateThrottlingRulesException">
+                <soap12:fault use="literal" name="updateThrottlingRulesException" />
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="retrieveThrottlingRules">
+            <soap12:operation soapAction="urn:retrieveThrottlingRules" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="retrieveThrottlingRulesException">
+                <soap12:fault use="literal" name="retrieveThrottlingRulesException" />
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="ThrottlingRuleEditorServiceHttpBinding" type="ns:ThrottlingRuleEditorServicePortType">
+        <http:binding verb="POST" />
+        <wsdl:operation name="updateThrottlingRules">
+            <http:operation location="updateThrottlingRules" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:input>
+        </wsdl:operation>
+        <wsdl:operation name="retrieveThrottlingRules">
+            <http:operation location="retrieveThrottlingRules" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="ThrottlingRuleEditorService">
+        <wsdl:port name="ThrottlingRuleEditorServiceHttpsSoap11Endpoint" binding="ns:ThrottlingRuleEditorServiceSoap11Binding">
+            <soap:address location="https://192.168.1.100:9443/services/ThrottlingRuleEditorService.ThrottlingRuleEditorServiceHttpsSoap11Endpoint/" />
+        </wsdl:port>
+        <wsdl:port name="ThrottlingRuleEditorServiceHttpsSoap12Endpoint" binding="ns:ThrottlingRuleEditorServiceSoap12Binding">
+            <soap12:address location="https://192.168.1.100:9443/services/ThrottlingRuleEditorService.ThrottlingRuleEditorServiceHttpsSoap12Endpoint/" />
+        </wsdl:port>
+        <wsdl:port name="ThrottlingRuleEditorServiceHttpsEndpoint" binding="ns:ThrottlingRuleEditorServiceHttpBinding">
+            <http:address location="https://192.168.1.100:9443/services/ThrottlingRuleEditorService.ThrottlingRuleEditorServiceHttpsEndpoint/" />
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.ui/src/main/resources/org/apache/carbon/throttling/ui/i18n/JSResources.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.ui/src/main/resources/org/apache/carbon/throttling/ui/i18n/JSResources.properties b/components/org.apache.stratos.throttling.ui/src/main/resources/org/apache/carbon/throttling/ui/i18n/JSResources.properties
new file mode 100644
index 0000000..bf90999
--- /dev/null
+++ b/components/org.apache.stratos.throttling.ui/src/main/resources/org/apache/carbon/throttling/ui/i18n/JSResources.properties
@@ -0,0 +1 @@
+empty=To make sure the js properties file is not empty

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.ui/src/main/resources/org/apache/carbon/throttling/ui/i18n/Resources.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.ui/src/main/resources/org/apache/carbon/throttling/ui/i18n/Resources.properties b/components/org.apache.stratos.throttling.ui/src/main/resources/org/apache/carbon/throttling/ui/i18n/Resources.properties
new file mode 100644
index 0000000..d74f234
--- /dev/null
+++ b/components/org.apache.stratos.throttling.ui/src/main/resources/org/apache/carbon/throttling/ui/i18n/Resources.properties
@@ -0,0 +1,2 @@
+throttling.menu.key=Throttling
+throttling.rules=Throttling Rules
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/docs/images/add-org.png
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/docs/images/add-org.png b/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/docs/images/add-org.png
new file mode 100644
index 0000000..fc710f8
Binary files /dev/null and b/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/docs/images/add-org.png differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/docs/userguide.html
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/docs/userguide.html b/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/docs/userguide.html
new file mode 100644
index 0000000..c5fb241
--- /dev/null
+++ b/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/docs/userguide.html
@@ -0,0 +1,35 @@
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. licenses this file to you under the Apache License,
+ ~ Version 2.0 (the "License"); you may not use this file except
+ ~ in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~    http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied.  See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <title>Multitenancy Throttling Rules Editor - User Guide</title>
+  <link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all" />
+</head>
+
+<body>
+<h1>Multitenancy Throttling Rules Editor</h1>
+
+<p>
+This editor allows you to edit the rules and update it. The changes to the rules get effected immediately 
+after you press the 'Update' button. 
+</p>
+
+</body>
+
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/images/throttling.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/images/throttling.gif b/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/images/throttling.gif
new file mode 100644
index 0000000..a9b04e2
Binary files /dev/null and b/components/org.apache.stratos.throttling.ui/src/main/resources/web/mt-throttling/images/throttling.gif differ


[02/18] applying 0001-Refactor-throttling-module.patch

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/user-mgt.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/user-mgt.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/user-mgt.xml
deleted file mode 100644
index e95afca..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/user-mgt.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<!--
-  ~ Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-        
-<UserManager>
-    <Realm>
-        <Configuration>
-                <AdminRole>admin</AdminRole>
-                <AdminUser>
-                     <UserName>admin</UserName>
-                     <Password>admin</Password>
-                </AdminUser>
-            <EveryOneRoleName>everyone</EveryOneRoleName> <!-- By default users in thsi role sees the registry root -->
-            <ReadOnly>false</ReadOnly>
-            <MaxUserNameListLength>500</MaxUserNameListLength>
-            <Property name="url">jdbc:h2:repository/database/WSO2CARBON_DB</Property>
-            <Property name="userName">wso2carbon</Property>
-            <Property name="password">wso2carbon</Property>
-            <Property name="driverName">org.h2.Driver</Property>
-            <Property name="maxActive">50</Property>
-            <Property name="maxWait">60000</Property>
-            <Property name="minIdle">5</Property>
-        </Configuration>
-        <UserStoreManager
-            class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
-            <!-- Readonly Properties -->
-            <Property name="IsEmailUserName">false</Property>
-            <Property name="DomainCalculation">default</Property>
-            <Property name="SelectUserSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-	        <Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>
-            <Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>
-            <Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>
-            <Property name="GetUserProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-	        <Property name="GetUsersWithDefaultPasswordsSQL">SELECT UM_USER_NAME FROM UM_USER WHERE WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="UserNameUniqueAcrossTenantsSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
-            <Property name="GetUserIDFromUserNameSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetTenantIDFromUserNameSQL">SELECT UM_TENANT_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
-            <!-- writing sqls follow-->
-            <Property name="PasswordDigest">SHA-256</Property>
-            <Property name="StoreSaltedPassword">true</Property>
-            <Property name="UserNameUniqueAcrossTenants">false</Property>
-            <Property name="PasswordJavaRegEx">[\S]{5,30}$</Property>
-            <Property name="PasswordJavaScriptRegEx">[\\S]{5,30}</Property>
-            <Property name="AddUserSQL">INSERT INTO UM_USER (UM_USER_NAME, UM_USER_PASSWORD, UM_SALT_VALUE, UM_REQUIRE_CHANGE, UM_CHANGED_TIME, UM_TENANT_ID) VALUES (?, ?, ?, ?, ?, ?)</Property>
-	        <Property name="AddRoleSQL">INSERT INTO UM_ROLE (UM_ROLE_NAME, UM_TENANT_ID) VALUES (?, ?)</Property>
-            <Property name="AddUserToRoleSQL">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?), ?)</Property>
-            <Property name="AddUserToRoleSQL-mssql">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(?)</Property>
-            <Property name="RemoveUserFromRoleSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="AddRoleToUserSQL">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?)</Property>
-            <Property name="AddRoleToUserSQL-mssql">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?)</Property>
-            <Property name="RemoveRoleFromUserSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="DeleteRoleSQL">DELETE FROM UM_ROLE WHERE UM_ROLE_NAME = ? AND UM_TENANT_ID=?</Property>
-            <Property name="OnDeleteRoleRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="OnDeleteUserRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="OnDeleteUserRemoveUserAttributeSQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="DeleteUserSQL">DELETE FROM UM_USER WHERE UM_USER_NAME = ? AND UM_TENANT_ID=?</Property>
-            <Property name="UpdateUserPasswordSQL">UPDATE UM_USER SET UM_USER_PASSWORD= ?, UM_SALT_VALUE=?, UM_REQUIRE_CHANGE=?, UM_CHANGED_TIME=? WHERE UM_USER_NAME= ? AND UM_TENANT_ID=?</Property>
-	        <Property name="AddUserPropertySQL">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?, ?, ?, ?)</Property>
-            <Property name="AddUserPropertySQL-mssql">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?), (?), (?), (?)</Property>
-            <Property name="UpdateUserPropertySQL">UPDATE UM_USER_ATTRIBUTE SET UM_ATTR_VALUE=? WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
-            <Property name="DeleteUserPropertySQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
-        </UserStoreManager>
-        <!-- UserStoreManager
-            class="org.wso2.carbon.user.core.ldap.LDAPUserStoreManager">
-            <Property name="ConnectionURL">ldap://localhost:10389</Property>
-            <Property name="ConnectionName">uid=admin,ou=system</Property>
-            <Property name="ConnectionPassword">admin123</Property>
-            <Property name="UserSearchBase">ou=system</Property>
-            <Property name="UserNameListFilter">(objectClass=person)</Property>
-            <Property name="UserNameAttribute">uid</Property>
-            <Property name="ReadLDAPGroups">false</Property>
-            <Property name="GroupSearchBase">ou=system</Property>
-            <Property name="GroupSearchFilter">(objectClass=groupOfNames)</Property>
-            <Property name="GroupNameAttribute">cn</Property>
-            <Property name="MembershipAttribute">member</Property>
-        </UserStoreManager -->
-        <!-- Active directory configuration follows -->
-        <!-- UserStoreManager
-            class="org.wso2.carbon.user.core.ldap.LDAPUserStoreManager">
-            <Property name="ConnectionURL">ldap://10.100.1.211:389</Property>
-            <Property name="ConnectionName">cn=Administrator,cn=users,dc=wso2,dc=lk</Property>
-            <Property name="ConnectionPassword">admin123</Property>
-            <Property name="UserSearchBase">cn=users,dc=wso2,dc=lk</Property>
-            <Property name="UserNameListFilter">(objectClass=person)</Property>
-            <Property name="UserNameAttribute">sAMAccountName</Property>
-            <Property name="ReadLDAPGroups">true</Property>
-            <Property name="GroupSearchBase">cn=users,dc=wso2,dc=lk</Property>
-            <Property name="GroupSearchFilter">(objectcategory=group)</Property>
-            <Property name="GroupNameAttribute">cn</Property>
-            <Property name="MemberOfAttribute">memberOf</Property>
-        </UserStoreManager -->
-        <AuthorizationManager
-            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager">
-        </AuthorizationManager> 
-    </Realm>
-</UserManager>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/wrapper.conf
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/wrapper.conf b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/wrapper.conf
deleted file mode 100644
index e2f4715..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/conf/wrapper.conf
+++ /dev/null
@@ -1,125 +0,0 @@
-#********************************************************************
-# Wrapper Properties
-#********************************************************************
-# Java Application
-wrapper.java.command=%JAVA_HOME%/bin/java
-
-# set the working directory to the CARBON_HOME
-wrapper.working.dir=../..
-
-# Java Main class.  This class must implement the WrapperListener interface
-#  or guarantee that the WrapperManager class is initialized.  Helper
-#  classes are provided to do this for you.  See the Integration section
-#  of the documentation for details.
-wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
-
-# Java Classpath (include wrapper.jar)  Add class path elements as
-#  needed starting from 1
-wrapper.java.classpath.1=lib/wrapper-3.2.3.jar
-wrapper.java.classpath.2=lib
-wrapper.java.classpath.3=lib/*.jar
-wrapper.java.classpath.4=lib/patches
-wrapper.java.classpath.5=lib/patches/*.jar
-wrapper.java.classpath.8=repository/conf
-# Java Library Path (location of Wrapper.DLL or libwrapper.so)
-wrapper.java.library.path.1=bin/native
-
-# Java Additional Parameters
-wrapper.java.additional.1=-Xms256m
-wrapper.java.additional.2=-Xmx512m
-wrapper.java.additional.3=-XX:MaxPermSize=128m
-wrapper.java.additional.4=-Dcarbon.home=.
-wrapper.java.additional.5=-Djava.endorsed.dirs=lib/endorsed
-wrapper.java.additional.6=-Dcom.sun.management.jmxremote
-wrapper.java.additional.7=-Dwso2.server.standalone=true
-wrapper.java.additional.8=-Djava.io.tmpdir=tmp
-#wrapper.java.additional.9=-Dlog4j.configuration=repository/conf/log4j.properties
-wrapper.java.additional.9=-Dwso2.transports.xml=repository/conf/mgt-transports.xml
-wrapper.java.additional.10=-Dcarbon.registry.root=/
-
-# Initial Java Heap Size (in MB)
-wrapper.java.initmemory=256
-
-# Maximum Java Heap Size (in MB)
-wrapper.java.maxmemory=512
-
-# Application parameters.  Add parameters as needed starting from 1
-wrapper.app.parameter.1=org.wso2.carbon.server.Main
-wrapper.app.parameter.2=RUN
-
-#********************************************************************
-# Wrapper Logging Properties
-#********************************************************************
-# Format of output for the console.
-# (See http://wrapper.tanukisoftware.org/doc/english/prop-console-format.html for formats)
-wrapper.console.format=M
-
-# Log Level for console output.  (See docs for log levels)
-wrapper.console.loglevel=INFO
-
-# Log file to use for wrapper output logging.
-wrapper.logfile=./repository/logs/wrapper.log
-
-# Format of output for the log file.  (See docs for formats)
-wrapper.logfile.format=LPTM
-
-# Log Level for log file output.  (See docs for log levels)
-wrapper.logfile.loglevel=INFO
-
-# Maximum size that the log file will be allowed to grow to before
-#  the log is rolled. Size is specified in bytes.  The default value
-#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
-#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
-wrapper.logfile.maxsize=5m
-
-# Maximum number of rolled log files which will be allowed before old
-#  files are deleted.  The default value of 0 implies no limit.
-wrapper.logfile.maxfiles=0
-
-# Log Level for sys/event log output.  (See docs for log levels)
-wrapper.syslog.loglevel=NONE
-
-#********************************************************************
-# Wrapper Windows Properties
-#********************************************************************
-# Title to use when running as a console
-wrapper.console.title=WSO2 Carbon
-
-#********************************************************************
-# Wrapper Windows NT/2000/XP Service Properties
-#********************************************************************
-# WARNING - Do not modify any of these properties when an application
-#  using this configuration file has been installed as a service.
-#  Please uninstall the service before modifying this section.  The
-#  service can then be reinstalled.
-
-# Name of the service
-wrapper.ntservice.name=WSO2Carbon
-
-# Display name of the service
-wrapper.ntservice.displayname=WSO2 Carbon
-
-# Description of the service
-wrapper.ntservice.description=WSO2 Carbon
-
-
-# Service dependencies.  Add dependencies as needed starting from 1
-wrapper.ntservice.dependency.1=
-
-# Mode in which the service is installed.  AUTO_START or DEMAND_START
-wrapper.ntservice.starttype=AUTO_START
-
-# Allow the service to interact with the desktop.
-wrapper.ntservice.interactive=true
-
-#Setting this property will cause the Wrapper to allocate and display a console 
-# window when running as an NT service. The console will only be visible if 
-# the wrapper.ntservice.interactive  property is also set to true. Defaults to false.
-wrapper.ntservice.console=false
-
-# Specifies the priority at which the Wrapper and its JVM will be run at when 
-# run as an NT service or as a console application. Possible values are 
-# LOW, BELOW_NORMAL, NORMAL, ABOVE_NORMAL, HIGH, and REALTIME. 
-# Defaults to NORMAL. BELOW_NORMAL and ABOVE_NORMAL are not supported on Windows NT, 95 or 98.
-wrapper.ntservice.process_priority=HIGH
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/logs/README
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/logs/README b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/logs/README
deleted file mode 100644
index 8871a93..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/carbon-home/repository/logs/README
+++ /dev/null
@@ -1 +0,0 @@
-CARBON_HOME/repository/logs contains all log files created during execution
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/registry.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/registry.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/registry.xml
deleted file mode 100644
index a8779f8..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/registry.xml
+++ /dev/null
@@ -1,247 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<!--
-  ~ Copyright 2005-2009 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<wso2registry>
-    <currentDBConfig>h2-db</currentDBConfig>
-    
-    <readOnly>false</readOnly>
-    <enableCache>true</enableCache>
-    <registryRoot>/beep</registryRoot>
-
-    <dbConfig name="derby-embedded-db">
-        <url>jdbc:derby:databasetest/CARBON_TEST;create=true</url>
-        <!--userName>su</userName>
-        <password>su</password-->
-        <driverName>org.apache.derby.jdbc.EmbeddedDriver</driverName>
-        <maxActive>80</maxActive>
-        <maxWait>60000</maxWait>
-        <minIdle>5</minIdle>
-    </dbConfig>
-
-    <dbConfig name="in-memory">
-        <url>jdbc:hsqldb:mem:aname</url>
-        <userName>sa</userName>
-        <password/>
-        <driverName>org.hsqldb.jdbcDriver</driverName>
-    </dbConfig>
-
-    <dbConfig name="sample">
-        <url>jdbc:hsqldb:$basedir$/sample/sample-db;shutdown=true</url>
-        <userName>sa</userName>
-        <password/>
-        <driverName>org.hsqldb.jdbcDriver</driverName>
-    </dbConfig>
-
-    <dbConfig name="derby-db">
-        <url>jdbc:derby://localhost:1527/derbyDB;create=true</url>
-        <userName>userName</userName>
-        <password>password</password>
-        <driverName>org.apache.derby.jdbc.ClientDriver</driverName>
-        <maxActive>80</maxActive>
-        <maxWait>60000</maxWait>
-        <minIdle>5</minIdle>
-    </dbConfig>
-
-    <dbConfig name="mysql-db">
-        <url>jdbc:mysql://localhost:3306/regdb</url>
-        <userName>regadmin</userName>
-        <password>regadmin</password>
-        <driverName>com.mysql.jdbc.Driver</driverName>
-        <maxActive>80</maxActive>
-        <maxWait>60000</maxWait>
-        <minIdle>5</minIdle>
-    </dbConfig>
-
-    <dbConfig name="registry-datasource">
-        <dataSource>dataSourceName</dataSource>
-    </dbConfig>
-
-    <dbConfig name="oracle-db">
-        <url>jdbc:oracle:thin:@hostname:1521:registry</url>
-        <userName>username</userName>
-        <password>password</password>
-        <driverName>oracle.jdbc.driver.OracleDriver</driverName>
-        <maxActive>100</maxActive>
-        <maxWait>60000</maxWait>
-        <minIdle>5</minIdle>
-    </dbConfig>
-
-	<dbConfig name="mssql-db">
-        <url>jdbc:jtds:sqlserver://localhost:1433/registry</url>
-        <userName>registry</userName>
-        <password>registry</password>
-        <driverName>net.sourceforge.jtds.jdbc.Driver</driverName>
-        <maxActive>100</maxActive>
-        <maxWait>60000</maxWait>
-        <minIdle>5</minIdle>
-    </dbConfig>
-
-    <dbConfig name="h2-db">
-        <url>jdbc:h2:target/databasetest/CARBON_TEST</url>
-        <!--userName>sa</userName>
-        <password>sa</password-->
-        <driverName>org.h2.Driver</driverName>
-        <maxActive>80</maxActive>
-        <maxWait>60000</maxWait>
-        <minIdle>5</minIdle>
-    </dbConfig>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.apache.synapse</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.SynapseRepositoryHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.wso2.esb</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.apache.axis2</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.Axis2RepositoryHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.wso2.wsas</property>
-        </filter>
-    </handler>
-
-    <!--handler class="org.wso2.carbon.registry.extensions.handlers.IndexingHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">text/plain</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.XMLIndexingHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/xml</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.PDFIndexingHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/pdf</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.MSWordIndexingHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/msword</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.MSExcelIndexingHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.ms-excel</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.MSPowerpointIndexingHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.ms-powerpoint</property>
-        </filter>
-    </handler-->
-    
-	<handler class="org.wso2.carbon.registry.extensions.handlers.WSDLMediaTypeHandler">
-		<property name="schemaLocationConfiguration" type="xml">
-            <location>/test_schemas/</location>
-	    </property>
-		<property name="wsdlLocationConfiguration" type="xml">
-            <location>/test_wsdls/</location>
-	    </property>
-		<filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/wsdl+xml</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.ZipWSDLMediaTypeHandler">
-        <property name="wsdlMediaType">application/wsdl+xml</property>
-        <property name="schemaLocationConfiguration" type="xml">
-            <location>/test_schemas/</location>
-        </property>
-        <property name="wsdlLocationConfiguration" type="xml">
-            <location>/test_wsdls/</location>
-        </property>
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.wso2.governance-archive</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.ServiceMediaTypeHandler">
-      <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-	<property name="mediaType">application/vnd.wso2-service+xml</property>
-      </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.PolicyMediaTypeHandler">
-	<property name="policyLocationConfiguration" type="xml">
-            <location>/test_policies/</location>
-	</property>
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/policy+xml</property>
-        </filter>
-    </handler>
-
-	<handler class="org.wso2.carbon.registry.extensions.handlers.XSDMediaTypeHandler">
-        <property name="locationConfiguration" type="xml">
-            <locationType>absolute</locationType>
-            <location>/test_schemas/</location>
-        </property>
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/x-xsd+xml</property>
-        </filter>
-    </handler>
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.EndpointMediaTypeHandler">
-        <property name="endpointMediaType">application/vnd.wso2.endpoint</property>
-        <property name="endpointLocationConfiguration" type="xml">
-            <location>/test_endpoints/</location>
-        </property>
-        <filter class="org.wso2.carbon.registry.extensions.filters.EndpointMediaTypeMatcher">
-        </filter>
-    </handler>
-
-
-    <handler class="org.wso2.carbon.registry.extensions.handlers.ExternalLinkHandler">
-        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
-            <property name="mediaType">application/vnd.wso2-hyperlink</property>
-        </filter>
-    </handler>
-
-	<!--remoteInstance url="https://host:port/registry">
-	<id>instanceid</id>
-	<username>username</username>
-	<password>password</password>
-    </remoteInstance-->
-
-    <staticConfiguration>
-        <versioningProperties>true</versioningProperties>
-        <versioningComments>true</versioningComments>
-        <versioningTags>true</versioningTags>
-        <versioningRatings>true</versioningRatings>
-        <!-- Location you want to add service and default location will be /governance/services/ -->
-        <servicePath>/test_services</servicePath>
-    </staticConfiguration>
-		
-
-    <versionResourcesOnChange>true</versionResourcesOnChange>
-
-</wso2registry>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/adv-jdbc-readonly-test.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/adv-jdbc-readonly-test.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/adv-jdbc-readonly-test.xml
deleted file mode 100644
index 814e33f..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/adv-jdbc-readonly-test.xml
+++ /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.
- -->
-<UserManager>
-    <Realm>
-        <Configuration>
-            <AdminRole>adminx</AdminRole>
-            <AdminUser>
-                <UserName>adminx</UserName>
-                <Password>adminy</Password>
-            </AdminUser>
-            <EveryOneRoleName>everyonex</EveryOneRoleName>
-            <ReadOnly>true</ReadOnly>
-	    <MaxUserNameListLength>500</MaxUserNameListLength>
-            <Property name="url">jdbc:h2:target/advjdbcrotest/CARBON_TEST</Property>
-            <Property name="driverName">org.h2.Driver</Property>
-            <Property name="maxActive">50</Property>
-            <Property name="maxWait">60000</Property>
-            <Property name="minIdle">5</Property>
-        </Configuration>
-        <UserStoreManager
-            class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
-             <Property name="url">jdbc:h2:target/advjdbcrotest/CARBON_TEST</Property>
-            <Property name="driverName">org.h2.Driver</Property>
-            <Property name="maxActive">50</Property>
-            <Property name="maxWait">60000</Property>
-            <Property name="minIdle">5</Property>
-            <Property name="PasswordDigest">MD5</Property>
-            <Property name="GetPasswordSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>
-            <Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>
-            <Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>
-            <Property name="PasswordDigest">MD5</Property>           
-        </UserStoreManager>
-        <AuthorizationManager
-            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager"></AuthorizationManager>
-    </Realm>
-</UserManager>
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/jdbc-readonly-test.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/jdbc-readonly-test.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/jdbc-readonly-test.xml
deleted file mode 100644
index cacb090..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/jdbc-readonly-test.xml
+++ /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.
- -->
-<UserManager>
-    <Realm>
-        <Configuration>
-            <AdminRole>adminx</AdminRole>
-            <AdminUser>
-                <UserName>adminx</UserName>
-                <Password>adminy</Password>
-            </AdminUser>
-            <SystemUserName>system</SystemUserName>
-            <EveryOneRoleName>everyonex</EveryOneRoleName>
-            <ReadOnly>true</ReadOnly>
-            <MaxUserNameListLength>500</MaxUserNameListLength>
-            <Property name="url">jdbc:h2:target/ReadOnlyTest/CARBON_TEST</Property>
-            <Property name="driverName">org.h2.Driver</Property>
-            <Property name="maxActive">50</Property>
-            <Property name="maxWait">60000</Property>
-            <Property name="minIdle">5</Property>
-        </Configuration>
-        <UserStoreManager
-            class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
-            <Property name="url">jdbc:h2:target/ReadOnlyTest/CARBON_TEST</Property>
-            <Property name="driverName">org.h2.Driver</Property>
-            <Property name="maxActive">50</Property>
-            <Property name="maxWait">60000</Property>
-            <Property name="minIdle">5</Property>
-            <Property name="PasswordDigest">MD5</Property>
-            <Property name="GetPasswordSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>
-            <Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>
-            <Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>
-            <Property name="PasswordDigest">SHA-256</Property>           
-        </UserStoreManager>
-        <AuthorizationManager
-            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager"></AuthorizationManager>
-    </Realm>
-</UserManager>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/user-mgt-registry-test.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/user-mgt-registry-test.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/user-mgt-registry-test.xml
deleted file mode 100644
index 2fd442a..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/user-mgt-registry-test.xml
+++ /dev/null
@@ -1,94 +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.
- -->
-<UserManager>
-	<Realm>
-		<Configuration>
-			<AdminRole>admin</AdminRole>
-			<AdminUser>
-				<UserName>admin</UserName>
-				<Password>admin</Password>
-			</AdminUser>
-			<EveryOneRoleName>everyone</EveryOneRoleName>
-            <ReadOnly>false</ReadOnly>
-            <MaxUserNameListLength>500</MaxUserNameListLength>
-			<Property name="url">jdbc:h2:target/databasetest/CARBON_TEST</Property>
-			<Property name="driverName">org.h2.Driver</Property>
-			<Property name="maxActive">50</Property>
-			<Property name="maxWait">60000</Property>
-			<Property name="minIdle">5</Property>
-        </Configuration>
-        <UserStoreManager
-            class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
-            <Property name="PasswordJavaRegEx">[\S]{5,30}$</Property>
-            <Property name="PasswordJavaScriptRegEx">[\\S]{5,30}</Property>
-            <Property name="SelectUserSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>
-            <Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>
-            <Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>
-            <Property name="GetUserProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="GetUsersWithDefaultPasswordsSQL">SELECT UM_USER_NAME FROM UM_USER WHERE WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="UserNameUniqueAcrossTenantsSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
-            <Property name="GetUserIDFromUserNameSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetTenantIDFromUserNameSQL">SELECT UM_TENANT_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
-            <Property name="PasswordDigest">SHA-256</Property>
-            <Property name="StoreSaltedPassword">true</Property>
-            <Property name="UserNameUniqueAcrossTenants">false</Property>
-            <Property name="IsEmailUserName">false</Property>
-            <Property name="SuperDomain">wso2.com</Property>
-            <Property name="IsUsersOfRoleListing">true</Property>
-            <!-- writing sqls follow-->
-            <Property name="AddUserSQL">INSERT INTO UM_USER (UM_USER_NAME, UM_USER_PASSWORD, UM_SALT_VALUE, UM_REQUIRE_CHANGE, UM_CHANGED_TIME, UM_TENANT_ID) VALUES (?, ?, ?, ?, ?, ?)</Property>
-            <Property name="AddRoleSQL">INSERT INTO UM_ROLE (UM_ROLE_NAME, UM_TENANT_ID) VALUES (?, ?)</Property>
-            <Property name="AddUserToRoleSQL">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?), ?)</Property>
-            <Property name="AddUserToRoleSQL-mssql">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(?)</Property>
-            <Property name="RemoveUserFromRoleSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="AddRoleToUserSQL">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?)</Property>
-            <Property name="AddRoleToUserSQL-mssql">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?)</Property>
-            <Property name="RemoveRoleFromUserSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="DeleteRoleSQL">DELETE FROM UM_ROLE WHERE UM_ROLE_NAME = ? AND UM_TENANT_ID=?</Property>
-            <Property name="OnDeleteRoleRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="OnDeleteUserRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="OnDeleteUserRemoveUserAttributeSQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="DeleteUserSQL">DELETE FROM UM_USER WHERE UM_USER_NAME = ? AND UM_TENANT_ID=?</Property>
-            <Property name="UpdateUserPasswordSQL">UPDATE UM_USER SET UM_USER_PASSWORD= ?, UM_SALT_VALUE=?, UM_REQUIRE_CHANGE=?, UM_CHANGED_TIME=? WHERE UM_USER_NAME= ? AND UM_TENANT_ID=?</Property>
-            <Property name="AddUserPropertySQL">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?, ?, ?, ?)</Property>
-            <Property name="AddUserPropertySQL-mssql">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?), (?), (?), (?)</Property>
-            <Property name="UpdateUserPropertySQL">UPDATE UM_USER_ATTRIBUTE SET UM_ATTR_VALUE=? WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
-            <Property name="DeleteUserPropertySQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
-        </UserStoreManager>
-        <AuthorizationManager
-            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager"></AuthorizationManager>
-    </Realm>
-    <SystemPermission>
-        <Permission>login</Permission>
-        <Permission>manage-configuration</Permission>
-        <Permission>manage-security</Permission>
-        <Permission>upload-services</Permission>
-        <Permission>manage-services</Permission>
-        <Permission>manage-lc-configuration</Permission>
-        <Permission>manage-mediation</Permission>
-        <Permission>monitor-system</Permission>
-        <Permission>delegate-identity</Permission>
-    </SystemPermission>
-</UserManager>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/user-mgt-test.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/user-mgt-test.xml b/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/user-mgt-test.xml
deleted file mode 100644
index 5f5906d..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.manager/2.1.0/src/test/resources/user-test/user-mgt-test.xml
+++ /dev/null
@@ -1,95 +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.
- -->
-<UserManager>
-	<Realm>
-		<Configuration>
-			<AdminRole>admin</AdminRole>
-			<AdminUser>
-				<UserName>admin</UserName>
-				<Password>admin</Password>
-			</AdminUser>
-			<EveryOneRoleName>everyone</EveryOneRoleName>
-            <ReadOnly>false</ReadOnly>
-            <MaxUserNameListLength>500</MaxUserNameListLength>
-			<!-- Property name="url"> Different test cases must have different urls. 
-			Because creating the database in same directory while running TestCase after another gives errors in some architectures</Property-->
-			<Property name="driverName">org.h2.Driver</Property>
-			<Property name="maxActive">50</Property>
-			<Property name="maxWait">60000</Property>
-			<Property name="minIdle">5</Property>
-        </Configuration>
-        <UserStoreManager
-            class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
-            <Property name="PasswordJavaRegEx">[\S]{5,30}$</Property>
-            <Property name="PasswordJavaScriptRegEx">[\\S]{5,30}</Property>
-            <Property name="SelectUserSQL">SELECT * FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetRoleListSQL">SELECT UM_ROLE_NAME FROM UM_ROLE WHERE UM_TENANT_ID=?</Property>
-            <Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property>
-            <Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_USER.UM_USER_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="IsRoleExistingSQL">SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="IsUserExistingSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetUserListOfRoleSQL">SELECT UM_USER_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UM_ROLE.UM_ROLE_NAME=? AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetUserPropertyForProfileSQL">SELECT UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetUserPropertiesForProfileSQL">SELECT UM_ATTR_NAME, UM_ATTR_VALUE FROM UM_USER_ATTRIBUTE, UM_USER WHERE UM_USER.UM_ID = UM_USER_ATTRIBUTE.UM_USER_ID AND UM_USER.UM_USER_NAME=? AND UM_PROFILE_ID=? AND UM_USER_ATTRIBUTE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>
-            <Property name="GetProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_TENANT_ID=?</Property>
-            <Property name="GetUserProfileNamesSQL">SELECT DISTINCT UM_PROFILE_ID FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="GetUsersWithDefaultPasswordsSQL">SELECT UM_USER_NAME FROM UM_USER WHERE WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="UserNameUniqueAcrossTenantsSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
-            <Property name="GetUserIDFromUserNameSQL">SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?</Property>
-            <Property name="GetTenantIDFromUserNameSQL">SELECT UM_TENANT_ID FROM UM_USER WHERE UM_USER_NAME=?</Property>
-            <Property name="PasswordDigest">SHA-256</Property>
-            <Property name="StoreSaltedPassword">true</Property>
-            <Property name="UserNameUniqueAcrossTenants">false</Property>
-            <Property name="IsEmailUserName">false</Property>
-            <Property name="SuperDomain">wso2.com</Property>
-            <Property name="IsUsersOfRoleListing">true</Property>
-            <!-- writing sqls follow-->
-            <Property name="AddUserSQL">INSERT INTO UM_USER (UM_USER_NAME, UM_USER_PASSWORD, UM_SALT_VALUE, UM_REQUIRE_CHANGE, UM_CHANGED_TIME, UM_TENANT_ID) VALUES (?, ?, ?, ?, ?, ?)</Property>
-            <Property name="AddRoleSQL">INSERT INTO UM_ROLE (UM_ROLE_NAME, UM_TENANT_ID) VALUES (?, ?)</Property>
-            <Property name="AddUserToRoleSQL">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?), ?)</Property>
-            <Property name="AddUserToRoleSQL-mssql">INSERT INTO UM_USER_ROLE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(?)</Property>
-            <Property name="RemoveUserFromRoleSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="AddRoleToUserSQL">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?)</Property>
-            <Property name="AddRoleToUserSQL-mssql">INSERT INTO UM_USER_ROLE (UM_ROLE_ID, UM_USER_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?),(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?)</Property>
-            <Property name="RemoveRoleFromUserSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="DeleteRoleSQL">DELETE FROM UM_ROLE WHERE UM_ROLE_NAME = ? AND UM_TENANT_ID=?</Property>
-            <Property name="OnDeleteRoleRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_ROLE_ID=(SELECT UM_ID FROM UM_ROLE WHERE UM_ROLE_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="OnDeleteUserRemoveUserRoleMappingSQL">DELETE FROM UM_USER_ROLE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="OnDeleteUserRemoveUserAttributeSQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_TENANT_ID=?</Property>
-            <Property name="DeleteUserSQL">DELETE FROM UM_USER WHERE UM_USER_NAME = ? AND UM_TENANT_ID=?</Property>
-            <Property name="UpdateUserPasswordSQL">UPDATE UM_USER SET UM_USER_PASSWORD= ?, UM_SALT_VALUE=?, UM_REQUIRE_CHANGE=?, UM_CHANGED_TIME=? WHERE UM_USER_NAME= ? AND UM_TENANT_ID=?</Property>
-            <Property name="AddUserPropertySQL">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) VALUES ((SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), ?, ?, ?, ?)</Property>
-            <Property name="AddUserPropertySQL-mssql">INSERT INTO UM_USER_ATTRIBUTE (UM_USER_ID, UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_ID, UM_TENANT_ID) SELECT (SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?), (?), (?), (?), (?)</Property>
-            <Property name="UpdateUserPropertySQL">UPDATE UM_USER_ATTRIBUTE SET UM_ATTR_VALUE=? WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
-            <Property name="DeleteUserPropertySQL">DELETE FROM UM_USER_ATTRIBUTE WHERE UM_USER_ID=(SELECT UM_ID FROM UM_USER WHERE UM_USER_NAME=? AND UM_TENANT_ID=?) AND UM_ATTR_NAME=? AND UM_PROFILE_ID=? AND UM_TENANT_ID=?</Property>
-        </UserStoreManager>
-        <AuthorizationManager
-            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager"></AuthorizationManager>
-    </Realm>
-    <SystemPermission>
-        <Permission>login</Permission>
-        <Permission>manage-configuration</Permission>
-        <Permission>manage-security</Permission>
-        <Permission>upload-services</Permission>
-        <Permission>manage-services</Permission>
-        <Permission>manage-lc-configuration</Permission>
-        <Permission>manage-mediation</Permission>
-        <Permission>monitor-system</Permission>
-        <Permission>delegate-identity</Permission>
-    </SystemPermission>
-</UserManager>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/pom.xml b/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/pom.xml
deleted file mode 100644
index cfec94b..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/pom.xml
+++ /dev/null
@@ -1,120 +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>throttling-parent</artifactId>
-        <version>2.1.0</version>
-<relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.wso2.carbon.throttling.ui</artifactId>
-    <packaging>bundle</packaging>
-    <name>WSO2 Stratos - Throttling - User Interface</name>
-
-    <build>
-		<plugins>
-		    <plugin>
-		        <groupId>org.apache.felix</groupId>
-		        <artifactId>maven-bundle-plugin</artifactId>
-		        
-		        <extensions>true</extensions>
-		        <configuration>
-		            <instructions>
-		                <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-		                <Bundle-Name>${project.artifactId}</Bundle-Name>
-		                <Export-Package>
-		                    org.wso2.carbon.throttling.ui.*,
-		                </Export-Package>
-		                <Import-Package>
-		                	org.wso2.carbon.throttling.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>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.core</artifactId>
-            <version>${carbon.platform.version}</version>
-        </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>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.core</artifactId>
-            <version>${carbon.platform.version}</version>
-        </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.throttling.stub</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/java/org/wso2/carbon/throttling/ui/clients/ThrottlingRuleEditorClient.java
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/java/org/wso2/carbon/throttling/ui/clients/ThrottlingRuleEditorClient.java b/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/java/org/wso2/carbon/throttling/ui/clients/ThrottlingRuleEditorClient.java
deleted file mode 100644
index e487649..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/java/org/wso2/carbon/throttling/ui/clients/ThrottlingRuleEditorClient.java
+++ /dev/null
@@ -1,97 +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.throttling.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.throttling.stub.services.ThrottlingRuleEditorServiceStub;
-import org.wso2.carbon.ui.CarbonUIUtil;
-import org.wso2.carbon.utils.ServerConstants;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.http.HttpSession;
-
-public class ThrottlingRuleEditorClient {
-    private static final Log log = LogFactory.getLog(ThrottlingRuleEditorClient.class);
-
-    private ThrottlingRuleEditorServiceStub stub;
-    private String epr;
-
-    public ThrottlingRuleEditorClient(String cookie, String backendServerURL,
-            ConfigurationContext configContext) throws RegistryException {
-
-        epr = backendServerURL + "ThrottlingRuleEditorService";
-
-        try {
-            stub = new ThrottlingRuleEditorServiceStub(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 throttling rule editor service client. " +
-                            axisFault.getMessage();
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-    public ThrottlingRuleEditorClient(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 + "ThrottlingRuleEditorService";
-
-        try {
-            stub = new ThrottlingRuleEditorServiceStub(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 throttling rule editor service client. " +
-                            axisFault.getMessage();
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-    public String retrieveThrottlingRules() throws Exception {
-        return stub.retrieveThrottlingRules();
-    }
-
-    public void updateThrottlingRules(String ruleContent) throws Exception {
-        stub.updateThrottlingRules(ruleContent);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/META-INF/component.xml b/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/META-INF/component.xml
deleted file mode 100644
index 2f7b5c4..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/META-INF/component.xml
+++ /dev/null
@@ -1,36 +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>multitenancy_throttling_menu</id>
-            <i18n-key>throttling.menu.key</i18n-key>
-            <i18n-bundle>org.wso2.carbon.throttling.ui.i18n.Resources</i18n-bundle>
-            <parent-menu>configure_menu</parent-menu>
-            <link>../mt-throttling/throttling.jsp</link>
-            <region>region1</region>
-            <order>8</order>
-            <style-class>manage</style-class>
-            <icon>../mt-throttling/images/throttling.gif</icon>
-            <require-permission>/permission/protected/configure/throttling-rules</require-permission>
-            <require-super-tenant>true</require-super-tenant>
-        </menu>
-    </menus>
-
-</component>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/ThrottlingRuleEditorService.wsdl
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/ThrottlingRuleEditorService.wsdl b/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/ThrottlingRuleEditorService.wsdl
deleted file mode 100644
index a9f511a..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/ThrottlingRuleEditorService.wsdl
+++ /dev/null
@@ -1,148 +0,0 @@
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://services.manager.throttling.carbon.wso2.org" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://services.manager.throttling.carbon.wso2.org">
-    <wsdl:documentation>ThrottlingRuleEditorService</wsdl:documentation>
-    <wsdl:types>
-        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.manager.throttling.carbon.wso2.org">
-            <xs:element name="updateThrottlingRulesException">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="updateThrottlingRulesException" nillable="true" type="ns:Exception" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:complexType name="Exception">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string" />
-                </xs:sequence>
-            </xs:complexType>
-            <xs:element name="updateThrottlingRules">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="ruleContent" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="retrieveThrottlingRulesException">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="retrieveThrottlingRulesException" nillable="true" type="ns:Exception" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="retrieveThrottlingRules">
-                <xs:complexType>
-                    <xs:sequence />
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="retrieveThrottlingRulesResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-        </xs:schema>
-    </wsdl:types>
-    <wsdl:message name="updateThrottlingRulesRequest">
-        <wsdl:part name="parameters" element="ns:updateThrottlingRules" />
-    </wsdl:message>
-    <wsdl:message name="updateThrottlingRulesException">
-        <wsdl:part name="parameters" element="ns:updateThrottlingRulesException" />
-    </wsdl:message>
-    <wsdl:message name="retrieveThrottlingRulesRequest">
-        <wsdl:part name="parameters" element="ns:retrieveThrottlingRules" />
-    </wsdl:message>
-    <wsdl:message name="retrieveThrottlingRulesResponse">
-        <wsdl:part name="parameters" element="ns:retrieveThrottlingRulesResponse" />
-    </wsdl:message>
-    <wsdl:message name="retrieveThrottlingRulesException">
-        <wsdl:part name="parameters" element="ns:retrieveThrottlingRulesException" />
-    </wsdl:message>
-    <wsdl:portType name="ThrottlingRuleEditorServicePortType">
-        <wsdl:operation name="updateThrottlingRules">
-            <wsdl:input message="ns:updateThrottlingRulesRequest" wsaw:Action="urn:updateThrottlingRules" />
-            <wsdl:fault message="ns:updateThrottlingRulesException" name="updateThrottlingRulesException" wsaw:Action="urn:updateThrottlingRulesupdateThrottlingRulesException" />
-        </wsdl:operation>
-        <wsdl:operation name="retrieveThrottlingRules">
-            <wsdl:input message="ns:retrieveThrottlingRulesRequest" wsaw:Action="urn:retrieveThrottlingRules" />
-            <wsdl:output message="ns:retrieveThrottlingRulesResponse" wsaw:Action="urn:retrieveThrottlingRulesResponse" />
-            <wsdl:fault message="ns:retrieveThrottlingRulesException" name="retrieveThrottlingRulesException" wsaw:Action="urn:retrieveThrottlingRulesretrieveThrottlingRulesException" />
-        </wsdl:operation>
-    </wsdl:portType>
-    <wsdl:binding name="ThrottlingRuleEditorServiceSoap11Binding" type="ns:ThrottlingRuleEditorServicePortType">
-        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
-        <wsdl:operation name="updateThrottlingRules">
-            <soap:operation soapAction="urn:updateThrottlingRules" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:fault name="updateThrottlingRulesException">
-                <soap:fault use="literal" name="updateThrottlingRulesException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="retrieveThrottlingRules">
-            <soap:operation soapAction="urn:retrieveThrottlingRules" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="retrieveThrottlingRulesException">
-                <soap:fault use="literal" name="retrieveThrottlingRulesException" />
-            </wsdl:fault>
-        </wsdl:operation>
-    </wsdl:binding>
-    <wsdl:binding name="ThrottlingRuleEditorServiceSoap12Binding" type="ns:ThrottlingRuleEditorServicePortType">
-        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
-        <wsdl:operation name="updateThrottlingRules">
-            <soap12:operation soapAction="urn:updateThrottlingRules" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:fault name="updateThrottlingRulesException">
-                <soap12:fault use="literal" name="updateThrottlingRulesException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="retrieveThrottlingRules">
-            <soap12:operation soapAction="urn:retrieveThrottlingRules" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="retrieveThrottlingRulesException">
-                <soap12:fault use="literal" name="retrieveThrottlingRulesException" />
-            </wsdl:fault>
-        </wsdl:operation>
-    </wsdl:binding>
-    <wsdl:binding name="ThrottlingRuleEditorServiceHttpBinding" type="ns:ThrottlingRuleEditorServicePortType">
-        <http:binding verb="POST" />
-        <wsdl:operation name="updateThrottlingRules">
-            <http:operation location="updateThrottlingRules" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-        </wsdl:operation>
-        <wsdl:operation name="retrieveThrottlingRules">
-            <http:operation location="retrieveThrottlingRules" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-    </wsdl:binding>
-    <wsdl:service name="ThrottlingRuleEditorService">
-        <wsdl:port name="ThrottlingRuleEditorServiceHttpsSoap11Endpoint" binding="ns:ThrottlingRuleEditorServiceSoap11Binding">
-            <soap:address location="https://192.168.1.100:9443/services/ThrottlingRuleEditorService.ThrottlingRuleEditorServiceHttpsSoap11Endpoint/" />
-        </wsdl:port>
-        <wsdl:port name="ThrottlingRuleEditorServiceHttpsSoap12Endpoint" binding="ns:ThrottlingRuleEditorServiceSoap12Binding">
-            <soap12:address location="https://192.168.1.100:9443/services/ThrottlingRuleEditorService.ThrottlingRuleEditorServiceHttpsSoap12Endpoint/" />
-        </wsdl:port>
-        <wsdl:port name="ThrottlingRuleEditorServiceHttpsEndpoint" binding="ns:ThrottlingRuleEditorServiceHttpBinding">
-            <http:address location="https://192.168.1.100:9443/services/ThrottlingRuleEditorService.ThrottlingRuleEditorServiceHttpsEndpoint/" />
-        </wsdl:port>
-    </wsdl:service>
-</wsdl:definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/org/wso2/carbon/throttling/ui/i18n/JSResources.properties
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/org/wso2/carbon/throttling/ui/i18n/JSResources.properties b/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/org/wso2/carbon/throttling/ui/i18n/JSResources.properties
deleted file mode 100644
index bf90999..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/org/wso2/carbon/throttling/ui/i18n/JSResources.properties
+++ /dev/null
@@ -1 +0,0 @@
-empty=To make sure the js properties file is not empty

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/org/wso2/carbon/throttling/ui/i18n/Resources.properties
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/org/wso2/carbon/throttling/ui/i18n/Resources.properties b/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/org/wso2/carbon/throttling/ui/i18n/Resources.properties
deleted file mode 100644
index d74f234..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/org/wso2/carbon/throttling/ui/i18n/Resources.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-throttling.menu.key=Throttling
-throttling.rules=Throttling Rules
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/docs/images/add-org.png
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/docs/images/add-org.png b/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/docs/images/add-org.png
deleted file mode 100644
index fc710f8..0000000
Binary files a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/docs/images/add-org.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/767082e3/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/docs/userguide.html
----------------------------------------------------------------------
diff --git a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/docs/userguide.html b/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/docs/userguide.html
deleted file mode 100644
index c5fb241..0000000
--- a/components/stratos/throttling/org.wso2.carbon.throttling.ui/2.1.0/src/main/resources/web/mt-throttling/docs/userguide.html
+++ /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.
- -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-  <title>Multitenancy Throttling Rules Editor - User Guide</title>
-  <link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all" />
-</head>
-
-<body>
-<h1>Multitenancy Throttling Rules Editor</h1>
-
-<p>
-This editor allows you to edit the rules and update it. The changes to the rules get effected immediately 
-after you press the 'Update' button. 
-</p>
-
-</body>
-
-</html>

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