Package org.hive2hive.core.network.data.parameters

Examples of org.hive2hive.core.network.data.parameters.Parameters


    int counter = 0;
    for (String contentKey : testContentKeys) {
      FutureGet futureGet = null;
      try {
        futureGet = sender.getDataManager().getUnblocked(
            new Parameters().setLocationKey(sender.getNodeId()).setContentKey(contentKey));
        futureGet.awaitUninterruptibly();
      } catch (NoPeerConnectionException e1) {
        Assert.fail();
      }
View Full Code Here


    // add them already to the DHT
    SecretKey encryptionKeys = PasswordUtil.generateAESKeyFromPassword(credentials.getPassword(), credentials.getPin(),
        H2HConstants.KEYLENGTH_USER_PROFILE);
    EncryptedNetworkContent encrypted = H2HEncryptionUtil.encryptAES(testProfile, encryptionKeys);
    FuturePut putGlobal = putter.getDataManager().putUnblocked(
        new Parameters().setLocationKey(credentials.getProfileLocationKey())
            .setContentKey(H2HConstants.USER_PROFILE).setData(encrypted));
    putGlobal.awaitUninterruptibly();

    UserProfile profile = UseCaseTestUtil.getUserProfile(putter, credentials);
View Full Code Here

    NetworkManager nodeA = network.get(random.nextInt(network.size() / 2));
    final NetworkManager nodeB = network.get(random.nextInt(network.size() / 2) + network.size() / 2);
    // generate random data and content key
    String data = NetworkTestUtil.randomString();
    String contentKey = NetworkTestUtil.randomString();
    Parameters parameters = new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey);

    // check if selected location is empty
    FutureGet futureGet = nodeA.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
View Full Code Here

    NetworkManager nodeA = network.get(random.nextInt(network.size() / 2));
    final NetworkManager nodeB = network.remove(random.nextInt(network.size() / 2) + network.size() / 2);
    // generate random data and content key
    String data = NetworkTestUtil.randomString();
    String contentKey = NetworkTestUtil.randomString();
    Parameters parameters = new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey);

    // check if selected location is empty
    FutureGet futureGet = nodeA.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
View Full Code Here

    // put for verification
    try {
      networkManager
          .getDataManager()
          .putUnblocked(
              new Parameters().setLocationKey(verificationLoc)
                  .setContentKey(verificationContentKey).setData(verificationData))
          .awaitUninterruptibly();
    } catch (NoPeerConnectionException e) {
      Assert.fail();
    }
View Full Code Here

    // select two random nodes
    final NetworkManager nodeA = network.get(random.nextInt(network.size() / 2));
    final NetworkManager nodeB = network.get(random.nextInt(network.size() / 2) + network.size() / 2);
    // generate a random content key
    final String contentKey = NetworkTestUtil.randomString();
    final Parameters parametersA = new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey);
    final Parameters parametersB = new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey);
   
    // check if selected locations are empty
    FutureGet futureGet = nodeA.getDataManager().getUnblocked(parametersB);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
View Full Code Here

    Assert.assertNotNull(client.getSession());
    Assert.assertEquals(userCredentials.getUserId(), client.getUserId());

    // verify the locations map
    FutureGet futureGet = client.getDataManager().getUnblocked(
        new Parameters().setLocationKey(userCredentials.getUserId()).setContentKey(H2HConstants.USER_LOCATIONS));
    futureGet.awaitUninterruptibly();

    Locations locations = (Locations) futureGet.getData().object();
    Assert.assertEquals(1, locations.getPeerAddresses().size());
  }
View Full Code Here

    NetworkManager nodeA = network.get(random.nextInt(network.size() / 2));
    final NetworkManager nodeB = network.get(random.nextInt(network.size() / 2) + network.size() / 2);
    // generate random data and content key
    String data = NetworkTestUtil.randomString();
    String contentKey = NetworkTestUtil.randomString();
    Parameters parameters = new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey);

    // check if selected location is empty
    FutureGet futureGet = nodeA.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
View Full Code Here

    NetworkManager nodeA = network.get(random.nextInt(network.size() / 2));
    final NetworkManager nodeB = network.remove(random.nextInt(network.size() / 2) + network.size() / 2);
    // generate random data and content key
    String data = NetworkTestUtil.randomString();
    String contentKey = NetworkTestUtil.randomString();
    Parameters parameters = new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey);

    // check if selected location is empty
    FutureGet futureGet = nodeA.getDataManager().getUnblocked(parameters);
    futureGet.awaitUninterruptibly();
    assertNull(futureGet.getData());
View Full Code Here

    // select two random nodes
    final NetworkManager nodeA = network.get(random.nextInt(network.size() / 2));
    final NetworkManager nodeB = network.get(random.nextInt(network.size() / 2) + network.size() / 2);
    // generate a random content key
    final String contentKey = NetworkTestUtil.randomString();
    final Parameters parametersA = new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(
        contentKey);
    final Parameters parametersB = new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(
        contentKey);

    // check if selected locations are empty
    FutureGet futureGet = nodeB.getDataManager().getUnblocked(parametersA);
    futureGet.awaitUninterruptibly();
View Full Code Here

TOP

Related Classes of org.hive2hive.core.network.data.parameters.Parameters

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.