Examples of addBasedOn()


Examples of net.tomp2p.storage.Data.addBasedOn()

      for (int i = 0; i < 500; i++) {
        content += "a";
        Number160 vKey = generateVersionKey(i, content);
        Data data = new Data(content);
        if (!sortedMap.isEmpty()) {
          data.addBasedOn(sortedMap.lastKey());
        }
        data.prepareFlag();
        sortedMap.put(vKey, data);

        // put test data (prepare)
View Full Code Here

Examples of net.tomp2p.storage.Data.addBasedOn()

    Number160 dKey = Number160.createHash("domain");
    Number160 cKey = Number160.createHash("content");
    // put the first version of the content with key pair 1
    Number160 vKey1 = Number160.createHash("version1");
    Data data = new Data("data1v1").protectEntryNow(keyPair1, factory);
    data.addBasedOn(Number160.ZERO);
    FuturePut futurePut1 = p1.put(lKey).domainKey(dKey).sign().data(cKey, data).keyPair(keyPair1)
            .versionKey(vKey1).start();
    futurePut1.awaitUninterruptibly();
    Assert.assertTrue(futurePut1.isSuccess());
    // add another version with the correct key pair 1
View Full Code Here

Examples of net.tomp2p.storage.Data.addBasedOn()

    futurePut1.awaitUninterruptibly();
    Assert.assertTrue(futurePut1.isSuccess());
    // add another version with the correct key pair 1
    Number160 vKey2 = Number160.createHash("version2");
    data = new Data("data1v2").protectEntryNow(keyPair1, factory);
    data.addBasedOn(vKey1);
    FuturePut futurePut2 = p1.put(lKey).domainKey(dKey).sign().data(cKey, data).keyPair(keyPair1)
            .versionKey(vKey2).start();
    futurePut2.awaitUninterruptibly();
    Assert.assertTrue(futurePut2.isSuccess());
    // put new version with other key pair 2 (expected to fail)
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.