Package org.hive2hive.core.processes.framework.abstracts

Examples of org.hive2hive.core.processes.framework.abstracts.ProcessComponent.start()


    while (!components.isEmpty() && executionIndex < components.size() && getState() == ProcessState.RUNNING) {

      checkAsyncComponentsForFail(asyncHandles);
      rollbackIndex = executionIndex;
      ProcessComponent next = components.get(executionIndex);
      next.start();
      executionIndex++;

      if (next instanceof AsyncComponent) {
        asyncHandles.add(((AsyncComponent) next).getHandle());
      }
View Full Code Here


    TestVersionSelector selector = new TestVersionSelector(versionToRestore);
    ProcessComponent process = ProcessFactory.instance().createRecoverFileProcess(file, selector, client);
    TestProcessComponentListener listener = new TestProcessComponentListener();
    process.attachListener(listener);
    process.start();
    UseCaseTestUtil.waitTillSucceded(listener, 120);

    // to verify, find the restored file
    File restoredFile = null;
    for (File fileInList : root.listFiles()) {
View Full Code Here

      NoSessionException {
    Set<String> onlyMe = new HashSet<String>(1);
    onlyMe.add(networkManager.getUserId());
    ProcessComponent notificationProcess = ProcessFactory.instance().createNotificationProcess(
        messageFactory, onlyMe, networkManager);
    notificationProcess.start();
  }
}
View Full Code Here

  private void downloadSingle() {
    try {
      logger.debug("Got notified and start to download the file '{}'.", index.getName());
      ProcessComponent process = ProcessFactory.instance().createDownloadFileProcess(
          index.getFilePublicKey(), networkManager);
      process.start();
    } catch (Exception e) {
      logger.error("Got notified but cannot download the file.", e);
    }
  }
View Full Code Here

  private void downloadTree(FolderIndex folder) {
    List<Index> files = Index.getIndexList(folder);
    try {
      ProcessComponent process = FileRecursionUtil.buildDownloadProcess(files, networkManager);
      process.start();
      logger.debug("Got notified and start downloading a file tree.");
    } catch (Exception e) {
      logger.error("Could not download the full tree.", e);
    }
  }
View Full Code Here

  private void startDownload() {
    try {
      ProcessComponent process = ProcessFactory.instance().createDownloadFileProcess(
          index.getFilePublicKey(), networkManager);
      logger.debug("Start downloading the file '{}'.", index.getFullPath());
      process.start();
    } catch (NoSessionException | InvalidProcessStateException e) {
      logger.error("Could not start the download of the newly shared file.");
    }
  }
View Full Code Here

  @Override
  public void run() {
    logger.debug("Received a user profile task notification from '{}'.", senderId);
    try {
      ProcessComponent process = ProcessFactory.instance().createUserProfileTaskStep(networkManager);
      process.start();
    } catch (InvalidProcessStateException e) {
      logger.error("Cannot handle user profile task queue. Currently no user is logged in.");
    }
  }
}
View Full Code Here

    /** 3. download the files that are now available */
    List<Index> fileList = Index.getIndexList(sharedIndex);
    // the folder itself is also contained, so remove it
    ProcessComponent downloadProcess = FileRecursionUtil.buildDownloadProcess(fileList, networkManager);
    logger.debug("Start to download {} files that have been shared with me.", fileList.size());
    downloadProcess.start();
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.