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(nodeB.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);

    // verify that data arrived
    String result = ((H2HTestData) futureGet.getData().object()).getTestString();
View Full Code Here


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

    // verify that data arrived
    String result = ((H2HTestData) futureGet.getData().object()).getTestString();
View Full Code Here

  public void run() {
    try {
      networkManager
          .getDataManager()
          .putUnblocked(
              new Parameters().setLocationKey(networkManager.getNodeId())
                  .setContentKey(contentKey).setData(wrapper)).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

    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

      throws InvalidProcessStateException {
    return get(H2HEncryptionUtil.key2String(locationKey), contentKey);
  }

  protected NetworkContent get(String locationKey, String contentKey) throws InvalidProcessStateException {
    IParameters parameters = new Parameters().setLocationKey(locationKey).setContentKey(contentKey);
    return dataManager.get(parameters);
  }
View Full Code Here

    put(H2HEncryptionUtil.key2String(locationKey), contentKey, content, protectionKey);
  }

  protected void put(String locationKey, String contentKey, NetworkContent content, KeyPair protectionKeys)
      throws PutFailedException {
    Parameters parameters = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setVersionKey(content.getVersionKey()).setData(content).setProtectionKeys(protectionKeys)
        .setTTL(content.getTimeToLive());

    put(parameters);
  }
View Full Code Here

    remove(H2HEncryptionUtil.key2String(locationKey), contentKey, protectionKey);
  }

  protected void remove(String locationKey, String contentKey, KeyPair protectionKey)
      throws RemoveFailedException {
    parameters = new Parameters().setLocationKey(locationKey).setContentKey(contentKey)
        .setProtectionKeys(protectionKey);

    // deletes all versions
    boolean success = dataManager.remove(parameters);
    removePerformed = true;
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.