Search in sources :

Example 11 with RemoteNodeStatuses

use of org.jumpmind.symmetric.model.RemoteNodeStatuses in project symmetric-ds by JumpMind.

the class AbstractTest method pullFiles.

protected boolean pullFiles(String name) {
    int tries = 0;
    boolean pulled = false;
    boolean lastPull = false;
    boolean errorOccurred = false;
    while (!errorOccurred && (lastPull || (!pulled && tries < 10))) {
        RemoteNodeStatuses statuses = getWebServer(name).getEngine().getFileSyncService().pullFilesFromNodes(true);
        try {
            statuses.waitForComplete(60000);
        } catch (InterruptedException ex) {
            log.warn(ex.getMessage());
        }
        lastPull = statuses.wasDataProcessed();
        errorOccurred = statuses.errorOccurred();
        pulled |= lastPull;
        AppUtils.sleep(100);
        tries++;
    }
    return pulled;
}
Also used : RemoteNodeStatuses(org.jumpmind.symmetric.model.RemoteNodeStatuses) InterruptedException(org.jumpmind.exception.InterruptedException)

Example 12 with RemoteNodeStatuses

use of org.jumpmind.symmetric.model.RemoteNodeStatuses in project symmetric-ds by JumpMind.

the class AbstractTest method pushFiles.

protected boolean pushFiles(String name) {
    int tries = 0;
    boolean pulled = false;
    while (!pulled && tries < 10) {
        RemoteNodeStatuses statuses = getWebServer(name).getEngine().getFileSyncService().pushFilesToNodes(true);
        try {
            statuses.waitForComplete(60000);
        } catch (InterruptedException ex) {
            log.warn(ex.getMessage());
        }
        pulled = statuses.wasDataProcessed();
        AppUtils.sleep(100);
        tries++;
    }
    return pulled;
}
Also used : RemoteNodeStatuses(org.jumpmind.symmetric.model.RemoteNodeStatuses) InterruptedException(org.jumpmind.exception.InterruptedException)

Aggregations

RemoteNodeStatuses (org.jumpmind.symmetric.model.RemoteNodeStatuses)12 Node (org.jumpmind.symmetric.model.Node)6 InterruptedException (org.jumpmind.exception.InterruptedException)5 NodeCommunication (org.jumpmind.symmetric.model.NodeCommunication)5 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ChannelMap (org.jumpmind.symmetric.model.ChannelMap)1 NodeSecurity (org.jumpmind.symmetric.model.NodeSecurity)1 INodeCommunicationService (org.jumpmind.symmetric.service.INodeCommunicationService)1