Package net.tomp2p.rpc.NeighborRPC

Examples of net.tomp2p.rpc.NeighborRPC.SearchValues


                Number640 key = new Number640(new Number160(0x1), Number160.ZERO, Number160.createHash(i), Number160.ZERO);
                sender.storageLayer().put(key, new Data("test"), null, false, false);
                bf.add(Number160.createHash(i));
            }

            SearchValues v = new SearchValues(new Number160("0x1"), null, bf);
            FutureResponse fr = neighbors2.closeNeighbors(sender.peerAddress(), v,
                    Type.REQUEST_2, cc, new DefaultConnectionConfiguration());

            fr.awaitUninterruptibly();
            // Thread.sleep(10000000);
View Full Code Here


          
            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(1, 0);
            fcc.awaitUninterruptibly();
            ChannelCreator cc = fcc.channelCreator();

            SearchValues v = new SearchValues(new Number160("0x1"), null);
            FutureResponse fr = neighbors2.closeNeighbors(sender.peerAddress(), v,
                    Type.REQUEST_2, cc, new DefaultConnectionConfiguration());

            fr.awaitUninterruptibly();
            // Thread.sleep(10000000);
View Full Code Here

            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(0, 1);

            fcc.awaitUninterruptibly();
            ChannelCreator cc = fcc.channelCreator();

            SearchValues v = new SearchValues(new Number160("0x1"), null);
            DefaultConnectionConfiguration d = new DefaultConnectionConfiguration();
            d.forceTCP();
            FutureResponse fr = neighbors2.closeNeighbors(sender.peerAddress(), v,
                    Type.REQUEST_2, cc, d);
View Full Code Here

            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(1, 0);
            fcc.awaitUninterruptibly();
            ChannelCreator cc = fcc.channelCreator();

            SearchValues v = new SearchValues(new Number160("0x30"), null);
            FutureResponse fr = neighbors2.closeNeighbors(sender.peerAddress(), v,
                    Type.REQUEST_2, cc, new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
            NeighborSet pas = fr.responseMessage().neighborsSet(0);
View Full Code Here

            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(1, 0);
            fcc.awaitUninterruptibly();
            ChannelCreator cc = fcc.channelCreator();

            try {
                SearchValues v = new SearchValues(new Number160("0x30"), null);
                neighbors2.closeNeighbors(sender.peerAddress(), v,
                        Type.EXCEPTION, cc, new DefaultConnectionConfiguration());
                Assert.fail("");
            } catch (IllegalArgumentException i) {
                cc.shutdown();
View Full Code Here

    /**
     * @return The search values for the neighbor request, or null if no content key specified
     */
    public SearchValues searchValues() {
        if (contentKey() != null) {
          return new SearchValues(locationKey, domainKey, contentKey());
        } else if(from !=null && to!=null) {
          return new SearchValues(locationKey, domainKey, from, to);
        } else if (contentBloomFilter() == null && keyBloomFilter() != null) {
            return new SearchValues(locationKey, domainKey, keyBloomFilter());
        } else if (contentBloomFilter() != null && keyBloomFilter() != null) {
            return new SearchValues(locationKey, domainKey, keyBloomFilter(), contentBloomFilter());
        } else {
            return new SearchValues(locationKey, domainKey);
        }
    }
View Full Code Here

TOP

Related Classes of net.tomp2p.rpc.NeighborRPC.SearchValues

Copyright © 2018 www.massapicom. 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.