Package net.tomp2p.p2p

Examples of net.tomp2p.p2p.PeerMaker


    clientConfig.signatureFactory(factory);
    ChannelServerConficuration serverConfig = PeerMaker.createDefaultChannelServerConfiguration();
    serverConfig.signatureFactory(factory);

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4834).keyPair(keyPairPeer1)
        .setEnableIndirectReplication(true).channelClientConfiguration(clientConfig)
        .channelServerConfiguration(serverConfig).makeAndListen();
    KeyPair keyPairPeer2 = gen.generateKeyPair();
    Peer p2 = new PeerMaker(Number160.createHash(2)).masterPeer(p1).keyPair(keyPairPeer2)
        .setEnableIndirectReplication(true).channelClientConfiguration(clientConfig)
        .channelServerConfiguration(serverConfig).makeAndListen();

    p2.bootstrap().setPeerAddress(p1.getPeerAddress()).start().awaitUninterruptibly();
    p1.bootstrap().setPeerAddress(p2.getPeerAddress()).start().awaitUninterruptibly();
View Full Code Here


    clientConfig.signatureFactory(factory);
    ChannelServerConficuration serverConfig = PeerMaker.createDefaultChannelServerConfiguration();
    serverConfig.signatureFactory(factory);

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4834).keyPair(keyPairPeer1)
        .setEnableIndirectReplication(true).channelClientConfiguration(clientConfig)
        .channelServerConfiguration(serverConfig).makeAndListen();
    KeyPair keyPairPeer2 = gen.generateKeyPair();
    Peer p2 = new PeerMaker(Number160.createHash(2)).masterPeer(p1).keyPair(keyPairPeer2)
        .setEnableIndirectReplication(true).channelClientConfiguration(clientConfig)
        .channelServerConfiguration(serverConfig).makeAndListen();

    p2.bootstrap().setPeerAddress(p1.getPeerAddress()).start().awaitUninterruptibly();
    p1.bootstrap().setPeerAddress(p2.getPeerAddress()).start().awaitUninterruptibly();
View Full Code Here

    clientConfig.signatureFactory(factory);
    ChannelServerConficuration serverConfig = PeerMaker.createDefaultChannelServerConfiguration();
    serverConfig.signatureFactory(factory);

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4834).keyPair(keyPairPeer1)
        .setEnableIndirectReplication(true).channelClientConfiguration(clientConfig)
        .channelServerConfiguration(serverConfig).makeAndListen();
    KeyPair keyPairPeer2 = gen.generateKeyPair();
    Peer p2 = new PeerMaker(Number160.createHash(2)).masterPeer(p1).keyPair(keyPairPeer2)
        .setEnableIndirectReplication(true).channelClientConfiguration(clientConfig)
        .channelServerConfiguration(serverConfig).makeAndListen();

    p2.bootstrap().setPeerAddress(p1.getPeerAddress()).start().awaitUninterruptibly();
    p1.bootstrap().setPeerAddress(p2.getPeerAddress()).start().awaitUninterruptibly();
View Full Code Here

    clientConfig.signatureFactory(factory);
    ChannelServerConficuration serverConfig = PeerMaker.createDefaultChannelServerConfiguration();
    serverConfig.signatureFactory(factory);

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4834).keyPair(keyPairPeer1)
        .setEnableIndirectReplication(true).channelClientConfiguration(clientConfig)
        .channelServerConfiguration(serverConfig).makeAndListen();
    KeyPair keyPairPeer2 = gen.generateKeyPair();
    Peer p2 = new PeerMaker(Number160.createHash(2)).masterPeer(p1).keyPair(keyPairPeer2)
        .setEnableIndirectReplication(true).channelClientConfiguration(clientConfig)
        .channelServerConfiguration(serverConfig).makeAndListen();

    p2.bootstrap().setPeerAddress(p1.getPeerAddress()).start().awaitUninterruptibly();
    p1.bootstrap().setPeerAddress(p2.getPeerAddress()).start().awaitUninterruptibly();
