use of org.opendatakit.briefcase.model.TransferFailedEvent in project briefcase by opendatakit.
the class TransferFromServer method pull.
public static void pull(ServerConnectionInfo transferSettings, FormStatus... forms) {
List<FormStatus> formList = Arrays.asList(forms);
TransferFromServer action = new TransferFromServer(transferSettings, new TerminationFuture(), formList);
try {
boolean allSuccessful = action.doAction();
if (allSuccessful)
EventBus.publish(new TransferSucceededEvent(false, formList, transferSettings));
if (!allSuccessful)
throw new PullFromServerException(formList);
} catch (Exception e) {
EventBus.publish(new TransferFailedEvent(false, formList));
throw new PullFromServerException(formList);
}
}
use of org.opendatakit.briefcase.model.TransferFailedEvent in project briefcase by opendatakit.
the class TransferToServer method push.
public static void push(ServerConnectionInfo transferSettings, FormStatus... forms) {
List<FormStatus> formList = Arrays.asList(forms);
TransferToServer action = new TransferToServer(transferSettings, new TerminationFuture(), formList);
try {
boolean allSuccessful = action.doAction();
if (allSuccessful)
EventBus.publish(new TransferSucceededEvent(false, formList, transferSettings));
if (!allSuccessful)
throw new PushFromServerException(formList);
} catch (Exception e) {
EventBus.publish(new TransferFailedEvent(false, formList));
throw new PushFromServerException(formList);
}
}
Aggregations