Search in sources :

Example 1 with InterruptedException

use of org.jumpmind.exception.InterruptedException in project symmetric-ds by JumpMind.

the class AbstractIntegrationTest method clientPull.

protected boolean clientPull() {
    int tries = 0;
    boolean pulled = false;
    while (!pulled && tries < 10) {
        RemoteNodeStatuses statuses = getClient().pull();
        try {
            statuses.waitForComplete(20000);
        } catch (InterruptedException ex) {
        }
        pulled = statuses.wasDataProcessed();
        AppUtils.sleep(100);
        tries++;
    }
    return pulled;
}
Also used : RemoteNodeStatuses(org.jumpmind.symmetric.model.RemoteNodeStatuses) InterruptedException(org.jumpmind.exception.InterruptedException)

Example 2 with InterruptedException

use of org.jumpmind.exception.InterruptedException in project symmetric-ds by JumpMind.

the class AbstractTest method push.

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

Example 3 with InterruptedException

use of org.jumpmind.exception.InterruptedException in project symmetric-ds by JumpMind.

the class AbstractTest method pull.

protected boolean pull(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().pull();
        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 4 with InterruptedException

use of org.jumpmind.exception.InterruptedException 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 5 with InterruptedException

use of org.jumpmind.exception.InterruptedException 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

InterruptedException (org.jumpmind.exception.InterruptedException)5 RemoteNodeStatuses (org.jumpmind.symmetric.model.RemoteNodeStatuses)5