Package org.hive2hive.core.processes.framework.interfaces

Examples of org.hive2hive.core.processes.framework.interfaces.IProcessComponent


      throw new IllegalArgumentException("File does not exist");
    } else if (!FileUtil.isInH2HDirectory(file, networkManager.getSession())) {
      throw new IllegalArgumentException("File is not in the Hive2Hive directory");
    }

    IProcessComponent updateProcess = ProcessFactory.instance().createUpdateFileProcess(file,
        networkManager);
    AsyncComponent asyncProcess = new AsyncComponent(updateProcess);

    submitProcess(asyncProcess);
    return asyncProcess;
View Full Code Here


      throw new IllegalArgumentException("Source file not in the Hive2Hive directory");
    } else if (!FileUtil.isInH2HDirectory(destination, networkManager.getSession())) {
      throw new IllegalArgumentException("Destination file not in the Hive2Hive directory");
    }

    IProcessComponent moveProcess = ProcessFactory.instance().createMoveFileProcess(source, destination,
        networkManager);

    AsyncComponent asyncProcess = new AsyncComponent(moveProcess);

    submitProcess(asyncProcess);
View Full Code Here

  public IProcessComponent delete(File file) throws NoSessionException, NoPeerConnectionException {
    if (!FileUtil.isInH2HDirectory(file, networkManager.getSession())) {
      throw new IllegalArgumentException("File is not in the Hive2Hive directory");
    }

    IProcessComponent deleteProcess;
    if (file.isDirectory() && file.listFiles().length > 0) {
      // delete the files recursively
      List<Path> preorderList = FileRecursionUtil.getPreorderList(file.toPath());
      deleteProcess = FileRecursionUtil.buildDeletionProcess(preorderList, networkManager);
    } else {
View Full Code Here

      throw new IllegalArgumentException("A foler has only one version");
    } else if (!file.exists()) {
      throw new FileNotFoundException("File does not exist");
    }

    IProcessComponent recoverProcess = ProcessFactory.instance().createRecoverFileProcess(file,
        versionSelector, networkManager);

    AsyncComponent asyncProcess = new AsyncComponent(recoverProcess);

    submitProcess(asyncProcess);
View Full Code Here

    // sharing root folder is not allowed
    if (folder.toPath().toString().equals(root.toString()))
      throw new IllegalFileLocation("Root folder of the H2H directory can't be shared.");

    IProcessComponent shareProcess = ProcessFactory.instance().createShareProcess(folder,
        new UserPermission(userId, permission), networkManager);

    AsyncComponent asyncProcess = new AsyncComponent(shareProcess);

    submitProcess(asyncProcess);
View Full Code Here

    SessionParameters params = new SessionParameters();
    params.setProfileManager(new UserProfileManager(networkManager.getDataManager(), credentials));
    params.setRoot(rootPath);
    params.setFileConfig(fileConfiguration);

    IProcessComponent loginProcess = ProcessFactory.instance().createLoginProcess(credentials, params, networkManager);

    CompletionHandleComponent eventComponent = new CompletionHandleComponent(loginProcess, createLoginHandle(
        credentials, rootPath));

    AsyncComponent asyncProcess = new AsyncComponent(eventComponent);
View Full Code Here

    return asyncProcess;
  }

  @Override
  public IProcessComponent logout() throws NoPeerConnectionException, NoSessionException {
    IProcessComponent logoutProcess = ProcessFactory.instance().createLogoutProcess(networkManager);

    CompletionHandleComponent eventComponent = new CompletionHandleComponent(logoutProcess,
        createLogoutHandle(networkManager.getSession().getCredentials()));

    AsyncComponent asyncProcess = new AsyncComponent(eventComponent);
View Full Code Here

  }

  @Override
  public boolean isRegistered(String userId) throws NoPeerConnectionException {
    IsRegisteredContext context = new IsRegisteredContext();
    IProcessComponent checkProcess = new GetUserLocationsStep(userId, context, networkManager.getDataManager());
    executeProcess(checkProcess);

    return context.isRegistered();
  }
View Full Code Here

TOP

Related Classes of org.hive2hive.core.processes.framework.interfaces.IProcessComponent

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.