Examples of PeerMapConfiguration


Examples of net.tomp2p.peers.PeerMapConfiguration

 
  @Test
  public void testStoragePutGetUnverifiedVerified() throws IOException, ClassNotFoundException {
    Number160 self = Number160.ONE;
    PeerAddress selfAddress = new PeerAddress(self);
    PeerMapConfiguration pmc = new PeerMapConfiguration(self);
    PeerMap pm = new PeerMap(pmc);
    TrackerStorage trackerStorage = new TrackerStorage(Integer.MAX_VALUE, new int[] { 10 }, 1, pm, selfAddress, true);

    Number320 n320 = new Number320(Number160.ZERO, Number160.ZERO);
View Full Code Here

Examples of net.tomp2p.peers.PeerMapConfiguration

 
  @Test
  public void testStoragePutGetUnverifiedVerifiedSecurity() throws IOException, ClassNotFoundException, NoSuchAlgorithmException {
    Number160 self = Number160.ONE;
    PeerAddress selfAddress = new PeerAddress(self);
    PeerMapConfiguration pmc = new PeerMapConfiguration(self);
    PeerMap pm = new PeerMap(pmc);
    TrackerStorage trackerStorage = new TrackerStorage(Integer.MAX_VALUE, new int[] { 10 }, 1, pm, selfAddress, true);

    Number320 n320 = new Number320(Number160.ZERO, Number160.ZERO);
View Full Code Here

Examples of net.tomp2p.peers.PeerMapConfiguration

 
  @Test
  public void testTrackerRemove1() throws IOException {
    Number160 self = Number160.ONE;
    PeerAddress selfAddress = new PeerAddress(self);
    PeerMapConfiguration pmc = new PeerMapConfiguration(self);
    PeerMap pm = new PeerMap(pmc);
    TrackerStorage trackerStorage = new TrackerStorage(10, new int[] { 10 }, 1, pm, selfAddress, false);

    Number320 n320 = new Number320(Number160.ZERO, Number160.ZERO);
View Full Code Here

Examples of net.tomp2p.peers.PeerMapConfiguration

 
  @Test
  public void testTrackerRemove2() throws IOException {
    Number160 self = Number160.ONE;
    PeerAddress selfAddress = new PeerAddress(self);
    PeerMapConfiguration pmc = new PeerMapConfiguration(self);
    PeerMap pm = new PeerMap(pmc);
    TrackerStorage trackerStorage = new TrackerStorage(10, new int[] { 10 }, 1, pm, selfAddress, true);

    Number320 n320 = new Number320(Number160.ZERO, Number160.ZERO);
View Full Code Here

Examples of net.tomp2p.peers.PeerMapConfiguration

 
  @Test
  public void testTrackerMaintenance1() throws IOException {
    Number160 self = Number160.ONE;
    PeerAddress selfAddress = new PeerAddress(self);
    PeerMapConfiguration pmc = new PeerMapConfiguration(self);
    PeerMap pm = new PeerMap(pmc);
    TrackerStorage trackerStorage = new TrackerStorage(10, new int[] { 10 }, 1, pm, selfAddress, true);

    Number320 n320 = new Number320(Number160.ZERO, Number160.ZERO);
View Full Code Here

Examples of net.tomp2p.peers.PeerMapConfiguration

 
  @Test
  public void testTrackerMaintenance2() throws IOException {
    Number160 self = Number160.ONE;
    PeerAddress selfAddress = new PeerAddress(self);
    PeerMapConfiguration pmc = new PeerMapConfiguration(self);
    PeerMap pm = new PeerMap(pmc);
    TrackerStorage trackerStorage = new TrackerStorage(10, new int[] { 10 }, 1, pm, selfAddress, true);

    Number320 n320 = new Number320(Number160.ZERO, Number160.ZERO);
View Full Code Here

Examples of net.tomp2p.peers.PeerMapConfiguration

        }
        Bindings bindings = new Bindings().addInterface("lo");
        Peer[] peers = new Peer[nrOfPeers];
        if (automaticFuture != null) {
          Number160 peerId = new Number160(rnd);
          PeerMap peerMap = new PeerMap(new PeerMapConfiguration(peerId));
            peers[0] = new PeerBuilder(peerId)
                    .ports(port).enableMaintenance(maintenance)
                    .bindings(bindings).peerMap(peerMap).start().addAutomaticFuture(automaticFuture);
        } else {
          Number160 peerId = new Number160(rnd);
          PeerMap peerMap = new PeerMap(new PeerMapConfiguration(peerId));
            peers[0] = new PeerBuilder(peerId).enableMaintenance(maintenance).bindings(bindings)
                   .peerMap(peerMap).ports(port).start();
        }

        for (int i = 1; i < nrOfPeers; i++) {
            if (automaticFuture != null) {
              Number160 peerId = new Number160(rnd);
              PeerMap peerMap = new PeerMap(new PeerMapConfiguration(peerId));
                peers[i] = new PeerBuilder(peerId)
                        .masterPeer(peers[0])
                        .enableMaintenance(maintenance).enableMaintenance(maintenance).peerMap(peerMap).bindings(bindings).start().addAutomaticFuture(automaticFuture);
            } else {
              Number160 peerId = new Number160(rnd);
              PeerMap peerMap = new PeerMap(new PeerMapConfiguration(peerId).peerNoVerification());
                peers[i] = new PeerBuilder(peerId).enableMaintenance(maintenance)
                        .bindings(bindings).peerMap(peerMap).masterPeer(peers[0])
                        .start();
            }
        }
View Full Code Here

Examples of net.tomp2p.peers.PeerMapConfiguration

    } else {
      channelServerConfiguration.bindings(bindings);
      channelClientConfiguration.bindings(bindings);
    }
    if (peerMap == null) {
      peerMap = new PeerMap(new PeerMapConfiguration(peerId));
    }

    if (masterPeer == null && scheduledExecutorService == null) {
      scheduledExecutorService = Executors.newScheduledThreadPool(1);
    }
View Full Code Here

Examples of net.tomp2p.peers.PeerMapConfiguration

      master = peers[0]; // the relay peer
      UtilsNAT.perfectRouting(peers);
      for (PeerDHT peer : peers) {
        new PeerBuilderNAT(peer.peer()).bufferConfiguration(androidConfig).start();
      }
      PeerMapConfiguration pmc = new PeerMapConfiguration(Number160.createHash(rnd.nextInt()));
      slave = new PeerBuilderDHT(new PeerBuilder(Number160.ONE).peerMap(new PeerMap(pmc)).ports(13337).start())
          .start();
      printMapStatus(slave, peers);
      FuturePut futurePut = peers[8].put(slave.peerID()).data(new Data("hello")).start().awaitUninterruptibly();
      futurePut.futureRequests().awaitUninterruptibly();
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.