Examples of peer()


Examples of net.tomp2p.dht.PeerDHT.peer()

      }

      // Test setting up relay peers
      unreachablePeer = new PeerBuilderDHT(new PeerBuilder(Number160.createHash(rnd.nextInt())).ports(13337).start())
          .start();
      PeerNAT uNat = new PeerBuilderNAT(unreachablePeer.peer()).relayType(relayType).gcmServerCredentials(gcmServerCredentials).peerMapUpdateInterval(3).start();

      // bootstrap
      unreachablePeer.peer().bootstrap().peerAddress(master.peerAddress()).start();
      FutureRelayNAT fbn = uNat.startRelay(master.peerAddress()).awaitUninterruptibly();
      Assert.assertTrue(fbn.isSuccess());
View Full Code Here

Examples of net.tomp2p.dht.PeerDHT.peer()

      unreachablePeer = new PeerBuilderDHT(new PeerBuilder(Number160.createHash(rnd.nextInt())).ports(13337).start())
          .start();
      PeerNAT uNat = new PeerBuilderNAT(unreachablePeer.peer()).relayType(relayType).gcmServerCredentials(gcmServerCredentials).peerMapUpdateInterval(3).start();

      // bootstrap
      unreachablePeer.peer().bootstrap().peerAddress(master.peerAddress()).start();
      FutureRelayNAT fbn = uNat.startRelay(master.peerAddress()).awaitUninterruptibly();
      Assert.assertTrue(fbn.isSuccess());
      mockGCM(peers, uNat);

      // wait for maintenance to kick in
View Full Code Here

Examples of net.tomp2p.dht.PeerDHT.peer()

      PeerNAT uNat1 = new PeerBuilderNAT(unreachablePeer1.peer()).relayType(relayType).gcmServerCredentials(gcmServerCredentials).peerMapUpdateInterval(3).start();
      FutureRelayNAT fbn1 = uNat1.startRelay(master.peerAddress()).awaitUninterruptibly();
      Assert.assertTrue(fbn1.isSuccess());

      unreachablePeer2 = new PeerBuilderDHT(new PeerBuilder(Number160.createHash(rnd.nextInt())).ports(13338).start()).start();
      PeerNAT uNat2 = new PeerBuilderNAT(unreachablePeer2.peer()).relayType(relayType).gcmServerCredentials(gcmServerCredentials).peerMapUpdateInterval(3).start();
      FutureRelayNAT fbn2 = uNat2.startRelay(master.peerAddress()).awaitUninterruptibly();
      Assert.assertTrue(fbn2.isSuccess());

      peers[8] = unreachablePeer1;
      peers[9] = unreachablePeer2;
View Full Code Here

Examples of net.tomp2p.dht.PeerDHT.peer()

             PeerNAT uNat1 = new PeerBuilderNAT(unreachablePeer1.peer()).relayType(relayType).gcmServerCredentials(gcmServerCredentials).peerMapUpdateInterval(3).start();
             FutureRelayNAT fbn1 = uNat1.startRelay(master.peerAddress()).awaitUninterruptibly();
             Assert.assertTrue(fbn1.isSuccess());

             unreachablePeer2 = new PeerBuilderDHT(new PeerBuilder(Number160.createHash(rnd.nextInt())).keyPair(pair2).ports(13338).start()).start();
             unreachablePeer2.peer().peerBean().serverPeerAddress(unreachablePeer2.peer().peerAddress().changeFirewalledTCP(true).changeFirewalledUDP(true));
             PeerNAT uNat2 = new PeerBuilderNAT(unreachablePeer2.peer()).relayType(relayType).gcmServerCredentials(gcmServerCredentials).peerMapUpdateInterval(3).start();
             FutureRelayNAT fbn2 = uNat2.startRelay(master.peerAddress()).awaitUninterruptibly();
             Assert.assertTrue(fbn2.isSuccess());

             peers[8] = unreachablePeer1;
View Full Code Here

