try {
ConfigType alertSourceConfig = alertsSources.getAlertSources(id);
for (Object source : alertSourceConfig.getSource()){
SourceType sourceType = (SourceType)source;
AlertsType alerts = null;
if ( sourceType.getFeedType().equals("rss")){
alerts = rssChecker.getNewAlerts(sourceType.getFeedAddress(),
sourceType.getLastChecked());
} else {
}
// extend return list with any alerts we found
for( Object alert : alerts.getAlert() ){
// set the id on the alert so we know which source it
// came from
((AlertType)alert).setSourceId(sourceType.getId());
// convert from SDO to POJO so that the
// JSONRPC binding will work. It can't currently
// handle SDOs
AlertType newAlert = new AlertTypeNonSDOImpl();
newAlert.setSourceId(((AlertType)alert).getSourceId());
newAlert.setTitle(((AlertType)alert).getTitle());
newAlert.setSummary(((AlertType)alert).getSummary());
newAlert.setAddress(((AlertType)alert).getAddress());
newAlert.setDate(((AlertType)alert).getDate());
newAlert.setId(((AlertType)alert).getId());
newAlert.setUnread(((AlertType)alert).isUnread());
returnAlertList.add(newAlert);
}
// update the time last checked for this source
sourceType.setLastChecked(nowString);
//alertsSources.updateAlertSource(sourceType);
}
} catch(Exception ex) {
System.err.println("Exception " + ex.toString());
}