Package net.tomp2p.p2p.builder

Examples of net.tomp2p.p2p.builder.RoutingBuilder


        builder.futureChannelCreator().addListener(new BaseFutureAdapter<FutureChannelCreator>() {
            @Override
            public void operationComplete(final FutureChannelCreator future) throws Exception {
                if (future.isSuccess()) {
                 
                  final RoutingBuilder routingBuilder = createBuilder(builder);
                  final FutureRouting futureRouting = routing.route(routingBuilder, Type.REQUEST_1, future.channelCreator());

                    futureDHT.futureRouting(futureRouting);
                    futureRouting.addListener(new BaseFutureAdapter<FutureRouting>() {
                        @Override
View Full Code Here


        putBuilder.futureChannelCreator().addListener(new BaseFutureAdapter<FutureChannelCreator>() {
            @Override
            public void operationComplete(final FutureChannelCreator future) throws Exception {
                if (future.isSuccess()) {
                 
                  final RoutingBuilder routingBuilder = createBuilder(putBuilder);
                  final FutureRouting futureRouting = routing.route(routingBuilder, Type.REQUEST_1, future.channelCreator());
                 
                    futureDHT.futureRouting(futureRouting);
                    futureRouting.addListener(new BaseFutureAdapter<FutureRouting>() {
                        @Override
View Full Code Here

        builder.futureChannelCreator().addListener(new BaseFutureAdapter<FutureChannelCreator>() {
            @Override
            public void operationComplete(final FutureChannelCreator future) throws Exception {
                if (future.isSuccess()) {
                 
                  final RoutingBuilder routingBuilder = createBuilder(builder);
                  fillRoutingBuilder(builder, routingBuilder);
                  final FutureRouting futureRouting = routing.route(routingBuilder, builder.isFastGet()? Type.REQUEST_2 : Type.REQUEST_1, future.channelCreator());

                    futureDHT.futureRouting(futureRouting);
                    futureRouting.addListener(new BaseFutureAdapter<FutureRouting>() {
View Full Code Here

        builder.futureChannelCreator().addListener(new BaseFutureAdapter<FutureChannelCreator>() {
            @Override
            public void operationComplete(final FutureChannelCreator future) throws Exception {
                if (future.isSuccess()) {
                 
                  final RoutingBuilder routingBuilder = createBuilder(builder);
                  fillRoutingBuilder(builder, routingBuilder);
                  final FutureRouting futureRouting = routing.route(routingBuilder, builder.isFastGet()? Type.REQUEST_2 : Type.REQUEST_1, future.channelCreator());
                   
                    futureDHT.futureRouting(futureRouting);
                    futureRouting.addListener(new BaseFutureAdapter<FutureRouting>() {
View Full Code Here

        builder.futureChannelCreator().addListener(new BaseFutureAdapter<FutureChannelCreator>() {
            @Override
            public void operationComplete(final FutureChannelCreator future) throws Exception {
                if (future.isSuccess()) {
                 
                  final RoutingBuilder routingBuilder = createBuilder(builder);
                    fillRoutingBuilder(builder, routingBuilder);
                  final FutureRouting futureRouting = routing.route(routingBuilder, builder.isFastGet() ? Type.REQUEST_2 : Type.REQUEST_1, future.channelCreator());

                    futureDHT.futureRouting(futureRouting);
                    futureRouting.addListener(new BaseFutureAdapter<FutureRouting>() {
View Full Code Here

            }
        });
    }
   
    private static RoutingBuilder createBuilder(BasicBuilder<?> builder) {
      RoutingBuilder routingBuilder = builder.createBuilder(builder.requestP2PConfiguration(),
                builder.routingConfiguration());
        routingBuilder.locationKey(builder.locationKey());
        routingBuilder.domainKey(builder.domainKey());
        routingBuilder.peerFilters(builder.peerFilters());
        return routingBuilder;
    }
View Full Code Here

                FutureChannelCreator fcc = peers[0].connectionBean().reservation().create(2, 0);
                fcc.awaitUninterruptibly();
                cc = fcc.channelCreator();
            }

            RoutingBuilder routingBuilder = new RoutingBuilder();
            if (tcp) {
                routingBuilder.forceTCP(true);
            }
            routingBuilder.locationKey(peers[6].peerID());
            routingBuilder.maxDirectHits(0);
            routingBuilder.setMaxNoNewInfo(0);
            routingBuilder.maxFailures(0);
            routingBuilder.maxSuccess(100);
            routingBuilder.parallel(2);

            FutureRouting fr = peers[0].distributedRouting().route(routingBuilder, request, cc);

            // new RoutingBuilder(peers[6].getPeerID(), null, null, 0, 0, 0, 100, 2, false), Type.REQUEST_2, cc);
            fr.awaitUninterruptibly();
View Full Code Here

                FutureChannelCreator fcc = peers[0].connectionBean().reservation().create(2, 0);
                fcc.awaitUninterruptibly();
                cc = fcc.channelCreator();
            }

            RoutingBuilder routingBuilder = new RoutingBuilder();
            if (tcp) {
                routingBuilder.forceTCP(true);
            }
            routingBuilder.locationKey(peers[6].peerID());
            routingBuilder.maxDirectHits(0);
            routingBuilder.setMaxNoNewInfo(0);
            routingBuilder.maxFailures(0);
            routingBuilder.maxSuccess(100);
            routingBuilder.parallel(2);

            FutureRouting fr = peers[0].distributedRouting().route(routingBuilder, request, cc);

            fr.awaitUninterruptibly();
            // do verification
View Full Code Here

   * routingConfiguration.getMaxSuccess(), routingConfiguration.getParallel(),
   * routingConfiguration.isForceTCP()), type, channelCreator); }
   */

  private FutureRouting createRouting(TrackerBuilder<?> builder, Type type, ChannelCreator channelCreator) {
    RoutingBuilder routingBuilder = builder.createBuilder(builder.routingConfiguration());
    routingBuilder.locationKey(builder.locationKey());
    routingBuilder.domainKey(builder.domainKey());
    routingBuilder.peerFilters(builder.peerFilters());
    return routing.route(routingBuilder, type, channelCreator);
  }
View Full Code Here

    }

    public abstract FutureTracker start();

    public RoutingBuilder createBuilder(RoutingConfiguration routingConfiguration2) {
        RoutingBuilder routingBuilder = new RoutingBuilder();
        routingBuilder.parallel(routingConfiguration.parallel());
        routingBuilder.setMaxNoNewInfo(routingConfiguration.maxNoNewInfo(0));
        routingBuilder.maxDirectHits(routingConfiguration.maxDirectHits());
        routingBuilder.maxFailures(routingConfiguration.maxFailures());
        routingBuilder.maxSuccess(routingConfiguration.maxSuccess());
        return routingBuilder;
    }
View Full Code Here

TOP

Related Classes of net.tomp2p.p2p.builder.RoutingBuilder

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.