knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From su...@apache.org
Subject [11/14] knox git commit: renamed service xml elements and attributes as per review KNOX-483
Date Tue, 27 Jan 2015 16:26:37 GMT
renamed service xml elements and attributes as per review KNOX-483


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

Branch: refs/heads/KNOX-481
Commit: c12397039a1bf6d5d53bb4eb2e80dfd12f564115
Parents: 6742302
Author: Sumit Gupta <sumit@apache.org>
Authored: Wed Jan 21 15:52:15 2015 -0500
Committer: Sumit Gupta <sumit@apache.org>
Committed: Tue Jan 27 11:25:21 2015 -0500

----------------------------------------------------------------------
 .../ServiceDefinitionDeploymentContributor.java | 24 +++----
 .../gateway/service/definition/Policy.java      | 45 ++++++++++++
 .../service/definition/PolicyBinding.java       | 45 ------------
 .../gateway/service/definition/Rewrite.java     | 47 +++++++++++++
 .../service/definition/RewriteFilter.java       | 47 -------------
 .../gateway/service/definition/Route.java       | 73 ++++++++++++++++++++
 .../service/definition/ServiceDefinition.java   | 24 +++----
 .../gateway/service/definition/UrlBinding.java  | 73 --------------------
 .../resources/services/hbase/0.98.0/service.xml | 28 ++++----
 .../resources/services/hive/0.13.0/service.xml  |  6 +-
 .../resources/services/oozie/4.0.0/service.xml  | 22 +++---
 .../services/webhcat/0.13.0/service.xml         |  8 +--
 .../services/webhdfs/2.4.0/service.xml          | 38 +++++-----
 .../services/yarn-rm/2.5.0/service.xml          | 70 +++++++++----------
 .../definition/ServiceDefinitionTest.java       |  6 +-
 15 files changed, 278 insertions(+), 278 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/ServiceDefinitionDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/ServiceDefinitionDeploymentContributor.java
