Package org.apache.hadoop.gateway.topology

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


    Service service = new Service();
    service.setRole( "WEBHDFS" );
    service.addUrl( "http://localhost:50070/test-service-url" );
    topology.addService( service );

    Provider provider = new Provider();
    provider.setRole( "authentication" );
    provider.setName( "generic" );
    provider.setEnabled( true );
    Param param = new Param();
    param.setName( "filter" );
    param.setValue( "org.opensource.ExistingFilter" );
    provider.addParam( param );
    param = new Param();
    param.setName( "test-param-name" );
    param.setValue( "test-param-value" );
    provider.addParam( param );
    topology.addProvider( provider );

    WebArchive war = DeploymentFactory.createDeployment( config, topology );

    Document gateway = parse( war.get( "WEB-INF/gateway.xml" ).getAsset().openStream() );
View Full Code Here


    Service service = new Service();
    service.setRole( "WEBHDFS" );
    service.addUrl( "http://localhost:50070/test-service-url" );
    topology.addService( service );

    Provider provider = new Provider();
    provider.setRole( "authentication" );
    provider.setName( "generic" );
    provider.setEnabled( true );
    Param param; // = new ProviderParam();
    // Missing filter param.
    //param.setName( "filter" );
    //param.setValue( "org.opensource.ExistingFilter" );
    //provider.addParam( param );
    param = new Param();
    param.setName( "test-param-name" );
    param.setValue( "test-param-value" );
    provider.addParam( param );
    topology.addProvider( provider );

    Enumeration<Appender> appenders = NoOpAppender.setUp();
    try {
      DeploymentFactory.createDeployment( config, topology );
View Full Code Here

    topology.setName( "test-cluster" );
    Service service = new Service();
    service.setRole( "WEBHDFS" );
    service.addUrl( "http://localhost:50070/webhdfs" );
    topology.addService( service );
    Provider provider = new Provider();
    provider.setRole( "authentication" );
    provider.setName( "ShiroProvider" );
    provider.setEnabled( true );
    Param param = new Param();
    param.setName( "contextConfigLocation" );
    param.setValue( "classpath:app-context-security.xml" );
    provider.addParam( param );
    topology.addProvider( provider );
    Provider asserter = new Provider();
    asserter.setRole( "identity-assertion" );
    asserter.setName("Default");
    asserter.setEnabled( true );
    topology.addProvider( asserter );
    Provider authorizer = new Provider();
    authorizer.setRole( "authorization" );
    authorizer.setName("AclsAuthz");
    authorizer.setEnabled( true );
    topology.addProvider( authorizer );

    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

      topology.setName("test-cluster");
      Service service = new Service();
      service.setRole("WEBHDFS");
      service.addUrl("http://localhost:50070/webhdfs");
      topology.addService(service);
      Provider provider = new Provider();
      provider.setRole("authentication");
      provider.setName("ShiroProvider");
      provider.setEnabled(true);
      Param param = new Param();
      param.setName("contextConfigLocation");
      param.setValue("classpath:app-context-security.xml");
      provider.addParam(param);
      topology.addProvider(provider);
      Provider asserter = new Provider();
      asserter.setRole("identity-assertion");
      asserter.setName("Default");
      asserter.setEnabled(true);
      topology.addProvider(asserter);
      Provider authorizer = new Provider();
      authorizer.setRole("authorization");
      authorizer.setName("AclsAuthz");
      authorizer.setEnabled(true);
      topology.addProvider(authorizer);
      Provider ha = new Provider();
      ha.setRole("ha");
      ha.setName("HaProvider");
      ha.setEnabled(true);
      topology.addProvider(ha);

      for (int i = 0; i < 100; i++) {
         createAndTestDeployment(config, topology);
      }
View Full Code Here

    WebArchive webArchive = ShrinkWrap.create( WebArchive.class, "test-archive" );

    Topology topology = new Topology();
    topology.setName( "test-topology" );
    Provider provider = new Provider();
    provider.setRole( "pivot" );
    provider.setName( "jersey" );
    provider.setEnabled( true );
    topology.addProvider( provider );

    GatewayDescriptor descriptor = GatewayDescriptorFactory.create();

    DeploymentContext context = EasyMock.createNiceMock( DeploymentContext.class );
View Full Code Here

    topology.setName( "test-cluster" );
    Service service = new Service();
    service.setRole( "WEBHDFS" );
    service.setUrl( "http://localhost:50070/webhdfs" );
    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 );
    Provider asserter = new Provider();
    asserter.setRole( "identity-assertion" );
    asserter.setName("Pseudo");
    asserter.setEnabled( true );
    topology.addProvider( asserter );
    Provider authorizer = new Provider();
    authorizer.setRole( "authorization" );
    authorizer.setName("AclsAuthz");
    authorizer.setEnabled( true );
    topology.addProvider( authorizer );

    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

    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( 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

  public void finalizeContribution( DeploymentContext context ) {
    // Noop.
  }

  protected boolean topologyContainsProviderType(DeploymentContext context, String role) {
    Provider provider = getProviderByRole(context, role);
    return (provider != null);
  }
View Full Code Here

    Provider provider = getProviderByRole(context, role);
    return (provider != null);
  }
 
  protected Provider getProviderByRole(DeploymentContext context, String role) {
    Provider p = null;
    Collection<Provider> providers = context.getTopology().getProviders();
    for (Provider provider : providers) {
      if (role.equals(provider.getRole())) {
        p = provider;
        break;
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.