Examples of peerAddresses()


Examples of net.tomp2p.message.TrackerData.peerAddresses()

  private boolean remove(Number320 key, PeerStatistic stat, Map<Number320, TrackerData> map) {
    TrackerData trackerData = map.get(key);
    if (trackerData != null) {
      boolean retVal = trackerData.remove(stat.peerAddress().peerId()) != null;
      if(trackerData.peerAddresses().size() == 0) {
        map.remove(key);
      }
      return retVal;
    }
    return false;
View Full Code Here

Examples of net.tomp2p.message.TrackerData.peerAddresses()

        Map.Entry<PeerStatistic, Data> entry = trackerData.get(contentKey);
        if(entry!=null) {
          return new DigestInfo(Number160.ZERO, contentKey, 1);
        }
      } else {
        for(PeerStatistic peerStatatistic: trackerData.peerAddresses().keySet()) {
          contentDigest = contentDigest.xor(peerStatatistic.peerAddress().peerId());
          counter++;
        }
      }
    }
View Full Code Here

Examples of net.tomp2p.message.TrackerData.peerAddresses()

          // no data found
          if (tmp == null || tmp.size() == 0) {
            return;
          }

          for (Map.Entry<PeerStatistic, Data> trackerData : tmp.peerAddresses().entrySet()) {
            // we don't know the public key, since this is not first
            // hand information. TTL will be set in tracker storage,
            // so don't worry about it here.
            trackerStorage.put(key, trackerData.getKey().peerAddress(), null, trackerData.getValue());
          }
View Full Code Here

Examples of net.tomp2p.message.TrackerData.peerAddresses()

    PublicKey publicKey = message.publicKey(0);
    //
    TrackerData meshPeers = trackerStorage.peers(new Number320(locationKey, domainKey));
   
    LOG.debug("found peers on tracker: {}", meshPeers == null ? "null " : meshPeers.peerAddresses());

    boolean couldProvideMoreData = false;
    if (meshPeers != null) {
      if (knownPeers != null) {
        meshPeers = UtilsTracker.disjunction(meshPeers, knownPeers);
View Full Code Here

Examples of net.tomp2p.message.TrackerData.peerAddresses()

    if (message.command() == RPC.Commands.TRACKER_ADD.getNr()) {
      TrackerData trackerData = message.trackerData(0);
      if (trackerData.size() != 1) {
        responseMessage.type(Message.Type.EXCEPTION);
      } else {
        Map.Entry<PeerStatistic, Data> entry = trackerData.peerAddresses().entrySet().iterator().next();
        if (!trackerStorage.put(new Number320(locationKey, domainKey), entry.getKey().peerAddress(), publicKey,
                entry.getValue())) {
          responseMessage.type(Message.Type.DENIED);
          LOG.debug("tracker NOT put on({}) locationKey:{}, domainKey:{}, address:{}", peerBean()
                  .serverPeerAddress(), locationKey, domainKey, entry.getKey());
View Full Code Here

Examples of net.tomp2p.message.TrackerData.peerAddresses()

    boolean retVal = trackerStorage.put(n320, selfAddress, null, new Data("test"));
    Assert.assertTrue(retVal);
    //
    TrackerData td = trackerStorage.peers(n320);
    Object o = td.peerAddresses().values().iterator().next().object();
    Assert.assertEquals(o, "test");
  }
 
  @Test
  public void testStoragePutGetUnverified() throws IOException, ClassNotFoundException {
View Full Code Here

Examples of net.tomp2p.message.TrackerData.peerAddresses()

    trackerStorage.put(n320, selfAddress, null, new Data("test"));
    trackerStorage.peerFound(selfAddress, null, null);
   
    TrackerData td = trackerStorage.peers(n320);
    Object o = td.peerAddresses().values().iterator().next().object();
    Assert.assertEquals(o, "test");
  }
 
  @Test
  public void testStoragePutGetUnverifiedVerifiedSecurity() throws IOException, ClassNotFoundException, NoSuchAlgorithmException {
View Full Code Here

Examples of net.tomp2p.message.TrackerData.peerAddresses()

    trackerStorage.put(n320, selfAddress, pair1.getPublic(), new Data("test"));
    trackerStorage.peerFound(selfAddress, null, null);
    trackerStorage.put(n320, selfAddress, pair1.getPublic(), new Data("test1"));
   
    TrackerData td = trackerStorage.peers(n320);
    Object o = td.peerAddresses().values().iterator().next().object();
    Assert.assertEquals(o, "test1");
  }
 
  @Test
  public void testTrackerRemove1() throws IOException {
View Full Code Here

Examples of net.tomp2p.message.TrackerData.peerAddresses()

        if (futureChannelCreator2.isSuccess()) {
             
          TrackerData peers = trackerStorage.peers(new Number320(builder.locationKey(), builder
                  .domainKey()));
          NavigableSet<PeerAddress> queue = new TreeSet<PeerAddress>(PeerMap.createComparator(stableRandom));
          if(peers != null && peers.peerAddresses()!=null) {
            for (PeerStatistic peerAddress : peers.peerAddresses().keySet()) {
              queue.add(peerAddress.peerAddress());
            }
          }
View Full Code Here

Examples of net.tomp2p.message.TrackerData.peerAddresses()

             
          TrackerData peers = trackerStorage.peers(new Number320(builder.locationKey(), builder
                  .domainKey()));
          NavigableSet<PeerAddress> queue = new TreeSet<PeerAddress>(PeerMap.createComparator(stableRandom));
          if(peers != null && peers.peerAddresses()!=null) {
            for (PeerStatistic peerAddress : peers.peerAddresses().keySet()) {
              queue.add(peerAddress.peerAddress());
            }
          }

          if (queue.size() > MIN_TRACKER_PEERS) {
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.