Package org.apache.hadoop.gateway.topology

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


         e.printStackTrace(); // I18N not required.
      }

      Topology topology = new Topology();
      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);
View Full Code Here


    AuthenicationProvider.addParam(ldapRealmContext);
    AuthenicationProvider.addParam(ldapURL);
    AuthenicationProvider.addParam(ldapUserTemplate);
    AuthenicationProvider.addParam(authcBasic);

    Service testService = new Service();
    testService.setRole("test-service-role");

    topology.addProvider(AuthenicationProvider);
    topology.addProvider(identityProvider);
    topology.addService(testService);
    topology.setTimestamp(System.nanoTime());
View Full Code Here

    // Just make sure they don't blow up.
    providerContributor.initializeContribution( context );
    serviceContributor.initializeContribution( context );

    Service service = new Service();
    service.setRole( "test-service-role" );
    service.setName( "test-service-name" );
    service.addUrl( "http://test-service-host:777/test-service-path" );

    // This should end up calling providerContributor.contributeFilter
    serviceContributor.contributeService( context, service );
    ResourceDescriptor resource = context.getGatewayDescriptor().resources().get( 0 );
View Full Code Here

      e.printStackTrace(); // I18N not required.
    }

    Topology topology = new Topology();
    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();
View Full Code Here

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

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

    assertThat( topology.getName(), is( "topology2" ) );
    assertThat( topology.getTimestamp(), is( file.lastModified() ) );
    assertThat( topology.getServices().size(), is( 4 ) );
    assertThat( topology.getProviders().size(), is( 2 ) );

    Service webhdfsService = topology.getService( "WEBHDFS", null );
    assertThat( webhdfsService, notNullValue() );
    assertThat( webhdfsService.getRole(), is( "WEBHDFS" ) );
    assertThat( webhdfsService.getName(), nullValue() );
    assertThat( webhdfsService.getUrl(), is( "http://host:50070/webhdfs" ) );

    Service webhcatService = topology.getService( "WEBHCAT", null );
    assertThat( webhcatService, notNullValue() );
    assertThat( webhcatService.getRole(), is( "WEBHCAT" ) );
    assertThat( webhcatService.getName(), nullValue() );
    assertThat( webhcatService.getUrl(), is( "http://host:50111/templeton" ) );

    Service oozieService = topology.getService( "OOZIE", null );
    assertThat( oozieService, notNullValue() );
    assertThat( oozieService.getRole(), is( "OOZIE" ) );
    assertThat( oozieService.getName(), nullValue() );
    assertThat( oozieService.getUrl(), is( "http://host:11000/oozie" ) );

    Service hiveService = topology.getService( "HIVE", null );
    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" ) );
View Full Code Here

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

        Service service = topology.getService(serviceRole, serviceName);
        if (service == null) {
            service = new Service();
            service.setName(serviceName);
            service.setRole(serviceRole);
            topology.addService(service);
        }

        if (SERVICE_URL.equalsIgnoreCase(nextToken)) {
            service.setUrl( value );
        } else {
            throw new InterpretException(gatewayResources.unsupportedPropertyTokenError(token));
        }
    }
View Full Code Here

    DeploymentContext context = EasyMock.createNiceMock( DeploymentContext.class );
    EasyMock.expect( context.getDescriptor( "rewrite" ) ).andReturn( clusterRules ).anyTimes();
    EasyMock.expect( context.getWebArchive() ).andReturn( webArchive ).anyTimes();

    Service service = EasyMock.createNiceMock( Service.class );
    EasyMock.expect( service.getRole() ).andReturn( "OOZIE" ).anyTimes();
    EasyMock.expect( service.getName() ).andReturn( null ).anyTimes();
    EasyMock.expect( service.getUrl() ).andReturn( "http://test-host:777" ).anyTimes();

    EasyMock.replay( context, service );

    OozieDeploymentContributor contributor = new OozieDeploymentContributor();
View Full Code Here

    DeploymentContext context = EasyMock.createNiceMock( DeploymentContext.class );
    EasyMock.expect( context.getDescriptor( "rewrite" ) ).andReturn( rules ).anyTimes();
    EasyMock.expect( context.getWebArchive() ).andReturn( webArchive ).anyTimes();

    Service service = EasyMock.createNiceMock( Service.class );
    EasyMock.expect( service.getRole() ).andReturn( "OOZIE" ).anyTimes();
    EasyMock.expect( service.getName() ).andReturn( null ).anyTimes();
    EasyMock.expect( service.getUrl() ).andReturn( "http://test-host:777" ).anyTimes();

    EasyMock.replay( context, service );

    OozieDeploymentContributor contributor = new OozieDeploymentContributor();
    assertThat( contributor.getRole(), is( "OOZIE" ) );
View Full Code Here

TOP

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

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.