knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From su...@apache.org
Subject [39/41] knox git commit: Minor cleanup and bug fixes KNOX-481
Date Thu, 12 Feb 2015 16:22:21 GMT
Minor cleanup and bug fixes KNOX-481


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

Branch: refs/heads/KNOX-481
Commit: 7cb3551b5493601921bc739cb7f22aa310e0b682
Parents: 8255647
Author: Sumit Gupta <sumit@apache.org>
Authored: Wed Feb 11 11:57:44 2015 -0500
Committer: Sumit Gupta <sumit@apache.org>
Committed: Wed Feb 11 15:51:59 2015 -0500

----------------------------------------------------------------------
 .../ha/provider/HaServletContextListener.java   |   2 +-
 gateway-release/pom.xml                         |  12 --
 .../apache/hadoop/gateway/GatewayMessages.java  |   3 +
 .../gateway/config/impl/GatewayConfigImpl.java  |   4 +-
 .../gateway/deploy/DeploymentFactory.java       |   4 +-
 .../ServiceDefinitionDeploymentContributor.java |  50 +++--
 .../src/main/resources/build.properties         |   2 +-
 .../service/definition/CustomDispatch.java      |  11 ++
 .../resources/services/hbase/0.98.0/service.xml |   2 +-
 .../resources/services/hive/0.13.0/service.xml  |   2 +-
 .../services/webhdfs/2.4.0/service.xml          |   9 +-
 .../definition/ServiceDefinitionTest.java       |  10 +-
 .../hbase/HBaseDeploymentContributor.java       | 133 -------------
 .../HBaseDispatchDeploymentContributor.java     |  73 -------
 ...gateway.deploy.ProviderDeploymentContributor |  19 --
 ....gateway.deploy.ServiceDeploymentContributor |  19 --
 .../hbase/HBaseDeploymentContributorTest.java   |  45 -----
 .../HBaseDispatchDeploymentContributorTest.java |  45 -----
 .../gateway/hive/HiveDeploymentContributor.java |  84 --------
 .../hive/HiveDispatchDeploymentContributor.java |  78 --------
 ...gateway.deploy.ProviderDeploymentContributor |  19 --
 ....gateway.deploy.ServiceDeploymentContributor |  19 --
 .../HiveDispatchDeploymentContributorTest.java  |  44 -----
 gateway-service-oozie/pom.xml                   |  95 ---------
 .../oozie/OozieDeploymentContributor.java       | 128 ------------
 ....gateway.deploy.ServiceDeploymentContributor |  19 --
 .../OozieDeploymentContributor/rewrite.xml      | 122 ------------
 .../oozie/OozieDeploymentContributorTest.java   | 130 -------------
 gateway-service-webhcat/pom.xml                 |  57 ------
 .../webhcat/WebHCatDeploymentContributor.java   |  95 ---------
 ....gateway.deploy.ServiceDeploymentContributor |  19 --
 .../WebHCatDeploymentContributor/rewrite.xml    |  28 ---
 .../hdfs/WebHdfsDeploymentContributor.java      | 173 -----------------
 .../WebHdfsDispatchDeploymentContributor.java   |  52 -----
 .../dispatch/WebHdfsHaHttpClientDispatch.java   |   2 +
 ...gateway.deploy.ProviderDeploymentContributor |   1 -
 ....gateway.deploy.ServiceDeploymentContributor |   1 -
 gateway-service-yarn-rm/pom.xml                 |  61 ------
 .../ResourceManagerDeploymentContributor.java   | 151 ---------------
 ....gateway.deploy.ServiceDeploymentContributor |  19 --
 .../rewrite.xml                                 | 193 -------------------
 ...esourceManagerDeploymentContributorTest.java |  45 -----
 .../config/FilterConfigurationAdapter.java      |   8 +-
 ...ay.config.spi.ConfigurationAdapterDescriptor |   2 +-
 .../hadoop/gateway/GatewayTestConfig.java       |   2 +-
 .../deploy/DeploymentFactoryFuncTest.java       |   6 +-
 .../WebHCatDeploymentContributorTest.java       |  45 -----
 .../gateway/config/ConfigurationAdapter.java    |   2 +-
 .../config/impl/BeanConfigurationAdapter.java   |   7 +-
 .../impl/DefaultConfigurationInjector.java      |  10 +-
 .../config/impl/MapConfigurationAdapter.java    |   5 +-
 .../impl/PropertiesConfigurationAdapter.java    |   2 +-
 .../gateway/config/AdapterSampleTest.java       |   2 +-
 .../apache/hadoop/gateway/config/FuncTest.java  |   2 +-
 .../impl/BeanConfigurationAdapterTest.java      |   2 +-
 hsso-release/pom.xml                            |  10 +-
 pom.xml                                         |  18 --
 57 files changed, 93 insertions(+), 2110 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-provider-ha/src/main/java/org/apache/hadoop/gateway/ha/provider/HaServletContextListener.java
