Package org.apache.hadoop.gateway.descriptor

Examples of org.apache.hadoop.gateway.descriptor.FilterDescriptor


          replayBufferSize = paramDescriptor.value();
          break;
        }
      }
    }
    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl( HBaseHttpClientDispatch.class );
    filter.param().name("replayBufferSize").value(replayBufferSize);
    if( context.getGatewayConfig().isHadoopKerberosSecured() ) {
      filter.param().name("kerberos").value("true");
    }
  }
View Full Code Here


    return "jersey";
  }

  @Override
  public void contributeFilter( DeploymentContext context, Provider provider, Service service, ResourceDescriptor resource, List<FilterParamDescriptor> params ) {
    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl( FILTER_CLASS_NAME );
    if( params != null ) {
      for( FilterParamDescriptor param : params ) {
        filter.param().name( param.name() ).value( param.value() );
      }
    }
  }
View Full Code Here

    resource = resources.get( 0 );
    assertThat( resource.role(), is( "test-service-role" ) );
    assertThat( resource.pattern(), is( "test-service/?**" ) );
    List<FilterDescriptor> filters = resource.filters();
    assertThat( filters.size(), is( 1 ) );
    FilterDescriptor filter = filters.get( 0 );
    assertThat( filter.role(), is( "pivot") );
    assertThat( filter.name(), is( "jersey" ) );
    assertThat( filter.impl(), is( "org.glassfish.jersey.servlet.ServletContainer" ) );
    List<FilterParamDescriptor> params = filter.params();
    assertThat( params.size(), is( 1 ) );
    FilterParamDescriptor param = params.get( 0 );
    assertThat( param.name(), is( "jersey.config.server.provider.packages" ) );
    assertThat( param.value(), is( "test-package-1;test-package-2"  ) );

    resource = resources.get( 1 );
    assertThat( resource.role(), is( "test-service-role" ) );
    assertThat( resource.pattern(), is( "test-service/**?**" ) );
    filters = resource.filters();
    assertThat( filters.size(), is( 1 ) );
    filter = filters.get( 0 );
    assertThat( filter.role(), is( "pivot") );
    assertThat( filter.name(), is( "jersey" ) );
    assertThat( filter.impl(), is( "org.glassfish.jersey.servlet.ServletContainer" ) );
    params = filter.params();
    assertThat( params.size(), is( 1 ) );
    param = params.get( 0 );
    assertThat( param.name(), is( "jersey.config.server.provider.packages" ) );
    assertThat( param.value(), is( "test-package-1;test-package-2"  ) );
  }
View Full Code Here

      Service service,
      ResourceDescriptor resource,
      List<FilterParamDescriptor> params ) {
    String filterClassName = getFilterClassName( provider.getParams() );
    if( filterClassName != null ) {
      FilterDescriptor filter = resource.addFilter();
      filter.name( getName() );
      filter.role( provider.getRole() );
      filter.impl( filterClassName );
      filter.params( getFilterInitParams( filter, provider.getParams(), params ) );
    }
  }
View Full Code Here

          replayBufferSize = paramDescriptor.value();
          break;
        }
      }
    }
    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl( HttpClientDispatch.class );
    filter.param().name("replayBufferSize").value(replayBufferSize);
    if( context.getGatewayConfig().isHadoopKerberosSecured() ) {
      filter.param().name("kerberos").value("true");
    }
  }
View Full Code Here

          replayBufferSize = paramDescriptor.value();
          break;
        }
      }
    }
    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl( HiveHttpClientDispatch.class );
    filter.param().name("replayBufferSize").value(replayBufferSize);
    if( context.getGatewayConfig().isHadoopKerberosSecured() ) {
      filter.param().name("kerberos").value("true");
    }
    else {
      filter.param().name("basicAuthPreemptive").value("true");
    }
  }
View Full Code Here

    return filters;
  }

  @Override
  public FilterDescriptor addFilter() {
    FilterDescriptor filter = createFilter();
    addFilter( filter );
    return filter;
  }
View Full Code Here

    assertThat( resource1, notNullValue() );
    assertThat( resource1.pattern(), is( "resource1-source" ) );

    assertThat( resource1.filters().size(), is( 2 ) );

    FilterDescriptor filter1 = resource1.filters().get( 0 );
    assertThat( filter1, notNullValue() );
    assertThat( filter1.role(), is( "resource1-filter1-role" ) );
    assertThat( filter1.impl(), is( "resource1-filter1-impl" ) );

    assertThat( filter1.params().size(), is( 2 ) );

    FilterParamDescriptor param1 = filter1.params().get( 0 );
    assertThat( param1, notNullValue() );
    assertThat( param1.name(), is( "resource1-filter1-param1-name" ) );
    assertThat( param1.value(), is( "resource1-filter1-param1-value" ) );

    FilterParamDescriptor param2 = filter1.params().get( 1 );
    assertThat( param2, notNullValue() );
    assertThat( param2.name(), is( "resource1-filter1-param2-name" ) );
    assertThat( param2.value(), is( "resource1-filter1-param2-value" ) );

    FilterDescriptor filter2 = resource1.filters().get( 1 );
    assertThat( filter2, notNullValue() );
    assertThat( filter2.role(), is( "resource1-filter2-role" ) );
    assertThat( filter2.impl(), is( "resource1-filter2-impl" ) );

    ResourceDescriptor resource2 = descriptor.resources().get( 1 );
    assertThat( resource2, notNullValue() );
    assertThat( resource2.pattern(), is( "resource2-source" ) );
  }
View Full Code Here

    assertThat( descriptor, notNullValue() );
    assertThat( descriptor.resources().size(), is( 1 ) );
    ResourceDescriptor resource1 = descriptor.resources().get( 0 );
    assertThat( resource1, notNullValue() );
    assertThat( resource1.filters().size(), is( 1 ) );
    FilterDescriptor filter1 = resource1.filters().get( 0 );
    assertThat( filter1, notNullValue() );
    assertThat( filter1.params().size(), is( 1 ) );
    FilterParamDescriptor param1 = filter1.params().get( 0 );
    assertThat( param1, notNullValue() );
  }
View Full Code Here

          replayBufferSize = paramDescriptor.value();
          break;
        }
      }
    }
    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl( HttpClientDispatch.class );
    filter.param().name("replayBufferSize").value(replayBufferSize);
    if( context.getGatewayConfig().isHadoopKerberosSecured() ) {
      filter.param().name("kerberos").value("true");
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.gateway.descriptor.FilterDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.