View Full Code Here

      ClassNotFoundException, InvalidKeyException, SignatureException, NoSuchPaddingException,
      IllegalBlockSizeException, BadPaddingException {
    KeyPairGenerator gen = KeyPairGenerator.getInstance("DSA");

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4834).keyPair(keyPairPeer1)
        .setEnableIndirectReplication(true).makeAndListen();
    KeyPair keyPairPeer2 = gen.generateKeyPair();
    Peer p2 = new PeerMaker(Number160.createHash(2)).masterPeer(p1).keyPair(keyPairPeer2)
        .setEnableIndirectReplication(true).makeAndListen();

    p2.bootstrap().setPeerAddress(p1.getPeerAddress()).start().awaitUninterruptibly();
    p1.bootstrap().setPeerAddress(p2.getPeerAddress()).start().awaitUninterruptibly();
View Full Code Here

      IOException, ClassNotFoundException, InvalidKeyException, SignatureException,
      NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException {
    KeyPairGenerator gen = KeyPairGenerator.getInstance("DSA");

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4834).keyPair(keyPairPeer1)
        .setEnableIndirectReplication(true).makeAndListen();
    KeyPair keyPairPeer2 = gen.generateKeyPair();
    Peer p2 = new PeerMaker(Number160.createHash(2)).masterPeer(p1).keyPair(keyPairPeer2)
        .setEnableIndirectReplication(true).makeAndListen();

    p2.bootstrap().setPeerAddress(p1.getPeerAddress()).start().awaitUninterruptibly();
    p1.bootstrap().setPeerAddress(p2.getPeerAddress()).start().awaitUninterruptibly();
View Full Code Here

    ChannelServerConficuration serverConfig = PeerMaker.createDefaultChannelServerConfiguration();
    serverConfig.signatureFactory(new H2HSignatureFactory());
    serverConfig.pipelineFilter(new PeerMaker.EventExecutorGroupFilter(eventExecutorGroup));

    try {
      peer = new PeerMaker(Number160.createHash(nodeID)).ports(port).setEnableIndirectReplication(true)
          .channelClientConfiguration(clientConfig).channelServerConfiguration(serverConfig).makeAndListen();
    } catch (IOException e) {
      logger.error("Exception while creating a peer: ", e);
      return false;
    }
View Full Code Here

  public void testTTLDecrement() throws IOException, ClassNotFoundException, NoSuchAlgorithmException,
      InvalidKeyException, SignatureException, InterruptedException {
    KeyPairGenerator gen = KeyPairGenerator.getInstance("DSA");

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4834).keyPair(keyPairPeer1)
        .setEnableIndirectReplication(true).storageIntervalMillis(1).makeAndListen();
    KeyPair keyPairPeer2 = gen.generateKeyPair();
    Peer p2 = new PeerMaker(Number160.createHash(2)).masterPeer(p1).keyPair(keyPairPeer2)
        .setEnableIndirectReplication(true).storageIntervalMillis(1).makeAndListen();

    p2.bootstrap().setPeerAddress(p1.getPeerAddress()).start().awaitUninterruptibly();
    p1.bootstrap().setPeerAddress(p2.getPeerAddress()).start().awaitUninterruptibly();
View Full Code Here

    beforeClass();
  }

  @Test
  public void testReplicationPureTomP2P() throws IOException, InterruptedException {
    Peer p1 = new PeerMaker(Number160.createHash(1)).setEnableIndirectReplication(true).ports(5000)
        .makeAndListen();
    Peer p2 = new PeerMaker(Number160.createHash(2)).setEnableIndirectReplication(true).masterPeer(p1)
        .makeAndListen();
    Peer p3 = new PeerMaker(Number160.createHash(3)).setEnableIndirectReplication(true).masterPeer(p1)
        .makeAndListen();

    p2.bootstrap().setPeerAddress(p1.getPeerAddress()).start().awaitUninterruptibly();

    FuturePut putFuture = p2.put(Number160.createHash("key"))
View Full Code Here

    @Test
    public void testRPC1() throws Exception {
        Peer peer1 = null;
        Peer peer2 = null;
        try {
            peer1 = new PeerMaker(new Number160(rnd)).setWorkerThreads(1).setPorts(4001).setEnableTask(true)
                    .makeAndListen();
            peer2 = new PeerMaker(new Number160(rnd)).setWorkerThreads(1).setPorts(4002).setEnableTask(true)
                    .makeAndListen();
            FutureChannelCreator futureChannelCreator = peer1.getConnectionBean().getConnectionReservation().reserve(1);
            futureChannelCreator.awaitUninterruptibly();
            Number160 taskId = new Number160(11);
            Map<Number160, Data> dataMap = new HashMap<Number160, Data>();
View Full Code Here

TOP

Related Classes of net.tomp2p.p2p.PeerMaker

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.