----------------------------------------------------------------------
diff --git a/gateway-provider-ha/src/main/java/org/apache/hadoop/gateway/ha/provider/HaServletContextListener.java b/gateway-provider-ha/src/main/java/org/apache/hadoop/gateway/ha/provider/HaServletContextListener.java
index 62dd684..b84e649 100644
--- a/gateway-provider-ha/src/main/java/org/apache/hadoop/gateway/ha/provider/HaServletContextListener.java
+++ b/gateway-provider-ha/src/main/java/org/apache/hadoop/gateway/ha/provider/HaServletContextListener.java
@@ -36,7 +36,7 @@ import java.util.List;
 
 public class HaServletContextListener implements ServletContextListener {
 
-   public static final String PROVIDER_ATTRIBUTE_NAME = HaProvider.class.getName();
+   public static final String PROVIDER_ATTRIBUTE_NAME = "haProvider";
 
    public static final String DESCRIPTOR_LOCATION_INIT_PARAM_NAME = "haDescriptorLocation";
 

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-release/pom.xml
----------------------------------------------------------------------
diff --git a/gateway-release/pom.xml b/gateway-release/pom.xml
index 0ea7a81..0f7a739 100644
--- a/gateway-release/pom.xml
+++ b/gateway-release/pom.xml
@@ -166,22 +166,10 @@
         </dependency>
         <dependency>
             <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-service-oozie</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-service-webhcat</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${gateway-group}</groupId>
             <artifactId>gateway-service-tgs</artifactId>
         </dependency>
         <dependency>
             <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-service-yarn-rm</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${gateway-group}</groupId>
             <artifactId>gateway-provider-rewrite</artifactId>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java
index fb0e3a4..4990ad1 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java
@@ -328,4 +328,7 @@ public interface GatewayMessages {
 
   @Message( level = MessageLevel.INFO, text = "Computed roles/groups: {0} for principal: {1}" )
   void lookedUpUserRoles(Set<String> roleNames, String userName);
+
+  @Message( level = MessageLevel.INFO, text = "Configured stacks directory is {0}" )
+  void usingStacksDirectory(String path);
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java
index cfbec54..f5c4d7d 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java
@@ -75,6 +75,8 @@ public class GatewayConfigImpl extends Configuration implements GatewayConfig {
 
   private static final String GATEWAY_CONFIG_FILE_PREFIX = "gateway";
 
+  private static final String STACKS_SERVICES_DIRECTORY = "services";
+
   public static final String[] GATEWAY_CONFIG_FILENAMES = {
       GATEWAY_CONFIG_DIR_PREFIX + "/" + GATEWAY_CONFIG_FILE_PREFIX + "-default.xml",
       GATEWAY_CONFIG_DIR_PREFIX + "/" + GATEWAY_CONFIG_FILE_PREFIX + "-site.xml"
@@ -175,7 +177,7 @@ public class GatewayConfigImpl extends Configuration implements GatewayConfig {
 
   @Override
   public String getGatewayStacksDir() {
-    return getVar( GATEWAY_DATA_HOME_VAR, getGatewayHomeDir() + File.separator + "stacks" );
+    return getGatewayDataDir() + File.separator + STACKS_SERVICES_DIRECTORY;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
index 16d188a..d2245cc 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
@@ -48,7 +48,6 @@ import java.util.*;
 public abstract class DeploymentFactory {
 
   private static final String DEFAULT_APP_REDIRECT_CONTEXT_PATH = "redirectTo";
-  private static final String STACKS_SERVICES_DIRECTORY = "services";
   private static GatewayMessages log = MessagesFactory.get( GatewayMessages.class );
   private static GatewayServices gatewayServices = null;
 
@@ -71,7 +70,8 @@ public abstract class DeploymentFactory {
     DeploymentContext context = null;
      //TODO move the loading of service defs
     String stacks = config.getGatewayStacksDir();
-    File stacksDir = new File(stacks, STACKS_SERVICES_DIRECTORY);
+    log.usingStacksDirectory(stacks);
+    File stacksDir = new File(stacks);
     Set<ServiceDeploymentContributor> deploymentContributors = ServiceDefinitionsLoader.loadServiceDefinitions(stacksDir);
     addServiceDeploymentContributors(deploymentContributors.iterator());
 

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/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 789a221..c14a156 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
@@ -41,6 +41,10 @@ public class ServiceDefinitionDeploymentContributor extends ServiceDeploymentCon
 
   private static final String DISPATCH_IMPL_PARAM = "dispatch-impl";
 
+  private static final String REPLAY_BUFFER_SIZE_PARAM = "replayBufferSize";
+
+  public static final String DEFAULT_REPLAY_BUFFER_SIZE = "8";
+
   private ServiceDefinition serviceDefinition;
 
   private UrlRewriteRulesDescriptor serviceRules;
@@ -104,10 +108,10 @@ public class ServiceDefinitionDeploymentContributor extends ServiceDeploymentCon
     resource.role(service.getRole());
     resource.pattern(binding.getPath());
     List<Policy> policyBindings = binding.getPolicies();
-    if (policyBindings == null) {
+    if ( policyBindings == null ) {
       policyBindings = serviceDefinition.getPolicies();
     }
-    if (policyBindings == null) {
+    if ( policyBindings == null ) {
       //add default set
       addDefaultPolicies(context, service, filterParams, params, resource);
     } else {
@@ -117,16 +121,16 @@ public class ServiceDefinitionDeploymentContributor extends ServiceDeploymentCon
   }
 
   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) {
+    for ( Policy policyBinding : policyBindings ) {
       String role = policyBinding.getRole();
-      if (role == null) {
+      if ( role == null ) {
         throw new IllegalArgumentException("Policy defined has no role for service " + service.getName());
       }
       role = role.trim().toLowerCase();
-      if (role.equals("rewrite")) {
+      if ( role.equals("rewrite") ) {
         addRewriteFilter(context, service, filterParams, params, resource);
-      } else if (topologyContainsProviderType(context, role)) {
-        context.contributeFilter( service, resource, role, policyBinding.getName(), null );
+      } else if ( topologyContainsProviderType(context, role) ) {
+        context.contributeFilter(service, resource, role, policyBinding.getName(), null);
       }
     }
   }
@@ -134,9 +138,9 @@ public class ServiceDefinitionDeploymentContributor extends ServiceDeploymentCon
   private void addDefaultPolicies(DeploymentContext context, Service service, Map<String, String> filterParams, List<FilterParamDescriptor> params, ResourceDescriptor resource) throws URISyntaxException {
     addWebAppSecFilters(context, service, resource);
     addAuthenticationFilter(context, service, resource);
+    addRewriteFilter(context, service, filterParams, params, resource);
     addIdentityAssertionFilter(context, service, resource);
     addAuthorizationFilter(context, service, resource);
-    addRewriteFilter(context, service, filterParams, params, resource);
   }
 
   private void addRewriteFilter(DeploymentContext context, Service service, Map<String, String> filterParams, List<FilterParamDescriptor> params, ResourceDescriptor resource) throws URISyntaxException {
@@ -155,8 +159,14 @@ public class ServiceDefinitionDeploymentContributor extends ServiceDeploymentCon
     }
     if ( customDispatch != null ) {
       boolean isHaEnabled = isHaEnabled(context);
-      if ( isHaEnabled && (customDispatch.getHaContributorName() != null) ) {
-        addDispatchFilter(context, service, resource, DISPATCH_ROLE, customDispatch.getHaContributorName());
+      String haContributorName = customDispatch.getHaContributorName();
+      String haClassName = customDispatch.getHaClassName();
+      if ( isHaEnabled && (haContributorName != null || haClassName != null)) {
+        if (haContributorName != null) {
+          addDispatchFilter(context, service, resource, DISPATCH_ROLE, haContributorName);
+        } else {
+          addDispatchFilterForClass(context, service, resource, haClassName);
+        }
       } else {
         String contributorName = customDispatch.getContributorName();
         if ( contributorName != null ) {
@@ -164,8 +174,7 @@ public class ServiceDefinitionDeploymentContributor extends ServiceDeploymentCon
         } else {
           String className = customDispatch.getClassName();
           if ( className != null ) {
-            FilterDescriptor filter = resource.addFilter().name(getName()).role(DISPATCH_ROLE).impl(GatewayDispatchFilter.class);
-            filter.param().name(DISPATCH_IMPL_PARAM).value(className);
+            addDispatchFilterForClass(context, service, resource, className);
           }
         }
       }
@@ -174,6 +183,23 @@ public class ServiceDefinitionDeploymentContributor extends ServiceDeploymentCon
     }
   }
 
+  private void addDispatchFilterForClass(DeploymentContext context, Service service, ResourceDescriptor resource, String className) {
+    FilterDescriptor filter = resource.addFilter().name(getName()).role(DISPATCH_ROLE).impl(GatewayDispatchFilter.class);
+    filter.param().name(DISPATCH_IMPL_PARAM).value(className);
+    FilterParamDescriptor filterParam = filter.param().name(REPLAY_BUFFER_SIZE_PARAM).value(DEFAULT_REPLAY_BUFFER_SIZE);
+    for ( Map.Entry<String, String> serviceParam : service.getParams().entrySet() ) {
+      if ( REPLAY_BUFFER_SIZE_PARAM.equals(serviceParam.getKey()) ) {
+        filterParam.value(serviceParam.getValue());
+      }
+    }
+    if ( context.getGatewayConfig().isHadoopKerberosSecured() ) {
+      filter.param().name("kerberos").value("true");
+    } else {
+      //special case for hive
+      filter.param().name("basicAuthPreemptive").value("true");
+    }
+  }
+
   private boolean isHaEnabled(DeploymentContext context) {
     Provider provider = getProviderByRole(context, "ha");
     if ( provider != null && provider.isEnabled() ) {

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-server/src/main/resources/build.properties
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/resources/build.properties b/gateway-server/src/main/resources/build.properties
index a380579..fbd4d83 100644
--- a/gateway-server/src/main/resources/build.properties
+++ b/gateway-server/src/main/resources/build.properties
@@ -14,5 +14,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-build.version=${gateway-version}
+build.version=0.5.0.2.2.1.0-2340
 build.hash=${buildNumber}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/CustomDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/CustomDispatch.java b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/CustomDispatch.java
index 230bdb7..7270a2b 100644
--- a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/CustomDispatch.java
+++ b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/CustomDispatch.java
@@ -29,6 +29,8 @@ public class CustomDispatch {
 
   private String className;
 
+  private String haClassName;
+
   @XmlAttribute(name = "contributor-name")
   public String getContributorName() {
     return contributorName;
@@ -55,4 +57,13 @@ public class CustomDispatch {
   public void setClassName(String className) {
     this.className = className;
   }
+
+  @XmlAttribute(name = "ha-classname")
+  public String getHaClassName() {
+    return haClassName;
+  }
+
+  public void setHaClassName(String haContributorClassName) {
+    this.haClassName = haContributorClassName;
+  }
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/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 a453c49..e03bca7 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
@@ -29,5 +29,5 @@
             <rewrite apply="WEBHBASE/webhbase/regions/outbound" to="response.body"/>
         </route>
     </routes>
-    <dispatch contributor-name="hbase"/>
+    <dispatch classname="org.apache.hadoop.gateway.hbase.HBaseHttpClientDispatch"/>
 </service>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/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 e0278dc..32d1560 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
@@ -18,5 +18,5 @@
     <routes>
         <route path="/hive"/>
     </routes>
-    <dispatch contributor-name="hive"/>
+    <dispatch classname="org.apache.hadoop.gateway.hive.HiveHttpClientDispatch"/>
 </service>

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/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 7778f49..2470175 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
@@ -16,13 +16,6 @@
    limitations under the License.
 -->
 <service role="WEBHDFS" name="webhdfs" version="2.4.0">
-    <policies>
-        <policy role="webappsec"/>
-        <policy role="authentication"/>
-        <policy role="rewrite"/>
-        <policy role="identity-assertion"/>
-        <policy role="authorization"/>
-    </policies>
     <routes>
         <route path="/webhdfs/v1/?**">
             <rewrite apply="WEBHDFS/webhdfs/inbound/namenode/root" to="request.url"/>
@@ -43,5 +36,5 @@
             <dispatch contributor-name="http-client" />
         </route>
     </routes>
-    <dispatch contributor-name="hdfs" ha-contributor-name="ha-hdfs"/>
+    <dispatch classname="org.apache.hadoop.gateway.hdfs.dispatch.HdfsDispatch" ha-classname="org.apache.hadoop.gateway.hdfs.dispatch.WebHdfsHaHttpClientDispatch"/>
 </service>

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/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 d5bec8a..62fb23e 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
@@ -46,15 +46,11 @@ public class ServiceDefinitionTest {
     url = ClassLoader.getSystemResource("services/hbase/0.98.0/service.xml");
     definition = (ServiceDefinition) unmarshaller.unmarshal(url.openStream());
     assertNotNull(definition.getDispatch());
-    assertEquals("hbase", definition.getDispatch().getContributorName());
+    assertEquals("org.apache.hadoop.gateway.hbase.HBaseHttpClientDispatch", definition.getDispatch().getClassName());
     url = ClassLoader.getSystemResource("services/webhdfs/2.4.0/service.xml");
     definition = (ServiceDefinition) unmarshaller.unmarshal(url.openStream());
     assertNotNull(definition.getDispatch());
-    assertEquals("hdfs", definition.getDispatch().getContributorName());
-    assertEquals("ha-hdfs", definition.getDispatch().getHaContributorName());
-    List<Policy> policyBindings = definition.getPolicies();
-    assertNotNull(policyBindings);
-    assertEquals("webappsec", policyBindings.get(0).getRole());
-    assertNull(policyBindings.get(0).getName());
+    assertEquals("org.apache.hadoop.gateway.hdfs.dispatch.HdfsDispatch", definition.getDispatch().getClassName());
+    assertEquals("org.apache.hadoop.gateway.hdfs.dispatch.WebHdfsHaHttpClientDispatch", definition.getDispatch().getHaClassName());
   }
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java b/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java
deleted file mode 100644
index 532ee68..0000000
--- a/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java
+++ /dev/null
@@ -1,133 +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.hbase;
-
-import org.apache.hadoop.gateway.deploy.DeploymentContext;
-import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributorBase;
-import org.apache.hadoop.gateway.descriptor.FilterParamDescriptor;
-import org.apache.hadoop.gateway.descriptor.ResourceDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRulesDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRulesDescriptorFactory;
-import org.apache.hadoop.gateway.topology.Service;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class HBaseDeploymentContributor extends ServiceDeploymentContributorBase {
-
-  private static final String RULES_RESOURCE = HBaseDeploymentContributor.class.getName().replace( '.', '/' ) + "/rewrite.xml";
-  private static final String EXTERNAL_PATH = "/hbase";
-
-  @Override 
-  public String getRole() {
-    return "xWEBHBASE";
-  }
-
-  @Override
-  public String getName() {
-    return "xwebhbase";
-  }
-
-  @Override
-  public void contributeService( DeploymentContext context, Service service ) throws Exception {
-    contributeRewriteRules( context, service );
-    contributeResources( context, service );
-  }
-
-  private void contributeRewriteRules( DeploymentContext context, Service service ) throws URISyntaxException, IOException {
-    UrlRewriteRulesDescriptor hbaseRules = loadRulesFromTemplate();
-    UrlRewriteRulesDescriptor clusterRules = context.getDescriptor( "rewrite" );
-    clusterRules.addRules( hbaseRules );
-  }
-
-  private void contributeResources( DeploymentContext context, Service service ) throws URISyntaxException {
-    List<FilterParamDescriptor> params;
-
-    ResourceDescriptor rootResource = context.getGatewayDescriptor().addResource();
-    rootResource.role( service.getRole() );
-    rootResource.pattern( EXTERNAL_PATH + "/?**" );
-    addWebAppSecFilters(context, service, rootResource);
-    addAuthenticationFilter( context, service, rootResource );
-    params = new ArrayList<FilterParamDescriptor>();
-    params.add( rootResource.createFilterParam().name( "response.headers" ).value( getQualifiedName() + "/headers/outbound" ) );
-    addRewriteFilter( context, service, rootResource, params );
-    addIdentityAssertionFilter( context, service, rootResource );
-    addAuthorizationFilter(context, service, rootResource);
-    addDispatchFilter( context, service, rootResource );
-    
-    ResourceDescriptor pathResource = context.getGatewayDescriptor().addResource();
-    pathResource.role( service.getRole() );
-    pathResource.pattern( EXTERNAL_PATH + "/**?**" );
-    addWebAppSecFilters(context, service, pathResource);
-    addAuthenticationFilter( context, service, pathResource );
-    params = new ArrayList<FilterParamDescriptor>();
-    params.add( rootResource.createFilterParam().name( "response.headers" ).value( getQualifiedName() + "/headers/outbound" ) );
-    addRewriteFilter( context, service, pathResource, params );
-    addIdentityAssertionFilter( context, service, pathResource );
-    addAuthorizationFilter(context, service, pathResource);
-    addDispatchFilter( context, service, pathResource );
-
-    ResourceDescriptor statusResource = context.getGatewayDescriptor().addResource();
-    statusResource.role( service.getRole() );
-    statusResource.pattern( EXTERNAL_PATH + "/status/cluster?**" );
-    addWebAppSecFilters(context, service, statusResource);
-    addAuthenticationFilter( context, service, statusResource );
-    params = new ArrayList<FilterParamDescriptor>();
-    params.add( statusResource.createFilterParam().name( "response.body" ).value( getQualifiedName() + "/status/outbound" ) );
-    addRewriteFilter( context, service, statusResource, params );
-    addIdentityAssertionFilter( context, service, statusResource );
-    addAuthorizationFilter(context, service, statusResource);
-    addDispatchFilter( context, service, statusResource );
-
-    ResourceDescriptor regionResource = context.getGatewayDescriptor().addResource();
-    regionResource.role( service.getRole() );
-    regionResource.pattern( EXTERNAL_PATH + "/*/regions?**" );
-    addWebAppSecFilters(context, service, regionResource);
-    addAuthenticationFilter( context, service, regionResource );
-    params = new ArrayList<FilterParamDescriptor>();
-    params.add( regionResource.createFilterParam().name( "response.body" ).value( getQualifiedName() + "/regions/outbound" ) );
-    addRewriteFilter( context, service, regionResource, params );
-    addIdentityAssertionFilter( context, service, regionResource );
-    addAuthorizationFilter(context, service, regionResource);
-    addDispatchFilter( context, service, regionResource );
-  }
-
-  private void addDispatchFilter(
-    DeploymentContext context, Service service, ResourceDescriptor resource ) {
-    context.contributeFilter( service, resource, "dispatch", "hbase", null );
-  }
-
-  private String getQualifiedName() {
-    return getRole() + "/" + getName();
-  }
-
-  UrlRewriteRulesDescriptor loadRulesFromTemplate() throws IOException {
-    InputStream stream = this.getClass().getClassLoader().getResourceAsStream( RULES_RESOURCE );
-    Reader reader = new InputStreamReader( stream );
-    UrlRewriteRulesDescriptor rules = UrlRewriteRulesDescriptorFactory.load( "xml", reader );
-    reader.close();
-    stream.close();
-    return rules;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributor.java b/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributor.java
deleted file mode 100644
index b84380a..0000000
--- a/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributor.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.hbase;
-
-import org.apache.hadoop.gateway.deploy.DeploymentContext;
-import org.apache.hadoop.gateway.deploy.ProviderDeploymentContributorBase;
-import org.apache.hadoop.gateway.descriptor.FilterDescriptor;
-import org.apache.hadoop.gateway.descriptor.FilterParamDescriptor;
-import org.apache.hadoop.gateway.descriptor.ResourceDescriptor;
-import org.apache.hadoop.gateway.dispatch.GatewayDispatchFilter;
-import org.apache.hadoop.gateway.dispatch.HttpClientDispatch;
-import org.apache.hadoop.gateway.topology.Provider;
-import org.apache.hadoop.gateway.topology.Service;
-
-import java.util.List;
-import java.util.Map;
-
-public class HBaseDispatchDeploymentContributor extends ProviderDeploymentContributorBase {
-  
-  private static final String REPLAY_BUFFER_SIZE_PARAM = "replayBufferSize";
-
-  private static final String DISPATCH_IMPL_PARAM = "dispatch-impl";
-
-  // Default global replay buffer size in KB
-  public static final String DEFAULT_REPLAY_BUFFER_SIZE = "4";
-
-  @Override
-  public String getRole() {
-    return "dispatch";
-  }
-
-  @Override
-  public String getName() {
-    return "hbase";
-  }
-
-  @Override
-  public void contributeFilter( DeploymentContext context, Provider provider, Service service, ResourceDescriptor resource, List<FilterParamDescriptor> params ) {
-    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl( GatewayDispatchFilter.class );
-    filter.param().name(DISPATCH_IMPL_PARAM).value(HBaseHttpClientDispatch.class.getName());
-    FilterParamDescriptor filterParam = filter.param().name( REPLAY_BUFFER_SIZE_PARAM ).value( DEFAULT_REPLAY_BUFFER_SIZE );
-    for ( Map.Entry<String,String> serviceParam : service.getParams().entrySet() ) {
-      if ( REPLAY_BUFFER_SIZE_PARAM.equals( serviceParam.getKey() ) ) {
-        filterParam.value( serviceParam.getValue() );
-      }
-    }
-    if ( params != null ) {
-      for ( FilterParamDescriptor customParam : params ) {
-        if ( REPLAY_BUFFER_SIZE_PARAM.equals( customParam.name() ) ) {
-          filterParam.value( customParam.value() );
-        }
-      }
-    }
-    if( context.getGatewayConfig().isHadoopKerberosSecured() ) {
-      filter.param().name("kerberos").value("true");
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-hbase/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
----------------------------------------------------------------------
diff --git a/gateway-service-hbase/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor b/gateway-service-hbase/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
deleted file mode 100644
index 610bfbb..0000000
--- a/gateway-service-hbase/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
+++ /dev/null
@@ -1,19 +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.
-##########################################################################
-
-org.apache.hadoop.gateway.hbase.HBaseDispatchDeploymentContributor

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-hbase/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
----------------------------------------------------------------------
diff --git a/gateway-service-hbase/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor b/gateway-service-hbase/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
deleted file mode 100644
index 5fc751f..0000000
--- a/gateway-service-hbase/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
+++ /dev/null
@@ -1,19 +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.
-##########################################################################
-
-org.apache.hadoop.gateway.hbase.HBaseDeploymentContributor

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-hbase/src/test/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributorTest.java
----------------------------------------------------------------------
diff --git a/gateway-service-hbase/src/test/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributorTest.java b/gateway-service-hbase/src/test/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributorTest.java
deleted file mode 100644
index 3c8c1b1..0000000
--- a/gateway-service-hbase/src/test/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributorTest.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.hbase;
-
-import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor;
-import org.junit.Test;
-
-import java.util.Iterator;
-import java.util.ServiceLoader;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.fail;
-
-public class HBaseDeploymentContributorTest {
-
-  @Test
-  public void testServiceLoader() throws Exception {
-    ServiceLoader loader = ServiceLoader.load( ServiceDeploymentContributor.class );
-    Iterator iterator = loader.iterator();
-    assertThat( "Service iterator empty.", iterator.hasNext() );
-    while( iterator.hasNext() ) {
-      Object object = iterator.next();
-      if( object instanceof HBaseDeploymentContributor ) {
-        return;
-      }
-    }
-    fail( "Failed to find " + HBaseDeploymentContributor.class.getName() + " via service loader." );
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-hbase/src/test/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributorTest.java
----------------------------------------------------------------------
diff --git a/gateway-service-hbase/src/test/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributorTest.java b/gateway-service-hbase/src/test/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributorTest.java
deleted file mode 100644
index e2b4d10..0000000
--- a/gateway-service-hbase/src/test/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributorTest.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.hbase;
-
-import org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor;
-import org.junit.Test;
-
-import java.util.Iterator;
-import java.util.ServiceLoader;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.fail;
-
-public class HBaseDispatchDeploymentContributorTest {
-
-  @Test
-  public void testServiceLoader() throws Exception {
-    ServiceLoader loader = ServiceLoader.load( ProviderDeploymentContributor.class );
-    Iterator iterator = loader.iterator();
-    assertThat( "Service iterator empty.", iterator.hasNext() );
-    while( iterator.hasNext() ) {
-      Object object = iterator.next();
-      if( object instanceof HBaseDispatchDeploymentContributor ) {
-        return;
-      }
-    }
-    fail( "Failed to find " + HBaseDispatchDeploymentContributor.class.getName() + " via service loader." );
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDeploymentContributor.java b/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDeploymentContributor.java
deleted file mode 100644
index cacdd8e..0000000
--- a/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDeploymentContributor.java
+++ /dev/null
@@ -1,84 +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.hive;
-
-import org.apache.hadoop.gateway.deploy.DeploymentContext;
-import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributorBase;
-import org.apache.hadoop.gateway.descriptor.ResourceDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRuleDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRulesDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.ext.UrlRewriteActionRewriteDescriptorExt;
-import org.apache.hadoop.gateway.topology.Service;
-
-import java.net.URISyntaxException;
-
-public class HiveDeploymentContributor extends ServiceDeploymentContributorBase {
-
-  private static final String ROLE = "xHIVE";
-  private static final String NAME = "xhive";
-  private static final String EXTERNAL_PATH = "/hive";
-
-  @Override
-  public String getRole() {
-    return ROLE;
-  }
-
-  @Override
-  public String getName() {
-    return NAME;
-  }
-
-  @Override
-  public void contributeService( DeploymentContext context, Service service ) throws Exception {
-    contributeRewriteRules( context, service );
-    contributeResources( context, service );
-  }
-
-  private void contributeRewriteRules( DeploymentContext context, Service service ) throws URISyntaxException {
-    UrlRewriteRulesDescriptor rules = context.getDescriptor( "rewrite" );
-    UrlRewriteRuleDescriptor rule;
-    UrlRewriteActionRewriteDescriptorExt rewrite;
-
-    rule = rules.addRule( getRole() + "/" + getName() + "/inbound" )
-        .directions( "inbound" )
-        .pattern( "*://*:*/**" + EXTERNAL_PATH );
-    rewrite = rule.addStep( "rewrite" );
-    rewrite.template( service.getUrl() );
-  }
-
-  public void contributeResources( DeploymentContext context, Service service ) throws URISyntaxException {
-    ResourceDescriptor rootResource = context.getGatewayDescriptor().addResource();
-    rootResource.role( service.getRole() );
-    rootResource.pattern( EXTERNAL_PATH );
-    addWebAppSecFilters(context, service, rootResource);
-    addAuthenticationFilter( context, service, rootResource );
-    addRewriteFilter( context, service, rootResource );
-    addIdentityAssertionFilter( context, service, rootResource );
-    addAuthorizationFilter(context, service, rootResource);
-    addDispatchFilter( context, service, rootResource );
-  }
-
-  private void addRewriteFilter(
-      DeploymentContext context, Service service, ResourceDescriptor resource ) throws URISyntaxException {
-    context.contributeFilter( service, resource, "rewrite", null, null );
-  }
-
-  private void addDispatchFilter( DeploymentContext context, Service service, ResourceDescriptor resource ) {
-    context.contributeFilter( service, resource, "dispatch", "hive", null );
-  }
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributor.java b/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributor.java
deleted file mode 100644
index ca40d81..0000000
--- a/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributor.java
+++ /dev/null
@@ -1,78 +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.hive;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.hadoop.gateway.deploy.DeploymentContext;
-import org.apache.hadoop.gateway.deploy.ProviderDeploymentContributorBase;
-import org.apache.hadoop.gateway.descriptor.FilterDescriptor;
-import org.apache.hadoop.gateway.descriptor.FilterParamDescriptor;
-import org.apache.hadoop.gateway.descriptor.ResourceDescriptor;
-import org.apache.hadoop.gateway.dispatch.GatewayDispatchFilter;
-import org.apache.hadoop.gateway.topology.Provider;
-import org.apache.hadoop.gateway.topology.Service;
-
-/**
- *
- */
-public class HiveDispatchDeploymentContributor extends ProviderDeploymentContributorBase {
-  
-  private static final String REPLAY_BUFFER_SIZE_PARAM = "replayBufferSize";
-
-  private static final String DISPATCH_IMPL_PARAM = "dispatch-impl";
-
-  // Default global replay buffer size in KB
-  public static final String DEFAULT_REPLAY_BUFFER_SIZE = "4";
-
-  @Override
-  public String getRole() {
-    return "dispatch";
-  }
-
-  @Override
-  public String getName() {
-    return "hive";
-  }
-
-  @Override
-  public void contributeFilter( DeploymentContext context, Provider provider, Service service, ResourceDescriptor resource, List<FilterParamDescriptor> params ) {
-    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl( GatewayDispatchFilter.class );
-    filter.param().name(DISPATCH_IMPL_PARAM).value(HiveHttpClientDispatch.class.getName());
-    FilterParamDescriptor filterParam = filter.param().name( REPLAY_BUFFER_SIZE_PARAM ).value( DEFAULT_REPLAY_BUFFER_SIZE );
-    for ( Map.Entry<String,String> serviceParam : service.getParams().entrySet() ) {
-      if ( REPLAY_BUFFER_SIZE_PARAM.equals( serviceParam.getKey() ) ) {
-        filterParam.value( serviceParam.getValue() );
-      }
-    }
-    if ( params != null ) {
-      for ( FilterParamDescriptor customParam : params ) {
-        if ( REPLAY_BUFFER_SIZE_PARAM.equals( customParam.name() ) ) {
-          filterParam.value( customParam.value() );
-        }
-      }
-    }
-    if( context.getGatewayConfig().isHadoopKerberosSecured() ) {
-      filter.param().name("kerberos").value("true");
-    }
-    else {
-      filter.param().name("basicAuthPreemptive").value("true");
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-hive/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
----------------------------------------------------------------------
diff --git a/gateway-service-hive/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor b/gateway-service-hive/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
deleted file mode 100644
index 3762427..0000000
--- a/gateway-service-hive/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
+++ /dev/null
@@ -1,19 +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.
-##########################################################################
-
-org.apache.hadoop.gateway.hive.HiveDispatchDeploymentContributor

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-hive/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
----------------------------------------------------------------------
diff --git a/gateway-service-hive/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor b/gateway-service-hive/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
deleted file mode 100644
index 3898804..0000000
--- a/gateway-service-hive/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
+++ /dev/null
@@ -1,19 +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.
-##########################################################################
-
-org.apache.hadoop.gateway.hive.HiveDeploymentContributor

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-hive/src/test/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributorTest.java
----------------------------------------------------------------------
diff --git a/gateway-service-hive/src/test/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributorTest.java b/gateway-service-hive/src/test/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributorTest.java
deleted file mode 100644
index d748ea4..0000000
--- a/gateway-service-hive/src/test/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributorTest.java
+++ /dev/null
@@ -1,44 +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.hive;
-
-import org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor;
-import org.junit.Test;
-
-import java.util.Iterator;
-import java.util.ServiceLoader;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.fail;
-
-public class HiveDispatchDeploymentContributorTest {
-
-  @Test
-  public void testServiceLoader() throws Exception {
-    ServiceLoader loader = ServiceLoader.load( ProviderDeploymentContributor.class );
-    Iterator iterator = loader.iterator();
-    assertThat( "Service iterator empty.", iterator.hasNext() );
-    while( iterator.hasNext() ) {
-      Object object = iterator.next();
-      if( object instanceof HiveDispatchDeploymentContributor ) {
-        return;
-      }
-    }
-    fail( "Failed to find " + HiveDispatchDeploymentContributor.class.getName() + " via service loader." );
-  }
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-oozie/pom.xml
----------------------------------------------------------------------
diff --git a/gateway-service-oozie/pom.xml b/gateway-service-oozie/pom.xml
deleted file mode 100644
index 00f8cc3..0000000
--- a/gateway-service-oozie/pom.xml
+++ /dev/null
@@ -1,95 +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.
--->
-<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/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <artifactId>gateway</artifactId>
-        <groupId>org.apache.knox</groupId>
-        <version>0.6.0-SNAPSHOT</version>
-    </parent>
-    <artifactId>gateway-service-oozie</artifactId>
-
-    <name>gateway-service-oozie</name>
-    <description>The extensions to the gateway for supporting Oozie.</description>
-
-    <licenses>
-        <license>
-            <name>The Apache Software License, Version 2.0</name>
-            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
-            <distribution>repo</distribution>
-        </license>
-    </licenses>
-
-    <dependencies>
-        <dependency>
-            <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-spi</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-provider-rewrite</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.jboss.shrinkwrap</groupId>
-            <artifactId>shrinkwrap-api</artifactId>
-            <version>1.0.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.jboss.shrinkwrap</groupId>
-            <artifactId>shrinkwrap-impl-base</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.jboss.shrinkwrap.descriptors</groupId>
-            <artifactId>shrinkwrap-descriptors-api-javaee</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.jboss.shrinkwrap.descriptors</groupId>
-            <artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-test-utils</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.hamcrest</groupId>
-            <artifactId>hamcrest-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.hamcrest</groupId>
-            <artifactId>hamcrest-library</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.easymock</groupId>
-            <artifactId>easymock</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-    </dependencies>
-
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-oozie/src/main/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-oozie/src/main/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor.java b/gateway-service-oozie/src/main/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor.java
deleted file mode 100644
index 4074209..0000000
--- a/gateway-service-oozie/src/main/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor.java
+++ /dev/null
@@ -1,128 +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.oozie;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.hadoop.gateway.deploy.DeploymentContext;
-import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributorBase;
-import org.apache.hadoop.gateway.descriptor.FilterParamDescriptor;
-import org.apache.hadoop.gateway.descriptor.ResourceDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRulesDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRulesDescriptorFactory;
-import org.apache.hadoop.gateway.topology.Service;
-
-public class OozieDeploymentContributor extends ServiceDeploymentContributorBase {
-
-  private static final String RULES_RESOURCE = OozieDeploymentContributor.class.getName().replace( '.', '/' ) + "/rewrite.xml";
-  private static final String EXTERNAL_PATH = "/oozie";
-  
-  private static final String REPLAY_BUFFER_SIZE_PARAM = "replayBufferSize";
-  
-  // Oozie replay buffer size in KB
-  private static final String OOZIW_REPLAY_BUFFER_SIZE = "8";
-
-  @Override
-  public String getRole() {
-    return "xOOZIE";
-  }
-
-  @Override
-  public String getName() {
-    return "xoozie";
-  }
-
-  @Override
-  public void contributeService( DeploymentContext context, Service service ) throws Exception {
-    //TODO: [sumit] remove once stacks is done KNOX-483
-//    contributeRewriteRules( context, service );
-//    contributeResources( context, service );
-  }
-
-  private void contributeRewriteRules( DeploymentContext context, Service service ) throws URISyntaxException, IOException {
-    UrlRewriteRulesDescriptor oozieRules = loadRulesFromTemplate();
-    UrlRewriteRulesDescriptor clusterRules = context.getDescriptor( "rewrite" );
-    clusterRules.addRules( oozieRules );
-  }
-
-  public void contributeResources( DeploymentContext context, Service service ) throws URISyntaxException {
-    ResourceDescriptor rootResource = context.getGatewayDescriptor().addResource();
-    rootResource.role( service.getRole() );
-    rootResource.pattern( EXTERNAL_PATH + "/**?**" );
-    addWebAppSecFilters(context, service, rootResource);
-    addAuthenticationFilter( context, service, rootResource );
-    addRewriteFilter( context, service, rootResource );
-    addIdentityAssertionFilter( context, service, rootResource );
-    addAuthorizationFilter(context, service, rootResource);
-    addDispatchFilter( context, service, rootResource );
-
-    ResourceDescriptor v1Resource = context.getGatewayDescriptor().addResource();
-    v1Resource.role( service.getRole() );
-    v1Resource.pattern( EXTERNAL_PATH + "/v1/**?**" );
-    addWebAppSecFilters(context, service, v1Resource);
-    addAuthenticationFilter( context, service, v1Resource );
-    addRewriteFilter( context, service, v1Resource );
-    addIdentityAssertionFilter( context, service, v1Resource );
-    addAuthorizationFilter(context, service, v1Resource);
-    addDispatchFilter( context, service, v1Resource );
-
-    ResourceDescriptor v2Resource = context.getGatewayDescriptor().addResource();
-    v2Resource.role( service.getRole() );
-    v2Resource.pattern( EXTERNAL_PATH + "/v2/**?**" );
-    addWebAppSecFilters(context, service, v2Resource);
-    addAuthenticationFilter( context, service, v2Resource );
-    addRewriteFilter( context, service, v2Resource );
-    addIdentityAssertionFilter( context, service, v2Resource );
-    addAuthorizationFilter(context, service, v2Resource);
-    addDispatchFilter( context, service, v2Resource );
-  }
-
-  private void addRewriteFilter(
-      DeploymentContext context, Service service, ResourceDescriptor resource ) throws URISyntaxException {
-    List<FilterParamDescriptor> params = new ArrayList<FilterParamDescriptor>();
-    params.add( resource.createFilterParam().name( "request.body" ).value( "OOZIE/oozie/configuration" ) );
-    context.contributeFilter( service, resource, "rewrite", null, params );
-  }
-
-  private void addDispatchFilter(DeploymentContext context, Service service,
-      ResourceDescriptor resource) {
-    //TODO: [sumit] set the filter params for dispatch in stacks
-    List<FilterParamDescriptor> filterParams = new ArrayList<FilterParamDescriptor>();
-    FilterParamDescriptor filterParamDescriptor = resource.createFilterParam();
-    filterParamDescriptor.name(REPLAY_BUFFER_SIZE_PARAM);
-    filterParamDescriptor.value(OOZIW_REPLAY_BUFFER_SIZE);
-    filterParams.add(filterParamDescriptor);
-    context.contributeFilter(service, resource, "dispatch", "http-client", filterParams);
-  }
-
-  UrlRewriteRulesDescriptor loadRulesFromTemplate() throws IOException {
-    InputStream stream = this.getClass().getClassLoader().getResourceAsStream( RULES_RESOURCE );
-    Reader reader = new InputStreamReader( stream );
-    UrlRewriteRulesDescriptor rules = UrlRewriteRulesDescriptorFactory.load( "xml", reader );
-    reader.close();
-    stream.close();
-    return rules;
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-oozie/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
----------------------------------------------------------------------
diff --git a/gateway-service-oozie/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor b/gateway-service-oozie/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
deleted file mode 100644
index cba4689..0000000
--- a/gateway-service-oozie/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
+++ /dev/null
@@ -1,19 +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.
-##########################################################################
-
-org.apache.hadoop.gateway.oozie.OozieDeploymentContributor

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml
----------------------------------------------------------------------
diff --git a/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml b/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml
deleted file mode 100644
index d3c52bb..0000000
--- a/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml
+++ /dev/null
@@ -1,122 +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.
--->
-<rules>
-
-    <rule dir="IN" name="OOZIE/oozie/root" pattern="*://*:*/**/oozie/{**}?{**}">
-        <rewrite template="{$serviceUrl[OOZIE]}/{**}?{**}"/>
-    </rule>
-
-    <rule dir="IN" name="OOZIE/oozie/v1" pattern="*://*:*/**/oozie/v1/{**}?{**}">
-        <rewrite template="{$serviceUrl[OOZIE]}/v1/{**}?{**}"/>
-    </rule>
-
-    <rule dir="IN" name="OOZIE/oozie/v2" pattern="*://*:*/**/oozie/v2/{**}?{**}">
-        <rewrite template="{$serviceUrl[OOZIE]}/v2/{**}?{**}"/>
-    </rule>
-
-    <rule name="OOZIE/oozie/user-name">
-        <rewrite template="{$username}"/>
-    </rule>
-
-    <rule name="OOZIE/oozie/name-node-url">
-        <rewrite template="hdfs://{$serviceMappedAddr[NAMENODE]}"/>
-    </rule>
-
-    <rule name="OOZIE/oozie/job-tracker-address">
-        <rewrite template="{$serviceMappedAddr[JOBTRACKER]}"/>
-    </rule>
-
-    <rule name="OOZIE/oozie/hdfs-path" flow="OR">
-        <match pattern="/~">
-            <rewrite template="hdfs://{$serviceMappedHost[NAMENODE]}:{$servicePort[NAMENODE]}/user/{$username}"/>
-        </match>
-        <match pattern="/~/{path=**}">
-            <rewrite template="hdfs://{$serviceMappedHost[NAMENODE]}:{$servicePort[NAMENODE]}/user/{$username}/{path=**}"/>
-        </match>
-        <match pattern="{path=**}">
-            <rewrite template="hdfs://{$serviceMappedHost[NAMENODE]}:{$servicePort[NAMENODE]}/{path=**}"/>
-        </match>
-    </rule>
-
-    <filter name="OOZIE/oozie/configuration">
-        <content type="*/xml">
-            <buffer path="/configuration/property">
-                <detect path="name" value="user.name">
-                    <apply path="value" rule="OOZIE/oozie/user-name"/>
-                </detect>
-                <detect path="name" value="nameNode">
-                    <apply path="value" rule="OOZIE/oozie/name-node-url"/>
-                </detect>
-                <detect path="name" value="jobTracker">
-                    <apply path="value" rule="OOZIE/oozie/job-tracker-address"/>
-                </detect>
-                <detect path="name" value="fs.default.name">
-                    <apply path="value" rule="OOZIE/oozie/name-node-url"/>
-                </detect>
-                <detect path="name" value="fs.defaultFS">
-                    <apply path="value" rule="OOZIE/oozie/name-node-url"/>
-                </detect>
-                <detect path="name" value="oozie.wf.application.path">
-                    <apply path="value" rule="OOZIE/oozie/hdfs-path"/>
-                </detect>
-                <detect path="name" value="oozie.coord.application.path">
-                    <apply path="value" rule="OOZIE/oozie/hdfs-path"/>
-                </detect>
-                <detect path="name" value="oozie.bundle.application.path">
-                    <apply path="value" rule="OOZIE/oozie/hdfs-path"/>
-                </detect>
-                <detect path="name" value="oozie.libpath">
-                    <apply path="value" rule="OOZIE/oozie/hdfs-path"/>
-                </detect>
-                <detect path="name" value="mapreduce.job.user.name">
-                    <apply path="value" rule="OOZIE/oozie/user-name"/>
-                </detect>
-                <detect path="name" value="mapred.job.tracker">
-                    <apply path="value" rule="OOZIE/oozie/job-tracker-address"/>
-                </detect>
-                <detect path="name" value="mapred.input.dir">
-                    <apply path="value" rule="OOZIE/oozie/hdfs-path"/>
-                </detect>
-                <detect path="name" value="inputDir">
-                    <apply path="value" rule="OOZIE/oozie/hdfs-path"/>
-                </detect>
-                <detect path="name" value="mapred.output.dir">
-                    <apply path="value" rule="OOZIE/oozie/hdfs-path"/>
-                </detect>
-                <detect path="name" value="outputDir">
-                    <apply path="value" rule="OOZIE/oozie/hdfs-path"/>
-                </detect>
-            </buffer>
-        </content>
-        <content type="*/json">
-            <apply path="$[user.name]" rule="OOZIE/oozie/user-name"/>
-            <apply path="$[nameNode]" rule="OOZIE/oozie/name-node-url"/>
-            <apply path="$[jobTracker]" rule="OOZIE/oozie/job-tracker-addr"/>
-            <apply path="$[fs.default.name]" rule="OOZIE/oozie/name-node-url"/>
-            <apply path="$[fs.defaultFS]" rule="OOZIE/oozie/name-node-url"/>
-            <apply path="$[oozie.wf.application.path]" rule="OOZIE/oozie/hdfs-path"/>
-            <apply path="$[oozie.coord.application.path]" rule="OOZIE/oozie/hdfs-path"/>
-            <apply path="$[oozie.bundle.application.path]" rule="OOZIE/oozie/hdfs-path"/>
-            <apply path="$[oozie.libpath]" rule="OOZIE/oozie/hdfs-path"/>
-            <apply path="$[mapreduce.job.user.name]" rule="OOZIE/oozie/user-name"/>
-            <apply path="$[mapred.job.tracker]" rule="OOZIE/oozie/job-tracker-address"/>
-            <apply path="$[mapred.input.dir]" rule="OOZIE/oozie/hdfs-path"/>
-            <apply path="$[mapred.output.dir]" rule="OOZIE/oozie/hdfs-path"/>
-        </content>
-    </filter>
-
-</rules>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-oozie/src/test/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributorTest.java
----------------------------------------------------------------------
diff --git a/gateway-service-oozie/src/test/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributorTest.java b/gateway-service-oozie/src/test/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributorTest.java
deleted file mode 100644
index fad79f0..0000000
--- a/gateway-service-oozie/src/test/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributorTest.java
+++ /dev/null
@@ -1,130 +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.oozie;
-
-import org.apache.hadoop.gateway.deploy.DeploymentContext;
-import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor;
-import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRulesDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.impl.UrlRewriteRulesDescriptorImpl;
-import org.apache.hadoop.gateway.topology.Service;
-import org.easymock.EasyMock;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.util.Iterator;
-import java.util.ServiceLoader;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.junit.Assert.fail;
-
-public class OozieDeploymentContributorTest {
-
-  @Test
-  public void testServiceLoader() throws Exception {
-    ServiceLoader loader = ServiceLoader.load( ServiceDeploymentContributor.class );
-    Iterator iterator = loader.iterator();
-    assertThat( "Service iterator empty.", iterator.hasNext() );
-    while( iterator.hasNext() ) {
-      Object object = iterator.next();
-      if( object instanceof OozieDeploymentContributor ) {
-        return;
-      }
-    }
-    fail( "Failed to find " + OozieDeploymentContributor.class.getName() + " via service loader." );
-  }
-
-  @Test
-  public void testLoadRulesFromTemplate() throws IOException, URISyntaxException {
-    WebArchive webArchive = ShrinkWrap.create( WebArchive.class, "test-archive" );
-
-    UrlRewriteRulesDescriptorImpl clusterRules = new UrlRewriteRulesDescriptorImpl();
-
-    DeploymentContext context = EasyMock.createNiceMock( DeploymentContext.class );
-    EasyMock.expect( context.getDescriptor( "rewrite" ) ).andReturn( clusterRules ).anyTimes();
-    EasyMock.expect( context.getWebArchive() ).andReturn( webArchive ).anyTimes();
-
-    Service service = EasyMock.createNiceMock( Service.class );
-    EasyMock.expect( service.getRole() ).andReturn( "OOZIE" ).anyTimes();
-    EasyMock.expect( service.getName() ).andReturn( null ).anyTimes();
-    EasyMock.expect( service.getUrl() ).andReturn( "http://test-host:777" ).anyTimes();
-
-    EasyMock.replay( context, service );
-
-    OozieDeploymentContributor contributor = new OozieDeploymentContributor();
-
-    UrlRewriteRulesDescriptor oozieRules = contributor.loadRulesFromTemplate();
-
-    assertThat( oozieRules, notNullValue() );
-    assertThat( oozieRules.getFilter( "OOZIE/oozie/configuration" ), notNullValue() );
-  }
-
-//  @Test
-//  public void testDeployment() throws Exception {
-//    WebArchive webArchive = ShrinkWrap.create( WebArchive.class, "test-archive" );
-//
-//    UrlRewriteRulesDescriptorImpl rewriteRules = new UrlRewriteRulesDescriptorImpl();
-//
-//    Map<String,String> serviceParams = new HashMap<String, String>();
-//    Service service = new Service();
-//    service.setRole( "OOZIE" );
-//    service.setName( "oozie" );
-//    service.setUrl( "http://test-host:42/test-path" );
-//    service.setParams( serviceParams );
-//
-//    Topology topology = new Topology();
-//    topology.setName( "test-topology" );
-//    topology.addService( service );
-//
-//    GatewayDescriptor gateway = EasyMock.createNiceMock( GatewayDescriptor.class );
-//    DeploymentContext context = EasyMock.createNiceMock( DeploymentContext.class );
-//    EasyMock.expect( context.getWebArchive() ).andReturn( webArchive ).anyTimes();
-//    EasyMock.expect( context.getDescriptor( "rewrite" ) ).andReturn( rewriteRules ).anyTimes();
-//    EasyMock.expect( context.getWebAppDescriptor() ).andReturn( Descriptors.create( WebAppDescriptor.class ) ).anyTimes();
-//    EasyMock.expect( context.getTopology() ).andReturn( topology ).anyTimes();
-//    EasyMock.expect( context.getGatewayDescriptor() ).andReturn( gateway ).anyTimes();
-//    Capture<Service> capturedService = new Capture<Service>();
-//    Capture<ResourceDescriptor> capturedResource = new Capture<ResourceDescriptor>();
-//    Capture<String> capturedRole = new Capture<String>();
-//    Capture<String> capturedName = new Capture<String>();
-//    Capture<List<FilterParamDescriptor>> capturedParams = new Capture<List<FilterParamDescriptor>>();
-//    context.contributeFilter( capture(capturedService) , capture(capturedResource), capture(capturedRole), capture(capturedName), capture(capturedParams) );
-//    EasyMock.expectLastCall().anyTimes();
-//    EasyMock.replay( gateway, context );
-//
-//    OozieDeploymentContributor contributor = new OozieDeploymentContributor();
-//
-//    assertThat( contributor.getRole(), CoreMatchers.is( "OOZIE" ) );
-//    assertThat( contributor.getName(), CoreMatchers.is( "oozie" ) );
-//
-//    // Just make sure it doesn't blow up.
-//    contributor.initializeContribution( context );
-//
-//    contributor.contributeService( context, service );
-//
-//    // Just make sure it doesn't blow up.
-//    contributor.finalizeContribution( context );
-//
-//    assertThat( capturedRole.getValue(), is( "dispatch" ) );
-//    assertThat( capturedName.getValue(), is( "http-client" ) );
-//  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/7cb3551b/gateway-service-webhcat/pom.xml
----------------------------------------------------------------------
diff --git a/gateway-service-webhcat/pom.xml b/gateway-service-webhcat/pom.xml
deleted file mode 100644
index 3f81cc4..0000000
--- a/gateway-service-webhcat/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?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/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.knox</groupId>
-        <artifactId>gateway</artifactId>
-        <version>0.6.0-SNAPSHOT</version>
-    </parent>
-    <artifactId>gateway-service-webhcat</artifactId>
-
-    <name>gateway-service-webhcat</name>
-    <description>The extension to the gateway for supporting WebHCat.</description>
-
-    <licenses>
-        <license>
-            <name>The Apache Software License, Version 2.0</name>
-            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
-            <distribution>repo</distribution>
-        </license>
-    </licenses>
-
-    <dependencies>
-        <dependency>
-            <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-spi</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-provider-rewrite</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-</project>
\ No newline at end of file


Mime
View raw message