Package net.tomp2p.futures

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


    assertNotEquals(Number160.ZERO, data.getVersionKey());
    Parameters parameters = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setVersionKey(data.getVersionKey()).setData(data);

    FuturePut futurePut = node.getDataManager().putUnblocked(parameters);
    futurePut.awaitUninterruptibly();
    futurePut.getFutureRequests().awaitUninterruptibly();

    assertFalse(futurePut.getRawResult().isEmpty());
    for (PeerAddress peerAddress : futurePut.getRawResult().keySet()) {
      for (Number640 key : futurePut.getRawResult().get(peerAddress).keySet()) {
View Full Code Here


    H2HTestData data1 = new H2HTestData(NetworkTestUtil.randomString());
    data1.generateVersionKey();
    Parameters parameters1 = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setVersionKey(data1.getVersionKey()).setData(data1);
    FuturePut futurePut1 = node.getDataManager().putUnblocked(parameters1);
    futurePut1.awaitUninterruptibly();

    H2HTestData data2 = new H2HTestData(NetworkTestUtil.randomString());
    data2.generateVersionKey();
    Parameters parameters2 = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setVersionKey(data1.getVersionKey()).setData(data2);
View Full Code Here

    H2HTestData data2 = new H2HTestData(NetworkTestUtil.randomString());
    data2.generateVersionKey();
    Parameters parameters2 = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setVersionKey(data1.getVersionKey()).setData(data2);
    FuturePut futurePut2 = node.getDataManager().putUnblocked(parameters2);
    futurePut2.awaitUninterruptibly();

    assertFalse(futurePut2.getRawResult().isEmpty());
    for (PeerAddress peerAddress : futurePut2.getRawResult().keySet()) {
      for (Number640 key : futurePut2.getRawResult().get(peerAddress).keySet()) {
        assertEquals(PutStatusH2H.VERSION_CONFLICT_NO_BASED_ON, PutStatusH2H.values()[futurePut2
View Full Code Here

    H2HTestData data1 = new H2HTestData(NetworkTestUtil.randomString());
    data1.generateVersionKey();
    Parameters parameters1 = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setVersionKey(data1.getVersionKey()).setData(data1);
    FuturePut futurePut1 = node.getDataManager().putUnblocked(parameters1);
    futurePut1.awaitUninterruptibly();

    H2HTestData data2 = new H2HTestData(NetworkTestUtil.randomString());
    data2.generateVersionKey();

    H2HTestData data3 = new H2HTestData(NetworkTestUtil.randomString());
View Full Code Here

    data3.generateVersionKey();
    data3.setBasedOnKey(data2.getVersionKey());
    Parameters parameters3 = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setVersionKey(data3.getVersionKey()).setData(data3);
    FuturePut futurePut3 = node.getDataManager().putUnblocked(parameters3);
    futurePut3.awaitUninterruptibly();

    assertFalse(futurePut3.getRawResult().isEmpty());
    for (PeerAddress peerAddress : futurePut3.getRawResult().keySet()) {
      for (Number640 key : futurePut3.getRawResult().get(peerAddress).keySet()) {
        assertEquals(PutStatusH2H.VERSION_CONFLICT, PutStatusH2H.values()[futurePut3.getRawResult()
View Full Code Here

    H2HTestData data1 = new H2HTestData(NetworkTestUtil.randomString());
    data1.generateVersionKey();
    Parameters parameters1 = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setVersionKey(data1.getVersionKey()).setData(data1);
    FuturePut futurePut1 = node.getDataManager().putUnblocked(parameters1);
    futurePut1.awaitUninterruptibly();

    H2HTestData data2 = new H2HTestData(NetworkTestUtil.randomString());
    data2.generateVersionKey();
    data2.setBasedOnKey(data1.getVersionKey());
    Parameters parameters2 = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
View Full Code Here

    data2.generateVersionKey();
    data2.setBasedOnKey(data1.getVersionKey());
    Parameters parameters2 = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setVersionKey(data2.getVersionKey()).setData(data2);
    FuturePut futurePut2 = node.getDataManager().putUnblocked(parameters2);
    futurePut2.awaitUninterruptibly();

    assertFalse(futurePut2.getRawResult().isEmpty());
    for (PeerAddress peerAddress : futurePut2.getRawResult().keySet()) {
      for (Number640 key : futurePut2.getRawResult().get(peerAddress).keySet()) {
        assertEquals(PutStatusH2H.OK, PutStatusH2H.values()[futurePut2.getRawResult()
View Full Code Here

        .setVersionKey(data1.getVersionKey()).setData(data1);
    Parameters parameters2 = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setVersionKey(data2.getVersionKey()).setData(data2);

    FuturePut futurePut1 = node.getDataManager().putUnblocked(parameters1);
    futurePut1.awaitUninterruptibly();

    FuturePut futurePut2 = node.getDataManager().putUnblocked(parameters2);
    futurePut2.awaitUninterruptibly();

    assertFalse(futurePut2.getRawResult().isEmpty());
View Full Code Here

    FuturePut futurePut1 = node.getDataManager().putUnblocked(parameters1);
    futurePut1.awaitUninterruptibly();

    FuturePut futurePut2 = node.getDataManager().putUnblocked(parameters2);
    futurePut2.awaitUninterruptibly();

    assertFalse(futurePut2.getRawResult().isEmpty());
    for (PeerAddress peerAddress : futurePut2.getRawResult().keySet()) {
      for (Number640 key : futurePut2.getRawResult().get(peerAddress).keySet()) {
        assertEquals(PutStatusH2H.VERSION_CONFLICT_OLD_TIMESTAMP, PutStatusH2H.values()[futurePut2
View Full Code Here

    H2HTestData data1 = new H2HTestData(NetworkTestUtil.randomString());
    Parameters parameters1 = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setData(data1).setProtectionKeys(protectionKeys);
    FuturePut futurePut = node.getDataManager().putUnblocked(parameters1);
    futurePut.awaitUninterruptibly();

    H2HTestData data2 = new H2HTestData(NetworkTestUtil.randomString());
    Parameters parameters2 = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setData(data2);
    futurePut = node.getDataManager().putUnblocked(parameters2);
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.