Package net.tomp2p.futures

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


        .remove(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();
    futureRemove.awaitUninterruptibly();

    FutureDigest futureDigest = p1
        .digest(Number160.createHash(locationKey))
        .from(new Number640(Number160.createHash(locationKey), Number160.ZERO, Number160
            .createHash(contentKey), Number160.ZERO))
View Full Code Here


    p2.put(Number160.createHash(locationKey)).setData(Number160.createHash(contentKey), new Data(data))
        .setVersionKey(data.getVersionKey()).start().awaitUninterruptibly();

    FutureRemove futureRemove = p1.remove(Number160.createHash(locationKey)).setDomainKey(Number160.ZERO)
        .contentKey(Number160.createHash(contentKey)).setVersionKey(data.getVersionKey()).start();
    futureRemove.awaitUninterruptibly();

    FutureDigest futureDigest = p1.digest(Number160.createHash(locationKey))
        .setContentKey(Number160.createHash(contentKey)).setVersionKey(data.getVersionKey()).start();
    futureDigest.awaitUninterruptibly();
View Full Code Here

    H2HTestData data = new H2HTestData(NetworkTestUtil.randomString());

    p2.put(lKey).setData(cKey, new Data(data)).setDomainKey(dKey).start().awaitUninterruptibly();

    FutureRemove futureRemove = p1.remove(lKey).setDomainKey(dKey).contentKey(cKey).start();
    futureRemove.awaitUninterruptibly();

    // check with a normal digest
    FutureDigest futureDigest = p1.digest(lKey).setContentKey(cKey).setDomainKey(dKey).start();
    futureDigest.awaitUninterruptibly();
    assertTrue(futureDigest.getDigest().keyDigest().isEmpty());
View Full Code Here

    p2.put(lKey).setData(cKey, new Data(data)).setDomainKey(dKey).start().awaitUninterruptibly();

    FutureRemove futureRemove = p1.remove(lKey).from(new Number640(lKey, dKey, cKey, Number160.ZERO))
        .to(new Number640(lKey, dKey, cKey, Number160.MAX_VALUE)).start();
    futureRemove.awaitUninterruptibly();

    FutureDigest futureDigest = p1.digest(lKey).from(new Number640(lKey, dKey, cKey, Number160.ZERO))
        .to(new Number640(lKey, dKey, cKey, Number160.MAX_VALUE)).start();
    futureDigest.awaitUninterruptibly();
View Full Code Here

    // try to remove without protection keys
    Parameters parameters2 = new Parameters().setLocationKey(locationKey).setDomainKey(domainKey)
        .setContentKey(contentKey);
    FutureRemove futureRemove = node.getDataManager().removeUnblocked(parameters2);
    futureRemove.awaitUninterruptibly();

    // should have been not changed
    futureGet = node.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertEquals(data1.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());
View Full Code Here

    // try to remove with wrong protection keys
    Parameters parameters3 = new Parameters().setLocationKey(locationKey).setDomainKey(domainKey)
        .setContentKey(contentKey).setProtectionKeys(protectionKey2);
    futureRemove = node.getDataManager().removeUnblocked(parameters3);
    futureRemove.awaitUninterruptibly();

    // should have been not changed
    futureGet = node.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertEquals(data1.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());
View Full Code Here

    futureGet.awaitUninterruptibly();
    assertEquals(data1.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());

    // remove with correct protection keys
    futureRemove = node.getDataManager().removeUnblocked(parameters1);
    futureRemove.awaitUninterruptibly();

    // should have been removed
    futureGet = node.getDataManager().getUnblocked(parameters2);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
View Full Code Here

    // try to remove without a protection key
    Parameters parameters2 = new Parameters().setLocationKey(locationKey).setDomainKey(domainKey)
        .setContentKey(contentKey).setVersionKey(data1.getVersionKey()).setData(data1);
    FutureRemove futureRemove = node.getDataManager().removeVersionUnblocked(parameters2);
    futureRemove.awaitUninterruptibly();

    // should have been not modified
    futureGet = node.getDataManager().getVersionUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertEquals(data1.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());
View Full Code Here

    // try to remove with wrong protection key
    Parameters parameters3 = new Parameters().setLocationKey(locationKey).setDomainKey(domainKey)
        .setContentKey(contentKey).setVersionKey(data1.getVersionKey())
        .setProtectionKeys(protectionKey2);
    futureRemove = node.getDataManager().removeVersionUnblocked(parameters3);
    futureRemove.awaitUninterruptibly();

    // should have been not modified
    futureGet = node.getDataManager().getVersionUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertEquals(data1.getTestString(), ((H2HTestData) futureGet.getData().object()).getTestString());
View Full Code Here

    // remove with correct content protection key
    Parameters parameters4 = new Parameters().setLocationKey(locationKey).setDomainKey(domainKey)
        .setContentKey(contentKey).setVersionKey(data1.getVersionKey()).setData(data1)
        .setProtectionKeys(protectionKey1);
    futureRemove = node.getDataManager().removeVersionUnblocked(parameters4);
    futureRemove.awaitUninterruptibly();

    // should have been removed
    futureGet = node.getDataManager().getVersionUnblocked(parameters1);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
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.