Package org.apache.hadoop.gateway.hostmap.api

Examples of org.apache.hadoop.gateway.hostmap.api.HostmapFunctionDescriptor


  @Override
  public void contributeProvider( DeploymentContext context, Provider provider ) {
    if( provider.isEnabled() ) {
      UrlRewriteRulesDescriptor rules = context.getDescriptor( REWRITE_ROLE_NAME );
      if( rules != null ) {
        HostmapFunctionDescriptor func = rules.addFunction( HostmapFunctionDescriptor.FUNCTION_NAME );
        if( func != null ) {
          Asset asset = createAsset( provider );
          context.getWebArchive().addAsWebInfResource(
              asset, HostmapFunctionProcessor.DESCRIPTOR_DEFAULT_FILE_NAME );
          func.config( HostmapFunctionProcessor.DESCRIPTOR_DEFAULT_LOCATION );
        }
      }
    }
  }
View Full Code Here


    // Just make sure it doesn't blow up.
    contributor.initializeContribution( context );

    contributor.contributeProvider( context, provider );

    HostmapFunctionDescriptor funcDesc = rewriteRules.getFunction( "hostmap" );
    assertThat( funcDesc.config(), is( "/WEB-INF/hostmap.txt" ) );

    Node node = webArchive.get( "/WEB-INF/hostmap.txt" );
    String asset = IOUtils.toString( node.getAsset().openStream() );
    assertThat( asset, containsString( "test-host-external=test-host-internal" ) );
View Full Code Here

  @Override
  public void contributeProvider( DeploymentContext context, Provider provider ) {
    if( provider.isEnabled() ) {
      UrlRewriteRulesDescriptor rules = context.getDescriptor( REWRITE_ROLE_NAME );
      if( rules != null ) {
        HostmapFunctionDescriptor func = rules.addFunction( HostmapFunctionDescriptor.FUNCTION_NAME );
        if( func != null ) {
          Asset asset = createAsset( provider );
          context.getWebArchive().addAsWebInfResource(
              asset, HostmapFunctionProcessor.DESCRIPTOR_DEFAULT_FILE_NAME );
          func.config( HostmapFunctionProcessor.DESCRIPTOR_DEFAULT_LOCATION );
        }
      }
    }
  }
View Full Code Here

    // Just make sure it doesn't blow up.
    contributor.initializeContribution( context );

    contributor.contributeProvider( context, provider );

    HostmapFunctionDescriptor funcDesc = rewriteRules.getFunction( "hostmap" );
    assertThat( funcDesc.config(), is( "/WEB-INF/hostmap.txt" ) );

    Node node = webArchive.get( "/WEB-INF/hostmap.txt" );
    String asset = IOUtils.toString( node.getAsset().openStream() );
    assertThat( asset, containsString( "test-host-external=test-host-internal" ) );
View Full Code Here

TOP

Related Classes of org.apache.hadoop.gateway.hostmap.api.HostmapFunctionDescriptor

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.