String logfile = initializeLog();
this.log.info("Starting harvesting of " + this.getParams().name);
error = null;
errors.clear();
final Logger logger = this.log;
final String nodeName = getParams().name + " (" + getClass().getSimpleName() + ")";
final String lastRun = new DateTime().withZone(DateTimeZone.forID("UTC")).toString();
try {
login();
//--- update lastRun
settingMan.setValue("harvesting/id:" + id + "/info/lastRun", lastRun);
//--- proper harvesting
logger.info("Started harvesting from node : " + nodeName);
HarvestWithIndexProcessor h = new HarvestWithIndexProcessor(dataMan, logger);
// todo check (was: processwithfastindexing)
h.process();
logger.info("Ended harvesting from node : " + nodeName);
if (getParams().oneRunOnly) {
stop();
}
} catch (InvalidParameterValueEx e) {
logger.error("The harvester " + this.getParams().name + "["
+ this.getType()
+ "] didn't accept some of the parameters sent.");
errors.add(new HarvestError(e, logger));
error = e;
operResult = OperResult.ERROR;
} catch (Throwable t) {
operResult = OperResult.ERROR;
logger.warning("Raised exception while harvesting from : " + nodeName);
logger.warning(" (C) Class : " + t.getClass().getSimpleName());
logger.warning(" (C) Message : " + t.getMessage());
error = t;
t.printStackTrace();
errors.add(new HarvestError(t, logger));
} finally {
List<HarvestError> harvesterErrors = getErrors();