Package org.apache.hadoop.gateway.topology

Examples of org.apache.hadoop.gateway.topology.Provider


    UrlRewriteRulesDescriptorImpl rewriteRules = new UrlRewriteRulesDescriptorImpl();

    Map<String,String> providerParams = new HashMap<String, String>();
    providerParams.put( "test-host-external", "test-host-internal" );
    Provider provider = new Provider();
    provider.setEnabled( true );
    provider.setName( "hostmap" );
    provider.setParamsproviderParams );

    DeploymentContext context = EasyMock.createNiceMock( DeploymentContext.class );
    EasyMock.expect( context.getDescriptor( "rewrite" ) ).andReturn( rewriteRules ).anyTimes();
    EasyMock.expect( context.getWebArchive() ).andReturn( webArchive ).anyTimes();
    EasyMock.replay( context );
View Full Code Here


  @Override
  public void contributeFilter(DeploymentContext context, Provider provider, Service service,
      ResourceDescriptor resource, List<FilterParamDescriptor> params) {
   
    Provider webappsec = context.getTopology().getProvider(ROLE, NAME);
    if (webappsec != null && webappsec.isEnabled()) {
      Map<String,String> map = provider.getParams();
      String csrfEnabled = map.get(CSRF_ENABLED);
      if (params == null) {
        params = new ArrayList<FilterParamDescriptor>();
      }
View Full Code Here

        if (providerName != null && providerName.isEmpty()) {
            providerName = null;
        }
        nextToken = nextToken.substring(dotPosition + 1);

        Provider provider = topology.getProvider(providerRole, providerName);
        if (provider == null) {
            provider = new Provider();
            provider.setName(providerName);
            provider.setRole(providerRole);
            topology.addProvider(provider);
        }

        if (PROVIDER_ENABLED.equalsIgnoreCase(nextToken)) {
            provider.setEnabled(Boolean.valueOf(value));
        } else {
            dotPosition = nextToken.indexOf(DOT);
            if (dotPosition != -1) {
                String aggregator = nextToken.substring(0, dotPosition);
                nextToken = nextToken.substring(dotPosition + 1);
View Full Code Here

    Service comp = topology.getServices().iterator().next();
    assertThat( comp, notNullValue() );
    assertThat( comp.getRole(), is( "WEBHDFS" ) );
    assertThat( comp.getUrl(), is( "http://host:80/webhdfs" ) );

    Provider provider = topology.getProviders().iterator().next();
    assertThat( provider, notNullValue() );
    assertThat( provider.isEnabled(), is(true) );
    assertThat( provider.getRole(), is( "authentication" ) );
    assertThat( provider.getParams().size(), is(5));
  }
View Full Code Here

    assertThat( topology.getName(), is( "test-topology-name" ) );
    assertThat( topology.getTimestamp(), is( file.lastModified() ) );
    assertThat( topology.getServices().size(), is( 1 ) );

    Provider provider = topology.getProviders().iterator().next();
    assertThat( provider, notNullValue() );
    assertThat( provider.getRole(), is( "test-provider-role" ) );
    assertThat( provider.getName(), is( "test-provider-name" ) );
    assertThat( provider.getParams(), hasEntry( is( "test-provider-param-name-1" ), is( "test-provider-param-value-1" ) ) );
    assertThat( provider.getParams(), hasEntry( is( "test-provider-param-name-2" ), is( "test-provider-param-value-2" ) ) );

    Service service = topology.getServices().iterator().next();
    assertThat( service, notNullValue() );
    assertThat( service.getRole(), is( "test-service-role" ) );
    assertThat( service.getUrl(), is( "test-service-scheme://test-service-host:42/test-service-path" ) );
View Full Code Here

    assertThat( hiveService, notNullValue() );
    assertThat( hiveService.getRole(), is( "HIVE" ) );
    assertThat( hiveService.getName(), nullValue() );
    assertThat( hiveService.getUrl(), is( "http://host:10000" ) );

    Provider authenticationProvider = topology.getProvider( "authentication", "ShiroProvider" );
    assertThat( authenticationProvider, notNullValue() );
    assertThat( authenticationProvider.isEnabled(), is( true ) );
    assertThat( authenticationProvider.getRole(), is( "authentication" ) );
    assertThat( authenticationProvider.getName(), is( "ShiroProvider" ) );
    assertThat( authenticationProvider.getParams().size(), is( 5 ) );
    assertThat( authenticationProvider.getParams().get("main.ldapRealm.contextFactory.url"), is( "ldap://localhost:33389" ) );

    Provider identityAssertionProvider = topology.getProvider( "identity-assertion", "Pseudo" );
    assertThat( identityAssertionProvider, notNullValue() );
    assertThat( identityAssertionProvider.isEnabled(), is( false ) );
    assertThat( identityAssertionProvider.getRole(), is( "identity-assertion" ) );
    assertThat( identityAssertionProvider.getName(), is( "Pseudo" ) );
    assertThat( identityAssertionProvider.getParams().size(), is( 2 ) );
    assertThat( identityAssertionProvider.getParams().get("name"), is( "user.name" ) );
  }
View Full Code Here

    assertThat( topology.getName(), is( "test-topology-name" ) );
    assertThat( topology.getTimestamp(), is( file.lastModified() ) );

    assertThat( topology.getProviders().size(), is( 1 ) );
    Provider provider = topology.getProviders().iterator().next();
    assertThat( provider, notNullValue() );
    assertThat( provider.getRole(), is( "test-provider-role" ) );
    assertThat( provider.getName(), is( "test-provider-name" ) );
    assertThat( provider.isEnabled(), is( true ) );
    assertThat( provider.getParams(), hasEntry( is( "test-provider-param-name-1" ), is( "test-provider-param-value-1" ) ) );
    assertThat( provider.getParams(), hasEntry( is( "test-provider-param-name-2" ), is( "test-provider-param-value-2" ) ) );

    assertThat( topology.getServices().size(), is( 1 ) );
    Service service = topology.getServices().iterator().next();
    assertThat( service, notNullValue() );
    assertThat( service.getRole(), is( "test-service-role" ) );
View Full Code Here

//    UrlRewriteRulesDescriptorImpl rewriteRules = new UrlRewriteRulesDescriptorImpl();

    Map<String,String> providerParams = new HashMap<String, String>();
//    providerParams.put( "test-host-external", "test-host-internal" );
    Provider provider = new Provider();
    provider.setEnabled( true );
    provider.setName( "secure-query" );
    provider.setParamsproviderParams );

    Topology topology = new Topology();
    topology.setName("Sample");
   
    DeploymentContext context = EasyMock.createNiceMock( DeploymentContext.class );
View Full Code Here

    Service comp = topology.getServices().iterator().next();
    assertThat( comp, notNullValue() );
    assertThat( comp.getRole(), is( "NAMENODE" ) );
    assertThat( comp.getUrl(), is( new URL( "http://host:80/webhdfs/v1" ) ) );

    Provider provider = topology.getProviders().iterator().next();
    assertThat( provider, notNullValue() );
    assertThat( provider.isEnabled(), is(true) );
    assertThat( provider.getRole(), is( "authentication" ) );
    assertThat( provider.getParams().size(), is(5));
  }
View Full Code Here

    topology.setName( "test-cluster" );
    Service service = new Service();
    service.setRole( "NAMENODE" );
    service.setUrl( new URL( "http://localhost:50070/webhdfs/v1" ) );
    topology.addService( service );
    Provider provider = new Provider();
    provider.setRole( "authentication" );
    provider.setEnabled( true );
    ProviderParam param = new ProviderParam();
    param.setName( "contextConfigLocation" );
    param.setValue( "classpath:app-context-security.xml" );
    provider.addParam( param );
    topology.addProvider( provider );

    WebArchive war = DeploymentFactory.createDeployment( config, topology );
    //File dir = new File( System.getProperty( "user.dir" ) );
    //File file = war.as( ExplodedExporter.class ).exportExploded( dir, "test-cluster.war" );
View Full Code Here

TOP

Related Classes of org.apache.hadoop.gateway.topology.Provider

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.