Examples of net.tomp2p.dht.PeerDHT.peer()

             PeerNAT uNat1 = new PeerBuilderNAT(unreachablePeer1.peer()).relayType(relayType).gcmServerCredentials(gcmServerCredentials).peerMapUpdateInterval(3).start();
             FutureRelayNAT fbn1 = uNat1.startRelay(master.peerAddress()).awaitUninterruptibly();
             Assert.assertTrue(fbn1.isSuccess());

             unreachablePeer2 = new PeerBuilderDHT(new PeerBuilder(Number160.createHash(rnd.nextInt())).keyPair(pair2).ports(13338).start()).start();
             unreachablePeer2.peer().peerBean().serverPeerAddress(unreachablePeer2.peer().peerAddress().changeFirewalledTCP(true).changeFirewalledUDP(true));
             PeerNAT uNat2 = new PeerBuilderNAT(unreachablePeer2.peer()).relayType(relayType).gcmServerCredentials(gcmServerCredentials).peerMapUpdateInterval(3).start();
             FutureRelayNAT fbn2 = uNat2.startRelay(master.peerAddress()).awaitUninterruptibly();
             Assert.assertTrue(fbn2.isSuccess());

             peers[8] = unreachablePeer1;
View Full Code Here

Examples of net.tomp2p.dht.PeerDHT.peer()

             FutureRelayNAT fbn1 = uNat1.startRelay(master.peerAddress()).awaitUninterruptibly();
             Assert.assertTrue(fbn1.isSuccess());

             unreachablePeer2 = new PeerBuilderDHT(new PeerBuilder(Number160.createHash(rnd.nextInt())).keyPair(pair2).ports(13338).start()).start();
             unreachablePeer2.peer().peerBean().serverPeerAddress(unreachablePeer2.peer().peerAddress().changeFirewalledTCP(true).changeFirewalledUDP(true));
             PeerNAT uNat2 = new PeerBuilderNAT(unreachablePeer2.peer()).relayType(relayType).gcmServerCredentials(gcmServerCredentials).peerMapUpdateInterval(3).start();
             FutureRelayNAT fbn2 = uNat2.startRelay(master.peerAddress()).awaitUninterruptibly();
             Assert.assertTrue(fbn2.isSuccess());

             peers[8] = unreachablePeer1;
       peers[9] = unreachablePeer2;
View Full Code Here

Examples of net.tomp2p.dht.PeerDHT.peer()

            Number160 locationKey = Number160.createHash("test1");
            FuturePut fp = p2.put(locationKey).data(new Data("hallo")).requestP2PConfiguration(new RequestP2PConfiguration(2, 10, 0)).start();
            fp.awaitUninterruptibly();
            getReplicasCount(locationKey, p1, p2, p3);
            //
            p3.peer().announceShutdown().start().awaitUninterruptibly();
            p3.shutdown().awaitUninterruptibly();
            Thread.sleep(500);
            p3 = new PeerBuilderDHT(new PeerBuilder(locationKey).ports(PORT+3).start()).start();
            i3 = new IndirectReplication(p3);
            i3.start();
View Full Code Here

Examples of net.tomp2p.dht.PeerDHT.peer()

            p3 = new PeerBuilderDHT(new PeerBuilder(locationKey).ports(PORT+3).start()).start();
            i3 = new IndirectReplication(p3);
            i3.start();
           
            System.out.println("now we add a peer that matches perfectly the key " + locationKey+ ". This will now become the responsible peer");
            p3.peer().bootstrap().peerAddress(p1.peerAddress()).start().awaitUninterruptibly();
            getReplicasCount(locationKey, p1, p2, p3);
            Thread.sleep(500);
            p1.peer().announceShutdown().start().awaitUninterruptibly();
            p1.shutdown().awaitUninterruptibly();
            p2.peer().announceShutdown().start().awaitUninterruptibly();
View Full Code Here

Examples of net.tomp2p.dht.PeerDHT.peer()

                p1.shutdown().awaitUninterruptibly();
            }
            if (p2 != null && !p2.peer().isShutdown()) {
                p2.shutdown().awaitUninterruptibly();
            }
            if (p3 != null && !p3.peer().isShutdown()) {
                p3.shutdown().awaitUninterruptibly();
            }
        }
    }
   
View Full Code Here

Examples of net.tomp2p.dht.PeerDHT.peer()

            Number160 locationKey = Number160.createHash("test1");
            FuturePut fp = p2.put(locationKey).data(new Data("hallo")).requestP2PConfiguration(new RequestP2PConfiguration(2, 10, 0)).start();
            fp.awaitUninterruptibly();
            getReplicasCount(locationKey, p1, p2, p3);
           
            p3.peer().announceShutdown().start().awaitUninterruptibly();
            p3.shutdown().awaitUninterruptibly();
            p1.peer().announceShutdown().start().awaitUninterruptibly();
            p1.shutdown().awaitUninterruptibly();
            Thread.sleep(500);
            getReplicasCount(locationKey, p1, p2, p3);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.