Package org.syncany.operations.ls_remote

Examples of org.syncany.operations.ls_remote.LsRemoteOperationResult


  @Override
  public Response handleRequest(FolderRequest request) {
    try {
      LsRemoteOperation operation = new LsRemoteOperation(config);
      LsRemoteOperationResult operationResult = operation.execute();
      LsRemoteFolderResponse response = new LsRemoteFolderResponse(operationResult, request.getId());
   
      return response;
    }
    catch (Exception e) {
View Full Code Here


      return false;
    }

    // Find remote changes (unless --force is enabled)
    if (!options.forceUploadEnabled()) {
      LsRemoteOperationResult lsRemoteOperationResult = new LsRemoteOperation(config, transferManager).execute();
      List<DatabaseRemoteFile> unknownRemoteDatabases = lsRemoteOperationResult.getUnknownRemoteDatabases();

      if (unknownRemoteDatabases.size() > 0) {
        logger.log(Level.INFO, "There are remote changes. Call 'down' first or use --force you must, Luke!");
        result.setResultCode(UpResultCode.NOK_UNKNOWN_DATABASES);
View Full Code Here

     
      return false;
    }
   
    // Check which remote databases to download based on the last local vector clock
    LsRemoteOperationResult lsRemoteResult = listUnknownRemoteDatabases();
    result.setLsRemoteResult(lsRemoteResult);
   
    if (lsRemoteResult.getUnknownRemoteDatabases().isEmpty()) {
      logger.log(Level.INFO, "* Nothing new. Skipping down operation.");
      result.setResultCode(DownResultCode.OK_NO_REMOTE_CHANGES);

      return false;
    }
View Full Code Here

    Iterator<DatabaseVersion> dirtyDatabaseVersions = localDatabase.getDirtyDatabaseVersions();
    return dirtyDatabaseVersions.hasNext(); // TODO [low] Is this a resource creeper?
  }

  private boolean hasRemoteChanges() throws Exception {
    LsRemoteOperationResult lsRemoteOperationResult = new LsRemoteOperation(config).execute();
    return lsRemoteOperationResult.getUnknownRemoteDatabases().size() > 0;
  }
View Full Code Here

    return true;
  }
 
  @Override
  public int execute(String[] operationArgs) throws Exception {
    LsRemoteOperationResult operationResult = client.lsRemote();
    printResults(operationResult);   
   
    return 0;
  }
View Full Code Here

    return null;
  }

  @Override
  public void printResults(OperationResult operationResult) {
    LsRemoteOperationResult concreteOperationResult = (LsRemoteOperationResult) operationResult;
    List<DatabaseRemoteFile> remoteStatus = concreteOperationResult.getUnknownRemoteDatabases();
   
    if (remoteStatus.size() > 0) {
      for (RemoteFile unknownRemoteFile : remoteStatus) {
        out.println("? "+unknownRemoteFile.getName());
      }
View Full Code Here

TOP

Related Classes of org.syncany.operations.ls_remote.LsRemoteOperationResult

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.