Package net.tomp2p.futures

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


    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);

    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeB.getDataManager().getUnblocked(
View Full Code Here


    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeB.getDataManager().getUnblocked(
        new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey));
    futureGet.awaitUninterruptibly();
    String originalSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    assertEquals(originalSecret, receivedSecret);
  }

  /**
 
View Full Code Here

    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);

    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeB.getDataManager().getUnblocked(
View Full Code Here

    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeB.getDataManager().getUnblocked(
        new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey));
    futureGet.awaitUninterruptibly();
    String originalSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    assertEquals(originalSecret, receivedSecret);
  }

  private PublicKey getPublicKey(NetworkManager networkManager) {
View Full Code Here

    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);

    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeB.getDataManager().getUnblocked(
View Full Code Here

    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeB.getDataManager().getUnblocked(
        new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey));
    futureGet.awaitUninterruptibly();
    String originalSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    assertEquals(originalSecret, receivedSecret);
  }

  @Test
View Full Code Here

    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);

    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeB.getDataManager().getUnblocked(
View Full Code Here

    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeB.getDataManager().getUnblocked(
        new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey));
    futureGet.awaitUninterruptibly();
    String originalSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    assertEquals(originalSecret, receivedSecret);
  }

  private PublicKey getPublicKey(NetworkManager networkManager) {
View Full Code Here

    // get the user profile which should be stored at the proxy
    FutureGet global = client.getDataManager().getUnblocked(
        new Parameters().setLocationKey(credentials.getProfileLocationKey()).setContentKey(
            H2HConstants.USER_PROFILE));
    global.awaitUninterruptibly();
    global.getFutureRequests().awaitUninterruptibly();
    EncryptedNetworkContent found = (EncryptedNetworkContent) global.getData().object();
    Assert.assertNotNull(found);

    // decrypt it using the same password as set above
View Full Code Here

    String contentKey = NetworkTestUtil.randomString();
    Parameters parameters = new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey);

    // check if selected location is empty
    FutureGet futureGet = nodeA.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());

    // create a message with target node B
    final TestMessage message = new TestMessage(nodeB.getNodeId(), contentKey, new H2HTestData(data));
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.