Search in sources :

Example 1 with LogOperationResult

use of org.syncany.operations.log.LogOperationResult in project syncany by syncany.

the class LogCommand method printResults.

@Override
public void printResults(OperationResult operationResult) {
    LogOperationResult concreteOperationResult = (LogOperationResult) operationResult;
    List<LightweightDatabaseVersion> databaseVersions = concreteOperationResult.getDatabaseVersions();
    Collections.reverse(databaseVersions);
    for (LightweightDatabaseVersion databaseVersion : databaseVersions) {
        boolean hasChanges = databaseVersion.getChangeSet().hasChanges();
        boolean printDatabaseVersion = hasChanges || !excludeEmpty;
        if (printDatabaseVersion) {
            printDatabaseVersion(databaseVersion);
        }
    }
}
Also used : LogOperationResult(org.syncany.operations.log.LogOperationResult) LightweightDatabaseVersion(org.syncany.operations.log.LightweightDatabaseVersion)

Example 2 with LogOperationResult

use of org.syncany.operations.log.LogOperationResult in project syncany by syncany.

the class LogCommand method execute.

@Override
public int execute(String[] operationArgs) throws Exception {
    LogOperationOptions operationOptions = parseOptions(operationArgs);
    LogOperationResult operationResult = new LogOperation(config, operationOptions).execute();
    printResults(operationResult);
    return 0;
}
Also used : LogOperation(org.syncany.operations.log.LogOperation) LogOperationResult(org.syncany.operations.log.LogOperationResult) LogOperationOptions(org.syncany.operations.log.LogOperationOptions)

Example 3 with LogOperationResult

use of org.syncany.operations.log.LogOperationResult in project syncany by syncany.

the class LogFolderRequestHandler method handleRequest.

@Override
public Response handleRequest(FolderRequest request) {
    LogFolderRequest concreteRequest = (LogFolderRequest) request;
    try {
        LogOperation operation = new LogOperation(config, concreteRequest.getOptions());
        LogOperationResult operationResult = operation.execute();
        LogFolderResponse response = new LogFolderResponse(operationResult, request.getId(), request.getRoot());
        return response;
    } catch (Exception e) {
        logger.log(Level.WARNING, "Cannot obtain status.", e);
        return new BadRequestResponse(request.getId(), "Cannot execute operation: " + e.getMessage());
    }
}
Also used : LogOperation(org.syncany.operations.log.LogOperation) LogOperationResult(org.syncany.operations.log.LogOperationResult)

Aggregations

LogOperationResult (org.syncany.operations.log.LogOperationResult)3 LogOperation (org.syncany.operations.log.LogOperation)2 LightweightDatabaseVersion (org.syncany.operations.log.LightweightDatabaseVersion)1 LogOperationOptions (org.syncany.operations.log.LogOperationOptions)1