use of org.syncany.operations.daemon.messages.LsRemoteEndSyncExternalEvent in project syncany by syncany.
the class LsRemoteOperation method execute.
@Override
public LsRemoteOperationResult execute() throws Exception {
logger.log(Level.INFO, "");
logger.log(Level.INFO, "Running 'Remote Status' at client " + config.getMachineName() + " ...");
logger.log(Level.INFO, "--------------------------------------------");
eventBus.post(new LsRemoteStartSyncExternalEvent(config.getLocalDir().getAbsolutePath()));
TransferManager transferManager = createTransferManager(loadedTransferManager);
List<DatabaseRemoteFile> knownDatabases = localDatabase.getKnownDatabases();
List<DatabaseRemoteFile> unknownRemoteDatabases = listUnknownRemoteDatabases(transferManager, knownDatabases);
transferManager.disconnect();
boolean hasChanges = unknownRemoteDatabases.size() > 0;
eventBus.post(new LsRemoteEndSyncExternalEvent(config.getLocalDir().getAbsolutePath(), hasChanges));
return new LsRemoteOperationResult(new ArrayList<>(unknownRemoteDatabases));
}
Aggregations