b/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/ServiceDefinitionDeploymentContributor.java
index f31b08a..7220cdd 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/ServiceDefinitionDeploymentContributor.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/ServiceDefinitionDeploymentContributor.java
@@ -74,13 +74,13 @@ public class ServiceDefinitionDeploymentContributor extends ServiceDeploymentCon
 
   private void contributeResources(DeploymentContext context, Service service) {
     Map<String, String> filterParams = new HashMap<String, String>();
-    List<UrlBinding> bindings = serviceDefinition.getUrlBindings();
-    for ( UrlBinding binding : bindings ) {
-      List<RewriteFilter> filters = binding.getRewriteFilters();
+    List<Route> bindings = serviceDefinition.getRoutes();
+    for ( Route binding : bindings ) {
+      List<Rewrite> filters = binding.getRewrites();
       if ( filters != null && !filters.isEmpty() ) {
         filterParams.clear();
-        for ( RewriteFilter filter : filters ) {
-          filterParams.put(filter.getApplyTo(), filter.getRef());
+        for ( Rewrite filter : filters ) {
+          filterParams.put(filter.getTo(), filter.getApply());
         }
       }
       try {
@@ -92,14 +92,14 @@ public class ServiceDefinitionDeploymentContributor extends ServiceDeploymentCon
 
   }
 
-  private void contributeResource(DeploymentContext context, Service service, UrlBinding
binding, Map<String, String> filterParams) throws URISyntaxException {
+  private void contributeResource(DeploymentContext context, Service service, Route binding,
Map<String, String> filterParams) throws URISyntaxException {
     List<FilterParamDescriptor> params = new ArrayList<FilterParamDescriptor>();
     ResourceDescriptor resource = context.getGatewayDescriptor().addResource();
     resource.role(service.getRole());
-    resource.pattern(binding.getPattern());
-    List<PolicyBinding> policyBindings = binding.getPolicyBindings();
+    resource.pattern(binding.getPath());
+    List<Policy> policyBindings = binding.getPolicies();
     if (policyBindings == null) {
-      policyBindings = serviceDefinition.getPolicyBindings();
+      policyBindings = serviceDefinition.getPolicies();
     }
     if (policyBindings == null) {
       //add default set
@@ -110,8 +110,8 @@ public class ServiceDefinitionDeploymentContributor extends ServiceDeploymentCon
     addDispatchFilter(context, service, resource, binding);
   }
 
-  private void addPolicies(DeploymentContext context, Service service, Map<String, String>
filterParams, List<FilterParamDescriptor> params, ResourceDescriptor resource, List<PolicyBinding>
policyBindings) throws URISyntaxException {
-    for (PolicyBinding policyBinding : policyBindings) {
+  private void addPolicies(DeploymentContext context, Service service, Map<String, String>
filterParams, List<FilterParamDescriptor> params, ResourceDescriptor resource, List<Policy>
policyBindings) throws URISyntaxException {
+    for (Policy policyBinding : policyBindings) {
       String role = policyBinding.getRole();
       if (role == null) {
         throw new IllegalArgumentException("Policy defined has no role for service " + service.getName());
@@ -142,7 +142,7 @@ public class ServiceDefinitionDeploymentContributor extends ServiceDeploymentCon
     addRewriteFilter(context, service, resource, params);
   }
 
-  private void addDispatchFilter(DeploymentContext context, Service service, ResourceDescriptor
resource, UrlBinding binding) {
+  private void addDispatchFilter(DeploymentContext context, Service service, ResourceDescriptor
resource, Route binding) {
     CustomDispatch customDispatch = binding.getDispatch();
     if ( customDispatch == null ) {
       customDispatch = serviceDefinition.getDispatch();

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/Policy.java
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/Policy.java
b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/Policy.java
new file mode 100644
index 0000000..471aae5
--- /dev/null
+++ b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/Policy.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.hadoop.gateway.service.definition;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+public class Policy {
+
+  private String name;
+
+  private String role;
+
+  @XmlAttribute
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  @XmlAttribute
+  public String getRole() {
+    return role;
+  }
+
+  public void setRole(String role) {
+    this.role = role;
+  }
+}

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/PolicyBinding.java
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/PolicyBinding.java
b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/PolicyBinding.java
deleted file mode 100644
index d87674f..0000000
--- a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/PolicyBinding.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 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.hadoop.gateway.service.definition;
-
-import javax.xml.bind.annotation.XmlAttribute;
-
-public class PolicyBinding {
-
-  private String name;
-
-  private String role;
-
-  @XmlAttribute
-  public String getName() {
-    return name;
-  }
-
-  public void setName(String name) {
-    this.name = name;
-  }
-
-  @XmlAttribute
-  public String getRole() {
-    return role;
-  }
-
-  public void setRole(String role) {
-    this.role = role;
-  }
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/Rewrite.java
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/Rewrite.java
b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/Rewrite.java
new file mode 100644
index 0000000..a7a3e3c
--- /dev/null
+++ b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/Rewrite.java
@@ -0,0 +1,47 @@
+/**
+ * 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.hadoop.gateway.service.definition;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(name = "rewrite")
+public class Rewrite {
+
+  private String apply;
+
+  private String to;
+
+  @XmlAttribute
+  public String getApply() {
+    return apply;
+  }
+
+  public void setApply(String apply) {
+    this.apply = apply;
+  }
+
+  @XmlAttribute
+  public String getTo() {
+    return to;
+  }
+
+  public void setTo(String to) {
+    this.to = to;
+  }
+}

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/RewriteFilter.java
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/RewriteFilter.java
b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/RewriteFilter.java
deleted file mode 100644
index 4b0dccc..0000000
--- a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/RewriteFilter.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * 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.hadoop.gateway.service.definition;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlType(name = "rewrite-filter")
-public class RewriteFilter {
-
-  private String ref;
-
-  private String applyTo;
-
-  @XmlAttribute
-  public String getRef() {
-    return ref;
-  }
-
-  public void setRef(String ref) {
-    this.ref = ref;
-  }
-
-  @XmlAttribute(name = "apply-to")
-  public String getApplyTo() {
-    return applyTo;
-  }
-
-  public void setApplyTo(String applyTo) {
-    this.applyTo = applyTo;
-  }
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/Route.java
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/Route.java
b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/Route.java
new file mode 100644
index 0000000..7112c2e
--- /dev/null
+++ b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/Route.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.hadoop.gateway.service.definition;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+import java.util.List;
+
+@XmlType(name = "route")
+public class Route {
+
+  private String path;
+
+  private List<Rewrite> rewrites;
+
+  private List<Policy> policies;
+
+  private CustomDispatch dispatch;
+
+  @XmlAttribute
+  public String getPath() {
+    return path;
+  }
+
+  public void setPath(String path) {
+    this.path = path;
+  }
+
+  @XmlElement(name = "rewrite")
+  public List<Rewrite> getRewrites() {
+    return rewrites;
+  }
+
+  public void setRewrites(List<Rewrite> rewrites) {
+    this.rewrites = rewrites;
+  }
+
+  @XmlElement(name = "policy")
+  @XmlElementWrapper(name = "policies")
+  public List<Policy> getPolicies() {
+    return policies;
+  }
+
+  public void setPolicies(List<Policy> policies) {
+    this.policies = policies;
+  }
+
+  @XmlElement(name = "dispatch")
+  public CustomDispatch getDispatch() {
+    return dispatch;
+  }
+
+  public void setDispatch(CustomDispatch dispatch) {
+    this.dispatch = dispatch;
+  }
+}

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/ServiceDefinition.java
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/ServiceDefinition.java
b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/ServiceDefinition.java
index 682f2fc..cbb9309 100644
--- a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/ServiceDefinition.java
+++ b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/ServiceDefinition.java
@@ -32,9 +32,9 @@ public class ServiceDefinition {
 
   private String version;
 
-  private List<UrlBinding> urlBindings;
+  private List<Route> routes;
 
-  private List<PolicyBinding> policyBindings;
+  private List<Policy> policies;
 
   private CustomDispatch dispatch;
 
@@ -65,24 +65,24 @@ public class ServiceDefinition {
     this.version = version;
   }
 
-  @XmlElement(name = "url")
-  @XmlElementWrapper(name = "urls")
-  public List<UrlBinding> getUrlBindings() {
-    return urlBindings;
+  @XmlElement(name = "route")
+  @XmlElementWrapper(name = "routes")
+  public List<Route> getRoutes() {
+    return routes;
   }
 
-  public void setUrlBindings(List<UrlBinding> urlBindings) {
-    this.urlBindings = urlBindings;
+  public void setRoutes(List<Route> routes) {
+    this.routes = routes;
   }
 
   @XmlElement(name = "policy")
   @XmlElementWrapper(name = "policies")
-  public List<PolicyBinding> getPolicyBindings() {
-    return policyBindings;
+  public List<Policy> getPolicies() {
+    return policies;
   }
 
-  public void setPolicyBindings(List<PolicyBinding> policyBindings) {
-    this.policyBindings = policyBindings;
+  public void setPolicies(List<Policy> policies) {
+    this.policies = policies;
   }
 
   @XmlElement(name = "dispatch")

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/UrlBinding.java
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/UrlBinding.java
b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/UrlBinding.java
deleted file mode 100644
index a1b7718..0000000
--- a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/UrlBinding.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * 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.hadoop.gateway.service.definition;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlType;
-import java.util.List;
-
-@XmlType(name = "url")
-public class UrlBinding {
-
-  private String pattern;
-
-  private List<RewriteFilter> rewriteFilters;
-
-  private List<PolicyBinding> policyBindings;
-
-  private CustomDispatch dispatch;
-
-  @XmlAttribute
-  public String getPattern() {
-    return pattern;
-  }
-
-  public void setPattern(String pattern) {
-    this.pattern = pattern;
-  }
-
-  @XmlElement(name = "rewrite-filter")
-  public List<RewriteFilter> getRewriteFilters() {
-    return rewriteFilters;
-  }
-
-  public void setRewriteFilters(List<RewriteFilter> rewriteFilters) {
-    this.rewriteFilters = rewriteFilters;
-  }
-
-  @XmlElement(name = "policy")
-  @XmlElementWrapper(name = "policies")
-  public List<PolicyBinding> getPolicyBindings() {
-    return policyBindings;
-  }
-
-  public void setPolicyBindings(List<PolicyBinding> policyBindings) {
-    this.policyBindings = policyBindings;
-  }
-
-  @XmlElement(name = "dispatch")
-  public CustomDispatch getDispatch() {
-    return dispatch;
-  }
-
-  public void setDispatch(CustomDispatch dispatch) {
-    this.dispatch = dispatch;
-  }
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/resources/services/hbase/0.98.0/service.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/hbase/0.98.0/service.xml
b/gateway-service-definitions/src/main/resources/services/hbase/0.98.0/service.xml
index 0a7b935..a453c49 100644
--- a/gateway-service-definitions/src/main/resources/services/hbase/0.98.0/service.xml
+++ b/gateway-service-definitions/src/main/resources/services/hbase/0.98.0/service.xml
@@ -15,19 +15,19 @@
    limitations under the License.
 -->
 <service role="WEBHBASE" name="webhbase" version="0.98.0">
-    <urls>
-        <url pattern="/hbase/?**">
-            <rewrite-filter ref="WEBHBASE/webhbase/headers/outbound" apply-to="response.headers"/>
-        </url>
-        <url pattern="/hbase/**?**">
-            <rewrite-filter ref="WEBHBASE/webhbase/headers/outbound" apply-to="response.headers"/>
-        </url>
-        <url pattern="/hbase/status/cluster?**">
-            <rewrite-filter ref="WEBHBASE/webhbase/status/outbound" apply-to="response.body"/>
-        </url>
-        <url pattern="/hbase/*/regions?**">
-            <rewrite-filter ref="WEBHBASE/webhbase/regions/outbound" apply-to="response.body"/>
-        </url>
-    </urls>
+    <routes>
+        <route path="/hbase/?**">
+            <rewrite apply="WEBHBASE/webhbase/headers/outbound" to="response.headers"/>
+        </route>
+        <route path="/hbase/**?**">
+            <rewrite apply="WEBHBASE/webhbase/headers/outbound" to="response.headers"/>
+        </route>
+        <route path="/hbase/status/cluster?**">
+            <rewrite apply="WEBHBASE/webhbase/status/outbound" to="response.body"/>
+        </route>
+        <route path="/hbase/*/regions?**">
+            <rewrite apply="WEBHBASE/webhbase/regions/outbound" to="response.body"/>
+        </route>
+    </routes>
     <dispatch contributor-name="hbase"/>
 </service>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/resources/services/hive/0.13.0/service.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/hive/0.13.0/service.xml
b/gateway-service-definitions/src/main/resources/services/hive/0.13.0/service.xml
index b607fe2..e0278dc 100644
--- a/gateway-service-definitions/src/main/resources/services/hive/0.13.0/service.xml
+++ b/gateway-service-definitions/src/main/resources/services/hive/0.13.0/service.xml
@@ -15,8 +15,8 @@
    limitations under the License.
 -->
 <service role="HIVE" name="hive" version="0.13.0">
-    <urls>
-        <url pattern="/hive"/>
-    </urls>
+    <routes>
+        <route path="/hive"/>
+    </routes>
     <dispatch contributor-name="hive"/>
 </service>

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/resources/services/oozie/4.0.0/service.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/oozie/4.0.0/service.xml
b/gateway-service-definitions/src/main/resources/services/oozie/4.0.0/service.xml
index b9c974e..7bc7eb3 100644
--- a/gateway-service-definitions/src/main/resources/services/oozie/4.0.0/service.xml
+++ b/gateway-service-definitions/src/main/resources/services/oozie/4.0.0/service.xml
@@ -16,15 +16,15 @@
    limitations under the License.
 -->
 <service role="OOZIE" name="oozie" version="4.0.0">
-    <urls>
-        <url pattern="/oozie/**?**">
-            <rewrite-filter ref="OOZIE/oozie/configuration" apply-to="request.body"/>
-        </url>
-        <url pattern="/oozie/v1/**?**">
-            <rewrite-filter ref="OOZIE/oozie/configuration" apply-to="request.body"/>
-        </url>
-        <url pattern="/oozie/v2/**?**">
-            <rewrite-filter ref="OOZIE/oozie/configuration" apply-to="request.body"/>
-        </url>
-    </urls>
+    <routes>
+        <route path="/oozie/**?**">
+            <rewrite apply="OOZIE/oozie/configuration" to="request.body"/>
+        </route>
+        <route path="/oozie/v1/**?**">
+            <rewrite apply="OOZIE/oozie/configuration" to="request.body"/>
+        </route>
+        <route path="/oozie/v2/**?**">
+            <rewrite apply="OOZIE/oozie/configuration" to="request.body"/>
+        </route>
+    </routes>
 </service>

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/resources/services/webhcat/0.13.0/service.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/webhcat/0.13.0/service.xml
b/gateway-service-definitions/src/main/resources/services/webhcat/0.13.0/service.xml
index 9f0c6bf..c550dc1 100644
--- a/gateway-service-definitions/src/main/resources/services/webhcat/0.13.0/service.xml
+++ b/gateway-service-definitions/src/main/resources/services/webhcat/0.13.0/service.xml
@@ -16,8 +16,8 @@
    limitations under the License.
 -->
 <service role="WEBHCAT" name="webhcat" version="0.13.0">
-    <urls>
-        <url pattern="/templeton/v1/?**"/>
-        <url pattern="/templeton/v1/**?**"/>
-    </urls>
+    <routes>
+        <route path="/templeton/v1/?**"/>
+        <route path="/templeton/v1/**?**"/>
+    </routes>
 </service>

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/resources/services/webhdfs/2.4.0/service.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/webhdfs/2.4.0/service.xml
b/gateway-service-definitions/src/main/resources/services/webhdfs/2.4.0/service.xml
index fd5d83e..7778f49 100644
--- a/gateway-service-definitions/src/main/resources/services/webhdfs/2.4.0/service.xml
+++ b/gateway-service-definitions/src/main/resources/services/webhdfs/2.4.0/service.xml
@@ -23,25 +23,25 @@
         <policy role="identity-assertion"/>
         <policy role="authorization"/>
     </policies>
-    <urls>
-        <url pattern="/webhdfs/v1/?**">
-            <rewrite-filter ref="WEBHDFS/webhdfs/inbound/namenode/root" apply-to="request.url"/>
-        </url>
-        <url pattern="/webhdfs/v1/**?**">
-            <rewrite-filter ref="WEBHDFS/webhdfs/inbound/namenode/file" apply-to="request.url"/>
-            <rewrite-filter ref="WEBHDFS/webhdfs/outbound/namenode/headers" apply-to="response.headers"/>
-        </url>
-        <url pattern="/webhdfs/v1/~?**">
-            <rewrite-filter ref="WEBHDFS/webhdfs/inbound/namenode/home" apply-to="request.url"/>
-        </url>
-        <url pattern="/webhdfs/v1/~/**?**">
-            <rewrite-filter ref="WEBHDFS/webhdfs/inbound/namenode/home/file" apply-to="request.url"/>
-            <rewrite-filter ref="WEBHDFS/webhdfs/outbound/namenode/headers" apply-to="response.headers"/>
-        </url>
-        <url pattern="/webhdfs/data/v1/**?**">
-            <rewrite-filter ref="WEBHDFS/webhdfs/inbound/datanode" apply-to="request.url"/>
+    <routes>
+        <route path="/webhdfs/v1/?**">
+            <rewrite apply="WEBHDFS/webhdfs/inbound/namenode/root" to="request.url"/>
+        </route>
+        <route path="/webhdfs/v1/**?**">
+            <rewrite apply="WEBHDFS/webhdfs/inbound/namenode/file" to="request.url"/>
+            <rewrite apply="WEBHDFS/webhdfs/outbound/namenode/headers" to="response.headers"/>
+        </route>
+        <route path="/webhdfs/v1/~?**">
+            <rewrite apply="WEBHDFS/webhdfs/inbound/namenode/home" to="request.url"/>
+        </route>
+        <route path="/webhdfs/v1/~/**?**">
+            <rewrite apply="WEBHDFS/webhdfs/inbound/namenode/home/file" to="request.url"/>
+            <rewrite apply="WEBHDFS/webhdfs/outbound/namenode/headers" to="response.headers"/>
+        </route>
+        <route path="/webhdfs/data/v1/**?**">
+            <rewrite apply="WEBHDFS/webhdfs/inbound/datanode" to="request.url"/>
             <dispatch contributor-name="http-client" />
-        </url>
-    </urls>
+        </route>
+    </routes>
     <dispatch contributor-name="hdfs" ha-contributor-name="ha-hdfs"/>
 </service>

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/main/resources/services/yarn-rm/2.5.0/service.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/yarn-rm/2.5.0/service.xml
b/gateway-service-definitions/src/main/resources/services/yarn-rm/2.5.0/service.xml
index 8b53cca..73fb771 100644
--- a/gateway-service-definitions/src/main/resources/services/yarn-rm/2.5.0/service.xml
+++ b/gateway-service-definitions/src/main/resources/services/yarn-rm/2.5.0/service.xml
@@ -16,39 +16,39 @@
    limitations under the License.
 -->
 <service role="RESOURCEMANAGER" name="resourcemanager" version="2.5.0">
-    <urls>
-        <url pattern="/resourcemanager/v1/cluster/"/>
-        <url pattern="/resourcemanager/v1/cluster/**?**"/>
-        <url pattern="/resourcemanager/v1/cluster/apps?**">
-            <rewrite-filter ref="RESOURCEMANAGER/resourcemanager/apps/outbound" apply-to="response.body"/>
-        </url>
-        <url pattern="/resourcemanager/v1/cluster/apps?**">
-            <rewrite-filter ref="RESOURCEMANAGER/resourcemanager/apps/outbound" apply-to="response.body"/>
-        </url>
-        <url pattern="/resourcemanager/v1/cluster/apps/*?**">
-            <rewrite-filter ref="RESOURCEMANAGER/resourcemanager/app/outbound" apply-to="response.body"/>
-        </url>
-        <url pattern="/resourcemanager/v1/cluster/apps/*/appattempts?**">
-            <rewrite-filter ref="RESOURCEMANAGER/resourcemanager/appattempts/outbound"
apply-to="response.body"/>
-        </url>
-        <url pattern="/resourcemanager/v1/cluster/nodes?**">
-            <rewrite-filter ref="RESOURCEMANAGER/resourcemanager/nodes/outbound" apply-to="response.body"/>
-        </url>
-        <url pattern="/resourcemanager/v1/cluster/nodes/*?**">
-            <rewrite-filter ref="RESOURCEMANAGER/resourcemanager/nodeId/inbound" apply-to="request.url"/>
-            <rewrite-filter ref="RESOURCEMANAGER/resourcemanager/node/outbound" apply-to="response.body"/>
-        </url>
-        <url pattern="/resourcemanager/proxy/*/ws/v1/**?**">
-            <rewrite-filter ref="RESOURCEMANAGER/resourcemanager/inbound/proxy" apply-to="request.url"/>
-        </url>
-        <url pattern="/resourcemanager/proxy/*/ws/v1/mapreduce/jobs/*/jobattempts">
-            <rewrite-filter ref="RESOURCEMANAGER/resourcemanager/proxy/jobattempts/outbound"
apply-to="response.body"/>
-        </url>
-        <url pattern="/resourcemanager/proxy/*/ws/v1/mapreduce/jobs/*/tasks/*/attempts">
-            <rewrite-filter ref="RESOURCEMANAGER/resourcemanager/proxy/taskattempts/outbound"
apply-to="response.body"/>
-        </url>
-        <url pattern="/resourcemanager/proxy/*/ws/v1/mapreduce/jobs/*/tasks/*/attempts/*">
-            <rewrite-filter ref="RESOURCEMANAGER/resourcemanager/proxy/taskattempt/outbound"
apply-to="response.body"/>
-        </url>
-    </urls>
+    <routes>
+        <route path="/resourcemanager/v1/cluster/"/>
+        <route path="/resourcemanager/v1/cluster/**?**"/>
+        <route path="/resourcemanager/v1/cluster/apps?**">
+            <rewrite apply="RESOURCEMANAGER/resourcemanager/apps/outbound" to="response.body"/>
+        </route>
+        <route path="/resourcemanager/v1/cluster/apps?**">
+            <rewrite apply="RESOURCEMANAGER/resourcemanager/apps/outbound" to="response.body"/>
+        </route>
+        <route path="/resourcemanager/v1/cluster/apps/*?**">
+            <rewrite apply="RESOURCEMANAGER/resourcemanager/app/outbound" to="response.body"/>
+        </route>
+        <route path="/resourcemanager/v1/cluster/apps/*/appattempts?**">
+            <rewrite apply="RESOURCEMANAGER/resourcemanager/appattempts/outbound" to="response.body"/>
+        </route>
+        <route path="/resourcemanager/v1/cluster/nodes?**">
+            <rewrite apply="RESOURCEMANAGER/resourcemanager/nodes/outbound" to="response.body"/>
+        </route>
+        <route path="/resourcemanager/v1/cluster/nodes/*?**">
+            <rewrite apply="RESOURCEMANAGER/resourcemanager/nodeId/inbound" to="request.url"/>
+            <rewrite apply="RESOURCEMANAGER/resourcemanager/node/outbound" to="response.body"/>
+        </route>
+        <route path="/resourcemanager/proxy/*/ws/v1/**?**">
+            <rewrite apply="RESOURCEMANAGER/resourcemanager/inbound/proxy" to="request.url"/>
+        </route>
+        <route path="/resourcemanager/proxy/*/ws/v1/mapreduce/jobs/*/jobattempts">
+            <rewrite apply="RESOURCEMANAGER/resourcemanager/proxy/jobattempts/outbound"
to="response.body"/>
+        </route>
+        <route path="/resourcemanager/proxy/*/ws/v1/mapreduce/jobs/*/tasks/*/attempts">
+            <rewrite apply="RESOURCEMANAGER/resourcemanager/proxy/taskattempts/outbound"
to="response.body"/>
+        </route>
+        <route path="/resourcemanager/proxy/*/ws/v1/mapreduce/jobs/*/tasks/*/attempts/*">
+            <rewrite apply="RESOURCEMANAGER/resourcemanager/proxy/taskattempt/outbound"
to="response.body"/>
+        </route>
+    </routes>
 </service>

http://git-wip-us.apache.org/repos/asf/knox/blob/c1239703/gateway-service-definitions/src/test/java/org/apache/hadoop/gateway/service/definition/ServiceDefinitionTest.java
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/test/java/org/apache/hadoop/gateway/service/definition/ServiceDefinitionTest.java
b/gateway-service-definitions/src/test/java/org/apache/hadoop/gateway/service/definition/ServiceDefinitionTest.java
index 385aa5e..d5bec8a 100644
--- a/gateway-service-definitions/src/test/java/org/apache/hadoop/gateway/service/definition/ServiceDefinitionTest.java
+++ b/gateway-service-definitions/src/test/java/org/apache/hadoop/gateway/service/definition/ServiceDefinitionTest.java
@@ -39,10 +39,10 @@ public class ServiceDefinitionTest {
     assertEquals("resourcemanager", definition.getName());
     assertEquals("RESOURCEMANAGER", definition.getRole());
     assertEquals("2.5.0", definition.getVersion());
-    List<UrlBinding> bindings = definition.getUrlBindings();
+    List<Route> bindings = definition.getRoutes();
     assertNotNull(bindings);
     assertEquals(12, bindings.size());
-    assertNotNull(bindings.get(0).getPattern());
+    assertNotNull(bindings.get(0).getPath());
     url = ClassLoader.getSystemResource("services/hbase/0.98.0/service.xml");
     definition = (ServiceDefinition) unmarshaller.unmarshal(url.openStream());
     assertNotNull(definition.getDispatch());
@@ -52,7 +52,7 @@ public class ServiceDefinitionTest {
     assertNotNull(definition.getDispatch());
     assertEquals("hdfs", definition.getDispatch().getContributorName());
     assertEquals("ha-hdfs", definition.getDispatch().getHaContributorName());
-    List<PolicyBinding> policyBindings = definition.getPolicyBindings();
+    List<Policy> policyBindings = definition.getPolicies();
     assertNotNull(policyBindings);
     assertEquals("webappsec", policyBindings.get(0).getRole());
     assertNull(policyBindings.get(0).getName());


Mime
View raw message