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.setUrl( "http://localhost:50070/test-service-url" );
    topology.addService( service );

    Provider provider = new Provider();
    provider.setRole( "authentication" );
    provider.setName( "generic" );
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/test-service-url" );
    topology.addService( service );

    Provider provider = new Provider();
    provider.setRole( "authentication" );
    provider.setName( "generic" );
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 );
    Param param = new Param();
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.setUrl( "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

        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 {
          dotPosition = nextToken.indexOf(DOT);
          if (dotPosition != -1) {
            String aggregator = nextToken.substring(0, dotPosition);
            nextToken = nextToken.substring(dotPosition + 1);
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

    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( 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" ) );
    assertThat( service.getName(), is( "test-service-name" ) );
    assertThat( service.getParams(), hasEntry( is( "test-service-param-name-1" ), is( "test-service-param-value-1" ) ) );
    assertThat( service.getParams(), hasEntry( is( "test-service-param-name-2" ), is( "test-service-param-value-2" ) ) );
  }
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

    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" ) );
    assertThat( service.getUrl(), is( "test-service-scheme://test-service-host:42/test-service-path" ) );
    assertThat( service.getName(), is( "test-service-name" ) );
    assertThat( service.getParams(), hasEntry( is( "test-service-param-name-1" ), is( "test-service-param-value-1" ) ) );
    assertThat( service.getParams(), hasEntry( is( "test-service-param-name-2" ), is( "test-service-param-value-2" ) ) );
  }
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.