throw new IllegalArgumentException("No resource to harvest provided.");
// create instance of the task
// add only if no similar task currently executing
boolean submitted = false;
if (ApprovalStatus.isPubliclyVisible(resource.getApprovalStatus().name()) && resource.getSynchronizable()) {
CommonCriteria criteria = new CommonCriteria();
criteria.setMaxRecords(maxRecs);
if (fromDate != null) {
Calendar cal = Calendar.getInstance();
cal.setTime(fromDate);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
fromDate = cal.getTime();
}
criteria.setFromDate(fromDate);
submitted = !isExecutingLocally(resource.getUuid()) && (taskQueue != null ? taskQueue.add(context, resource, criteria) : false);
LOGGER.log(Level.FINER, "[SYNCHRONIZER] Submitted resource: {0} ({1})", new Object[]{resource.getUuid(), resource.getName()});
}
return submitted;
}