Package org.hive2hive.core.processes.implementations.common

Examples of org.hive2hive.core.processes.implementations.common.GetMetaFileStep


  }

  public static MetaFile getMetaFile(NetworkManager networkManager, KeyPair keys, boolean expectSuccess)
      throws NoPeerConnectionException, InvalidProcessStateException {
    GetMetaFileContext context = new GetMetaFileContext(keys);
    GetMetaFileStep step = new GetMetaFileStep(context, context, networkManager.getDataManager());
    if (expectSuccess) {
      executeProcess(step);
      return context.metaFile;
    } else {
      TestProcessComponentListener listener = new TestProcessComponentListener();
      step.attachListener(listener);
      step.start();
      waitTillFailed(listener, MAX_PROCESS_WAIT_TIME);
      return null;
    }
  }
View Full Code Here


      getParent().add(new CreateFolderStep(context, networkManager));
    } else {
      logger.info("Initalize the process for downloading file '{}'.", index.getFullPath());
      try {
        IDataManager dataManager = networkManager.getDataManager();
        getParent().add(new GetMetaFileStep(context, context, dataManager));
        PeerAddress ownPeerAddress = networkManager.getConnection().getPeer().getPeerAddress();
        getParent().add(
            new InitDownloadChunksStep(context, networkManager.getSession(), ownPeerAddress));
      } catch (NoPeerConnectionException | NoSessionException e) {
        throw new ProcessExecutionException(e);
View Full Code Here

TOP

Related Classes of org.hive2hive.core.processes.implementations.common.GetMetaFileStep

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.