From 7260cbcc748042f80fa14e5cda1d13c324083af2 Mon Sep 17 00:00:00 2001
From: Manula Thantriwatte <manulac@wso2.com>
Date: Fri, 12 Jul 2013 18:21:22 +0530
Subject: [PATCH 1/2] Refactor throttling agent stub

---
 .../pom.xml                                        |  116 ++++++++++++++++++++
 .../resources/MultitenancyThrottlingService.wsdl   |   82 ++++++++++++++
 .../4.1.0/pom.xml                                  |  113 -------------------
 .../resources/MultitenancyThrottlingService.wsdl   |   82 --------------
 4 files changed, 198 insertions(+), 195 deletions(-)
 create mode 100644 service-stubs/org.apache.stratos.throttling.agent.stub/pom.xml
 create mode 100644 service-stubs/org.apache.stratos.throttling.agent.stub/src/main/resources/MultitenancyThrottlingService.wsdl
 delete mode 100644 service-stubs/org.wso2.carbon.throttling.agent.stub/4.1.0/pom.xml
 delete mode 100644 service-stubs/org.wso2.carbon.throttling.agent.stub/4.1.0/src/main/resources/MultitenancyThrottlingService.wsdl

diff --git a/service-stubs/org.apache.stratos.throttling.agent.stub/pom.xml b/service-stubs/org.apache.stratos.throttling.agent.stub/pom.xml
new file mode 100644
index 0000000..01da0f5
--- /dev/null
+++ b/service-stubs/org.apache.stratos.throttling.agent.stub/pom.xml
@@ -0,0 +1,116 @@
+<?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-service-stubs-parent</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.apache.stratos.throttling.agent.stub</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache Stratos - Throttling Agent Stub</name>
+    <url>http://apache.org</url>
+
+    <build>
+        <plugins>
+            
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.1</version>
+                <executions>
+                    <execution>
+                        <id>source-code-generation</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+                                    <arg line="-uri src/main/resources/MultitenancyThrottlingService.wsdl -u -uw -o target/generated-code -p org.apache.stratos.throttling.agent.stub.services -ns2p http://services.manager.throttling.stratos.apache.org=org.apache.stratos.throttling.agent.stub.services" />
+                                    <classpath refid="maven.dependency.classpath"/>
+                                    <classpath refid="maven.compile.classpath"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                </java>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </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.agent.stub.*; version="${carbon.platform.package.export.version}",
+                        </Export-Package>
+                        <Import-Package>
+			    !org.apache.stratos.throttling.agent.stub.*,
+                            *;resolution:=optional
+                        </Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>add-source</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>
+                                    target/generated-code/src
+                                </source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.axis2.wso2</groupId>
+            <artifactId>axis2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2.wso2</groupId>
+            <artifactId>axis2-client</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/service-stubs/org.apache.stratos.throttling.agent.stub/src/main/resources/MultitenancyThrottlingService.wsdl b/service-stubs/org.apache.stratos.throttling.agent.stub/src/main/resources/MultitenancyThrottlingService.wsdl
new file mode 100644
index 0000000..40238b1
--- /dev/null
+++ b/service-stubs/org.apache.stratos.throttling.agent.stub/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.stratos.apache.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.stratos.apache.org">
+    <wsdl:documentation>MultitenancyThrottlingService</wsdl:documentation>
+    <wsdl:types>
+        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.manager.throttling.stratos.apache.org">
+            <xs:element name="MultitenancyThrottlingServiceException">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="MultitenancyThrottlingServiceException" 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="MultitenancyThrottlingServiceException">
+        <wsdl:part name="parameters" element="ns:MultitenancyThrottlingServiceException"/>
+    </wsdl:message>
+    <wsdl:portType name="MultitenancyThrottlingServicePortType">
+        <wsdl:operation name="executeThrottlingRules">
+            <wsdl:input message="ns:executeThrottlingRulesRequest" wsaw:Action="urn:executeThrottlingRules"/>
+            <wsdl:fault message="ns:MultitenancyThrottlingServiceException" name="MultitenancyThrottlingServiceException" wsaw:Action="urn:executeThrottlingRulesMultitenancyThrottlingServiceException"/>
+        </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="MultitenancyThrottlingServiceException">
+                <soap:fault use="literal" name="MultitenancyThrottlingServiceException"/>
+            </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="MultitenancyThrottlingServiceException">
+                <soap12:fault use="literal" name="MultitenancyThrottlingServiceException"/>
+            </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://10.100.2.80:9443/services/MultitenancyThrottlingService.MultitenancyThrottlingServiceHttpsSoap11Endpoint/"/>
+        </wsdl:port>
+        <wsdl:port name="MultitenancyThrottlingServiceHttpsSoap12Endpoint" binding="ns:MultitenancyThrottlingServiceSoap12Binding">
+            <soap12:address location="https://10.100.2.80:9443/services/MultitenancyThrottlingService.MultitenancyThrottlingServiceHttpsSoap12Endpoint/"/>
+        </wsdl:port>
+        <wsdl:port name="MultitenancyThrottlingServiceHttpsEndpoint" binding="ns:MultitenancyThrottlingServiceHttpBinding">
+            <http:address location="https://10.100.2.80:9443/services/MultitenancyThrottlingService.MultitenancyThrottlingServiceHttpsEndpoint/"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
diff --git a/service-stubs/org.wso2.carbon.throttling.agent.stub/4.1.0/pom.xml b/service-stubs/org.wso2.carbon.throttling.agent.stub/4.1.0/pom.xml
deleted file mode 100644
index 650c041..0000000
--- a/service-stubs/org.wso2.carbon.throttling.agent.stub/4.1.0/pom.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (c) 2005-2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. licenses this file to you under the Apache License,
- ~ Version 2.0 (the "License"); you may not use this file except
- ~ in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~    http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied.  See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-<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>carbon-service-stubs</artifactId>
-        <version>4.1.0</version>
-		<relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.wso2.carbon.throttling.agent.stub</artifactId>
-    <packaging>bundle</packaging>
-   	<version>4.1.0</version>
-    <name>WSO2 Carbon - Throttling Agent Stub</name>
-    <url>http://wso2.org</url>
-
-    <build>
-        <plugins>
-            
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <version>1.1</version>
-                <executions>
-                    <execution>
-                        <id>source-code-generation</id>
-                        <phase>process-resources</phase>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                        <configuration>
-                            <tasks>
-                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
-                                    <arg line="-uri src/main/resources/MultitenancyThrottlingService.wsdl -u -uw -o target/generated-code -p org.wso2.carbon.throttling.agent.stub.services -ns2p http://services.manager.throttling.carbon.wso2.org=org.wso2.carbon.throttling.agent.stub.services" />
-                                    <classpath refid="maven.dependency.classpath"/>
-                                    <classpath refid="maven.compile.classpath"/>
-                                    <classpath refid="maven.runtime.classpath"/>
-                                </java>
-                            </tasks>
-                        </configuration>
-                    </execution>
-                </executions>
-            </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.agent.stub.*; version="${carbon.platform.package.export.version}",
-                        </Export-Package>
-                        <Import-Package>
-			    			!org.wso2.carbon.throttling.agent.stub.*,
-                            *;resolution:=optional
-                        </Import-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>add-source</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>add-source</goal>
-                        </goals>
-                        <configuration>
-                            <sources>
-                                <source>
-                                    target/generated-code/src
-                                </source>
-                            </sources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.axis2.wso2</groupId>
-            <artifactId>axis2</artifactId>
-        </dependency>
-    </dependencies>
-
-</project>
diff --git a/service-stubs/org.wso2.carbon.throttling.agent.stub/4.1.0/src/main/resources/MultitenancyThrottlingService.wsdl b/service-stubs/org.wso2.carbon.throttling.agent.stub/4.1.0/src/main/resources/MultitenancyThrottlingService.wsdl
deleted file mode 100644
index 6386fc2..0000000
--- a/service-stubs/org.wso2.carbon.throttling.agent.stub/4.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="MultitenancyThrottlingServiceException">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="MultitenancyThrottlingServiceException" 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="MultitenancyThrottlingServiceException">
-        <wsdl:part name="parameters" element="ns:MultitenancyThrottlingServiceException"/>
-    </wsdl:message>
-    <wsdl:portType name="MultitenancyThrottlingServicePortType">
-        <wsdl:operation name="executeThrottlingRules">
-            <wsdl:input message="ns:executeThrottlingRulesRequest" wsaw:Action="urn:executeThrottlingRules"/>
-            <wsdl:fault message="ns:MultitenancyThrottlingServiceException" name="MultitenancyThrottlingServiceException" wsaw:Action="urn:executeThrottlingRulesMultitenancyThrottlingServiceException"/>
-        </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="MultitenancyThrottlingServiceException">
-                <soap:fault use="literal" name="MultitenancyThrottlingServiceException"/>
-            </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="MultitenancyThrottlingServiceException">
-                <soap12:fault use="literal" name="MultitenancyThrottlingServiceException"/>
-            </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://10.100.2.80:9443/services/MultitenancyThrottlingService.MultitenancyThrottlingServiceHttpsSoap11Endpoint/"/>
-        </wsdl:port>
-        <wsdl:port name="MultitenancyThrottlingServiceHttpsSoap12Endpoint" binding="ns:MultitenancyThrottlingServiceSoap12Binding">
-            <soap12:address location="https://10.100.2.80:9443/services/MultitenancyThrottlingService.MultitenancyThrottlingServiceHttpsSoap12Endpoint/"/>
-        </wsdl:port>
-        <wsdl:port name="MultitenancyThrottlingServiceHttpsEndpoint" binding="ns:MultitenancyThrottlingServiceHttpBinding">
-            <http:address location="https://10.100.2.80:9443/services/MultitenancyThrottlingService.MultitenancyThrottlingServiceHttpsEndpoint/"/>
-        </wsdl:port>
-    </wsdl:service>
-</wsdl:definitions>
\ No newline at end of file
-- 
1.7.9.5

