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

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


    H2HWaiter w = new H2HWaiter(10);
    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);

    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeB.getDataManager().getUnblocked(
        new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey));
    futureGet.awaitUninterruptibly();
    String originalSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    assertEquals(originalSecret, receivedSecret);
  }
View Full Code Here


   * Performs a get call (blocking) and decrypts the received user profile.
   */
  public void get(QueueEntry entry) {
    logger.debug("Get user profile. user id = '{}'", credentials.getUserId());

    IParameters parameters = new Parameters().setLocationKey(credentials.getProfileLocationKey()).setContentKey(
        H2HConstants.USER_PROFILE);

    // load the current digest list from network
    NavigableMap<Number640, Number160> digest = dataManager.getDigest(parameters);
    // compare the current user profile's version key with the cached one
View Full Code Here

          userProfileEncryptionKey);

      encryptedUserProfile.setBasedOnKey(entry.getUserProfile().getVersionKey());
      encryptedUserProfile.generateVersionKey();

      IParameters parameters = new Parameters().setLocationKey(credentials.getProfileLocationKey())
          .setContentKey(H2HConstants.USER_PROFILE).setVersionKey(encryptedUserProfile.getVersionKey())
          .setData(encryptedUserProfile).setProtectionKeys(entry.getUserProfile().getProtectionKeys())
          .setTTL(entry.getUserProfile().getTimeToLive());

      boolean success = dataManager.put(parameters);
View Full Code Here

      return usersKeyPair.getPublic();
    if (publicKeyCache.containsKey(userId))
      // check the cache
      return publicKeyCache.get(userId);

    IParameters parameters = new Parameters().setLocationKey(userId).setContentKey(
        H2HConstants.USER_PUBLIC_KEY);
    NetworkContent content = dataManager.get(parameters);
    return evaluateResult(content, userId);
  }
View Full Code Here

    try {
      networkManager
          .getDataManager()
          .putUnblocked(
              new Parameters().setLocationKey(networkManager.getNodeId())
                  .setContentKey(contentKey).setData(new H2HTestData(secret)))
          .awaitUninterruptibly();
    } catch (NoPeerConnectionException e) {
      Assert.fail();
    }
View Full Code Here

      String receivedSecret = (String) responseMessage.getContent();
      try {
        networkManager
            .getDataManager()
            .putUnblocked(
                new Parameters().setLocationKey(networkManager.getNodeId())
                    .setContentKey(contentKey).setData(new H2HTestData(receivedSecret)))
            .awaitUninterruptibly();
      } catch (NoPeerConnectionException e) {
        Assert.fail();
      }
View Full Code Here

    try {
      networkManager
          .getDataManager()
          .putUnblocked(
              new Parameters().setLocationKey(networkManager.getNodeId())
                  .setContentKey(contentKey).setData(new H2HTestData(secret)))
          .awaitUninterruptibly();
    } catch (NoPeerConnectionException e) {
      Assert.fail();
    }
View Full Code Here

      String receivedSecret = (String) responseMessage.getContent();
      try {
        networkManager
            .getDataManager()
            .putUnblocked(
                new Parameters().setLocationKey(networkManager.getNodeId())
                    .setContentKey(contentKey).setData(new H2HTestData(receivedSecret)))
            .awaitUninterruptibly();
      } catch (NoPeerConnectionException e) {
        Assert.fail();
      }
View Full Code Here

    H2HWaiter w = new H2HWaiter(10);
    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);

    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeB.getDataManager().getUnblocked(
        new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey));
    futureGet.awaitUninterruptibly();
    String originalSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    assertEquals(originalSecret, receivedSecret);
  }
View Full Code Here

    H2HWaiter w = new H2HWaiter(10);
    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);

    // load and verify if same secret was shared
    String receivedSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    futureGet = nodeB.getDataManager().getUnblocked(
        new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey));
    futureGet.awaitUninterruptibly();
    String originalSecret = ((H2HTestData) futureGet.getData().object()).getTestString();
    assertEquals(originalSecret, receivedSecret);
  }
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.