Search in sources :

Example 1 with SyncStatus

use of org.syncany.operations.daemon.Watch.SyncStatus in project syncany by syncany.

the class WatchServer method onListWatchesRequestReceived.

@Subscribe
public void onListWatchesRequestReceived(ListWatchesManagementRequest request) {
    List<Watch> watchList = new ArrayList<Watch>();
    for (File watchFolder : watchOperations.keySet()) {
        boolean syncRunning = watchOperations.get(watchFolder).isSyncRunning();
        SyncStatus syncStatus = (syncRunning) ? SyncStatus.SYNCING : SyncStatus.IN_SYNC;
        watchList.add(new Watch(watchFolder, syncStatus));
    }
    eventBus.post(new ListWatchesManagementResponse(request.getId(), watchList));
}
Also used : ArrayList(java.util.ArrayList) SyncStatus(org.syncany.operations.daemon.Watch.SyncStatus) File(java.io.File) ListWatchesManagementResponse(org.syncany.operations.daemon.messages.ListWatchesManagementResponse) Subscribe(com.google.common.eventbus.Subscribe)

Example 2 with SyncStatus

use of org.syncany.operations.daemon.Watch.SyncStatus in project syncany by syncany.

the class WatchTest method testGetStatus.

@Test
public void testGetStatus() {
    SyncStatus res = watch.getStatus();
    assertNotNull(res);
    assertEquals(status, res);
}
Also used : SyncStatus(org.syncany.operations.daemon.Watch.SyncStatus) Test(org.junit.Test)

Example 3 with SyncStatus

use of org.syncany.operations.daemon.Watch.SyncStatus in project syncany by syncany.

the class WatchTest method testGetStatus.

@Test
public void testGetStatus() {
    SyncStatus res = watch.getStatus();
    assertNotNull(res);
    assertEquals(status, res);
}
Also used : SyncStatus(org.syncany.operations.daemon.Watch.SyncStatus) Test(org.junit.Test)

Aggregations

SyncStatus (org.syncany.operations.daemon.Watch.SyncStatus)3 Test (org.junit.Test)2 Subscribe (com.google.common.eventbus.Subscribe)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 ListWatchesManagementResponse (org.syncany.operations.daemon.messages.ListWatchesManagementResponse)1