Package net.tomp2p.futures

Examples of net.tomp2p.futures.FutureGet.awaitUninterruptibly()


    assertEquals(testString3, ((H2HTestData) futureGet.getData().object()).getTestString());

    // remove 2nd one and check that 1st and 3rd are still there
    nodeA.getDataManager().removeUnblocked(parameters2).awaitUninterruptibly();
    futureGet = nodeB.getDataManager().getUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertEquals(testString1, ((H2HTestData) futureGet.getData().object()).getTestString());
    futureGet = nodeB.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
    futureGet = nodeB.getDataManager().getUnblocked(parameters3);
View Full Code Here


    nodeA.getDataManager().removeUnblocked(parameters2).awaitUninterruptibly();
    futureGet = nodeB.getDataManager().getUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertEquals(testString1, ((H2HTestData) futureGet.getData().object()).getTestString());
    futureGet = nodeB.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
    futureGet = nodeB.getDataManager().getUnblocked(parameters3);
    futureGet.awaitUninterruptibly();
    assertEquals(testString3, ((H2HTestData) futureGet.getData().object()).getTestString());
View Full Code Here

    assertEquals(testString1, ((H2HTestData) futureGet.getData().object()).getTestString());
    futureGet = nodeB.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
    futureGet = nodeB.getDataManager().getUnblocked(parameters3);
    futureGet.awaitUninterruptibly();
    assertEquals(testString3, ((H2HTestData) futureGet.getData().object()).getTestString());

    // remove 3rd one as well and check that they are gone as well
    nodeA.getDataManager().removeUnblocked(parameters1).awaitUninterruptibly();
    nodeA.getDataManager().removeUnblocked(parameters3).awaitUninterruptibly();
View Full Code Here

    // remove 3rd one as well and check that they are gone as well
    nodeA.getDataManager().removeUnblocked(parameters1).awaitUninterruptibly();
    nodeA.getDataManager().removeUnblocked(parameters3).awaitUninterruptibly();
    futureGet = nodeB.getDataManager().getUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
    futureGet = nodeB.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
    futureGet = nodeB.getDataManager().getUnblocked(parameters3);
View Full Code Here

    nodeA.getDataManager().removeUnblocked(parameters3).awaitUninterruptibly();
    futureGet = nodeB.getDataManager().getUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
    futureGet = nodeB.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
    futureGet = nodeB.getDataManager().getUnblocked(parameters3);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
  }
View Full Code Here

    assertNull(futureGet.getData());
    futureGet = nodeB.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
    futureGet = nodeB.getDataManager().getUnblocked(parameters3);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
  }

  @Test
  public void testChangeProtectionKeySingleVersionKey() throws NoPeerConnectionException, IOException,
View Full Code Here

    // wait a moment, so that the ttl decrements
    Thread.sleep(2000);

    // check decrement of ttl through a normal get
    FutureGet futureGet = p1.get(lKey).setDomainKey(dKey).setContentKey(cKey).setVersionKey(vKey).start();
    futureGet.awaitUninterruptibly();
    Assert.assertTrue(futureGet.isSuccess());
    Assert.assertTrue(ttl > futureGet.getData().ttlSeconds());

    // check decrement of ttl through a get meta
    FutureDigest futureDigest = p1.digest(lKey).setDomainKey(dKey).setContentKey(cKey)
View Full Code Here

        .get(Number160.createHash(locationKey))
        .from(new Number640(Number160.createHash(locationKey), Number160.ZERO, Number160
            .createHash(contentKey), Number160.ZERO))
        .to(new Number640(Number160.createHash(locationKey), Number160.ZERO, Number160
            .createHash(contentKey), Number160.MAX_VALUE)).descending().returnNr(1).start();
    future.awaitUninterruptibly();

    assertEquals(content.get(numberOfContent - 1).getTestString(), ((H2HTestData) future.getData()
        .object()).getTestString());

    p1.shutdown().awaitUninterruptibly();
View Full Code Here

    while (true) {
      FutureGet futureGet = p1.get(lKey)
          .from(new Number640(lKey, dKey, Number160.ZERO, Number160.ZERO))
          .to(new Number640(lKey, dKey, Number160.MAX_VALUE, Number160.MAX_VALUE)).ascending()
          .returnNr(1).start();
      futureGet.awaitUninterruptibly();
      if (futureGet.getData() != null) {
        long timeStamp = (Long) futureGet.getData().object();
        Number160 contentKey = new Number160(timeStamp);
        logger.debug("{}, {}", timeStamp, contentKey);
        downloadedTimestamps.add(timeStamp);
View Full Code Here

        .get(Number160.createHash(locationKey))
        .from(new Number640(Number160.createHash(locationKey), Number160.ZERO, Number160
            .createHash(contentKey), Number160.ZERO))
        .to(new Number640(Number160.createHash(locationKey), Number160.ZERO, Number160
            .createHash(contentKey), Number160.MAX_VALUE)).start();
    futureGet.awaitUninterruptibly();

    assertNull(futureGet.getData());

    p1.shutdown().awaitUninterruptibly();
    p2.shutdown().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.