Package org.apache.hadoop.gateway.descriptor

Examples of org.apache.hadoop.gateway.descriptor.ResourceDescriptor.pattern()


    rewrite = rule.addStep( "rewrite" );
    rewrite.template( service.getUrl().toExternalForm() + "/{path=**}?{**}" );

    ResourceDescriptor resource = context.getGatewayDescriptor().addResource();
    resource.role( service.getRole() );
    resource.pattern( TEMPLETON_EXTERNAL_PATH + "/**?**" );
    if (topologyContainsProviderType(context, "authentication")) {
      context.contributeFilter( service, resource, "authentication", null, null );
    }
    if (topologyContainsProviderType(context, "federation")) {
      context.contributeFilter( service, resource, "federation", null, null );
View Full Code Here


  private void contributeResource( DeploymentContext context, Service service, String pattern, Map<String, String> filterParams ) throws URISyntaxException {
    List<FilterParamDescriptor> params = new ArrayList<FilterParamDescriptor>();
    ResourceDescriptor resource = context.getGatewayDescriptor().addResource();
    resource.role( service.getRole() );
    resource.pattern( pattern );
    addWebAppSecFilters( context, service, resource );
    addAuthenticationFilter( context, service, resource );
    addIdentityAssertionFilter( context, service, resource );
    addAuthorizationFilter( context, service, resource );
    if ( filterParams != null ) {
View Full Code Here

  public void contributeNameNodeResource( DeploymentContext context, Service service ) throws URISyntaxException {
    List<FilterParamDescriptor> params;
    ResourceDescriptor rootResource = context.getGatewayDescriptor().addResource();
    rootResource.role( service.getRole() );
    rootResource.pattern( WEBHDFS_EXTERNAL_PATH + "/?**" );
    addWebAppSecFilters(context, service, rootResource);
    addAuthenticationFilter( context, service, rootResource );
    params = new ArrayList<FilterParamDescriptor>();
    params.add( rootResource.createFilterParam().
        name( UrlRewriteServletFilter.REQUEST_URL_RULE_PARAM ).value( getQualifiedName() + "/inbound/namenode/root" ) );
View Full Code Here

    String dispatchRole = "dispatch";
    addDispatchFilter( context, service, rootResource, dispatchRole, dispatchName );

    ResourceDescriptor fileResource = context.getGatewayDescriptor().addResource();
    fileResource.role( service.getRole() );
    fileResource.pattern( WEBHDFS_EXTERNAL_PATH + "/**?**" );
    addWebAppSecFilters(context, service, fileResource);
    addAuthenticationFilter( context, service, fileResource );
    params = new ArrayList<FilterParamDescriptor>();
    params.add( fileResource.createFilterParam().
        name( UrlRewriteServletFilter.REQUEST_URL_RULE_PARAM ).value( getQualifiedName() + "/inbound/namenode/file" ) );
View Full Code Here

    addAuthorizationFilter( context, service, fileResource );
    addDispatchFilter( context, service, fileResource, dispatchRole, dispatchName );

    ResourceDescriptor homeResource = context.getGatewayDescriptor().addResource();
    homeResource.role( service.getRole() );
    homeResource.pattern( WEBHDFS_EXTERNAL_PATH + "/~?**" );
    addWebAppSecFilters(context, service, homeResource);
    addAuthenticationFilter( context, service, homeResource );
    params = new ArrayList<FilterParamDescriptor>();
    params.add( homeResource.createFilterParam().
        name( UrlRewriteServletFilter.REQUEST_URL_RULE_PARAM ).value( getQualifiedName() + "/inbound/namenode/home" ) );
View Full Code Here

    addAuthorizationFilter( context, service, homeResource );
    addDispatchFilter( context, service, homeResource, dispatchRole, dispatchName );

    ResourceDescriptor homeFileResource = context.getGatewayDescriptor().addResource();
    homeFileResource.role( service.getRole() );
    homeFileResource.pattern( WEBHDFS_EXTERNAL_PATH + "/~/**?**" );
    addWebAppSecFilters(context, service, homeFileResource);
    addAuthenticationFilter( context, service, homeFileResource );
    params = new ArrayList<FilterParamDescriptor>();
    params.add( homeFileResource.createFilterParam().
        name( UrlRewriteServletFilter.REQUEST_URL_RULE_PARAM ).value( getQualifiedName() + "/inbound/namenode/home/file" ) );
View Full Code Here

  public void contributeDataNodeResource( DeploymentContext context, Service service ) throws URISyntaxException {
    List<FilterParamDescriptor> params;
    ResourceDescriptor fileResource = context.getGatewayDescriptor().addResource();
    fileResource.role( service.getRole() );
    fileResource.pattern( DATANODE_EXTERNAL_PATH + "/**?**" );
    addWebAppSecFilters(context, service, fileResource);
    addAuthenticationFilter( context, service, fileResource );
    addIdentityAssertionFilter( context, service, fileResource );
    addAuthorizationFilter( context, service, fileResource );
    params = new ArrayList<FilterParamDescriptor>();
View Full Code Here

    List<ResourceDescriptor> resources = context.getGatewayDescriptor().resources();
    assertThat( resources.size(), is( 2 ) );

    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" ) );
View Full Code Here

    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" ) );
View Full Code Here

  public void contributeService( DeploymentContext context, Service service ) throws Exception {
    String packages = StringUtils.join( getPackages(), ";" );
    for( String pattern : getPatterns() ) {
      ResourceDescriptor resource = context.getGatewayDescriptor().addResource();
      resource.role( service.getRole() );
      resource.pattern( pattern );
      addAuthenticationFilter( context, service, resource );
      addIdentityAssertionFilter( context, service, resource );
      addAuthorizationFilter( context, service, resource );
      // addRewriteFilter( context, service, resource, null );
      List<FilterParamDescriptor> params = new ArrayList<FilterParamDescriptor>();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.