Package net.tomp2p.p2p

Examples of net.tomp2p.p2p.PeerMaker


    p2.shutdown().awaitUninterruptibly();
  }

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

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

    String locationKey = "location";
View Full Code Here


    p2.shutdown().awaitUninterruptibly();
  }

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

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

    String locationKey = "location";
View Full Code Here

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

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4838).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

    KeyPairGenerator gen = KeyPairGenerator.getInstance("DSA");

    SignatureFactory factory = new DSASignatureFactory();

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4838).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

    KeyPairGenerator gen = KeyPairGenerator.getInstance("DSA");

    SignatureFactory factory = new DSASignatureFactory();

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4838).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

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

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4836).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

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

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4838).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

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

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4838).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

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

    KeyPair keyPairPeer1 = gen.generateKeyPair();
    Peer p1 = new PeerMaker(Number160.createHash(1)).ports(4838).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

  public void testChangeProtectionKeyWithVersionKeyWithoutDataSignature() throws NoSuchAlgorithmException,
      IOException, ClassNotFoundException, InvalidKeyException, SignatureException {
    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

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.