throw new IllegalStateException("Cancelling of job took " + (now - cancelTime)
+ " milliseconds, only " + maxTimeTillCanceled + " milliseconds are allowed");
}
}
final JobProgressResult jobProgressResult = client.getJobProgress();
if (jobProgressResult == null) {
throw new IllegalStateException("Returned job progress is unexpectedly null!");
}
if (jobProgressResult.getReturnCode() == AbstractJobResult.ReturnCode.ERROR) {
throw new IllegalStateException("Could not retrieve job progress: "
+ jobProgressResult.getDescription());
}
boolean exitLoop = false;
final Iterator<AbstractEvent> it = jobProgressResult.getEvents();
while (it.hasNext()) {
final AbstractEvent event = it.next();
// Did we already process that event?