* @return the structure containing alerts
*/
public Feed getFeed() {
// Create a new Feed
SyndFeed feed = new SyndFeedImpl();
feed.setTitle("Apache Tuscant Feed Aggregator");
feed.setDescription("A sample showing an SCA application to aggregate various types of feeds");
feed.setAuthor("Apache Tuscany");
feed.setLink("http://incubator.apache.org/tuscany");
// Aggregate entries from feed1 and feed2
List<SyndEntry> entries = new ArrayList<SyndEntry>();
try {
AlertsType alerts = this.alerts.getAllNewAlerts("");
for( Object alertObject : alerts.getAlert() ){
AlertType alert = ((AlertType)alertObject);
SyndEntry entry = new SyndEntryImpl();
entry.setTitle(alert.getTitle());
//entry.(alert.getSummary());
entry.setLink(alert.getAddress());
entry.setPublishedDate(dateFormatter.parse(alert.getDate()));
entries.add(entry);
}
} catch(Exception ex) {
System.err.println("Exception " + ex.toString());
}
feed.setEntries(entries);
return (Feed)feed.createWireFeed("atom_1.0");
}