Package net.tomp2p.storage

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


            slave2.peerBean().peerMap().peerFound(master.peerAddress(), null, null);
            slave2.peerBean().peerMap().peerFound(slave1.peerAddress(), null, null);
            Number160 locationKey = new Number160(50);

            Data data1 = new Data("test1");
            data1.protectEntry(pair1);
            FuturePut fdht1 = master.put(locationKey).data(data1).sign().start();
            fdht1.awaitUninterruptibly();
            fdht1.futureRequests().awaitUninterruptibly();
            Assert.assertEquals(true, fdht1.isSuccess());
            // store again
View Full Code Here


            fdht1.awaitUninterruptibly();
            fdht1.futureRequests().awaitUninterruptibly();
            Assert.assertEquals(true, fdht1.isSuccess());
            // store again
            Data data2 = new Data("test1");
            data2.protectEntry(pair2);
            FuturePut fdht2 = slave1.put(locationKey).data(data2).sign().start();
            fdht2.awaitUninterruptibly();
            fdht2.futureRequests().awaitUninterruptibly();
            Assert.assertEquals(0, fdht2.result().size());
            Assert.assertEquals(false, fdht2.isSuccess());
View Full Code Here

            fdht3.awaitUninterruptibly();
            // false, since we have domain protection yet
            Assert.assertEquals(false, fdht3.isSuccess());
            // try to put another thing
            Data data3 = new Data("test2");
            data3.protectEntry(pair1);
            FuturePut fdht4 = master.put(locationKey).sign().data(new Number160(33), data3).start();
            fdht4.awaitUninterruptibly();
            fdht4.futureRequests().awaitUninterruptibly();
            Assert.assertEquals(true, fdht4.isSuccess());
            // get it
View Full Code Here

            fdht8.awaitUninterruptibly();
            fdht8.futureRequests().awaitUninterruptibly();
            Assert.assertEquals(true, fdht8.isSuccess());
            // overwrite
            Data data4 = new Data("test1");
            data4.protectEntry(pair1);
            FuturePut fdht9 = master.put(locationKey).data(Utils.makeSHAHash(pair1.getPublic().getEncoded()), data4).sign()
                    .start();
            fdht9.awaitUninterruptibly();
            fdht9.futureRequests().awaitUninterruptibly();
            System.err.println("reason " + fdht9.failedReason());
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.