Package net.sourceforge.fullsync

Examples of net.sourceforge.fullsync.TaskTree


  }

  @Override
  public void profileExecutionScheduled(Profile profile) {
    Synchronizer sync = guiController.getSynchronizer();
    TaskTree tree = sync.executeProfile(profile, false);
    if (tree == null) {
      profile.setLastError(1, Messages.getString("MainWindow.Error_Comparing_Filesystems")); //$NON-NLS-1$
    }
    else {
      int errorLevel = sync.performActions(tree);
View Full Code Here


    });
    worker.start();
  }

  private synchronized void doRunProfile(Profile p, boolean interactive) {
    TaskTree t = null;
    Timer statusDelayTimer = null;
    try {
      guiController.showBusyCursor(true);
      try {
        // REVISIT wow, a timer here is pretty much overhead / specific for
View Full Code Here

      throw new FileSystemException("destination is unavailable");
    }

    this.actionDecider = actionDecider;

    TaskTree tree = new TaskTree(source, destination);
    Task root = new Task(null, null, new State(State.NodeInSync, Location.None), new Action[] { new Action(Action.Nothing,
        Location.None, BufferUpdate.None, "Root") });
    tree.setRoot(root);

    for (TaskGenerationListener listener : taskGenerationListeners) {
      listener.taskTreeStarted(tree);
    }
View Full Code Here

  }

  @Override
  public TaskTree executeProfile(String name) throws RemoteException {
    Profile p = profileManager.getProfile(name);
    TaskTree tree = synchronizer.executeProfile(p, false);
    return tree;
  }
View Full Code Here

      final Synchronizer sync = new Synchronizer();

      // Apply executing options
      if (line.hasOption("r")) {
        Profile p = profileManager.getProfile(line.getOptionValue("r"));
        TaskTree tree = sync.executeProfile(p, false);
        sync.performActions(tree);
        p.setLastUpdate(new Date());
        profileManager.save();
        return;
      }

      boolean activateRemote = false;
      int port = 10000;
      String password = "admin";
      RemoteException listenerStarupException = null;

      if (line.hasOption("p")) {
        activateRemote = true;
        try {
          String portStr = line.getOptionValue("p");
          port = Integer.parseInt(portStr);
        }
        catch (NumberFormatException e) {
        }

        if (line.hasOption("a")) {
          password = line.getOptionValue("a");
        }
      }
      else {
        activateRemote = preferences.listeningForRemoteConnections();
        port = preferences.getRemoteConnectionsPort();
        password = preferences.getRemoteConnectionsPassword();
      }
      if (activateRemote) {
        try {
          Logger logger = LoggerFactory.getLogger("FullSync");

          RemoteController.getInstance().startServer(port, password, profileManager, sync);
          logger.info("Remote Interface available on port: " + port);
        }
        catch (RemoteException e) {
          ExceptionHandler.reportException(e);
          listenerStarupException = e;
        }
      }

      if (line.hasOption("d")) {
        profileManager.addSchedulerListener(new ProfileSchedulerListener() {
          @Override
          public void profileExecutionScheduled(Profile profile) {
            TaskTree tree = sync.executeProfile(profile, false);
            if (tree == null) {
              profile.setLastError(1, "An error occured while comparing filesystems.");
            }
            else {
              int errorLevel = sync.performActions(tree);
View Full Code Here

    expectation = new Hashtable<String, Action>();
  }

  @After
  public void after() throws Exception {
    TaskTree tree;
    /* Phase One: */
    tree = assertPhaseOneActions(expectation);
    /* Phase Two: */
    synchronizer.performActions(tree); // TODO assert task finished events ?
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.fullsync.TaskTree

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.