if (alertListState == null) {
LOGGER.warning("Unable to get the alerts. alertListState is null.");
return lstAllAlerts;
}
final AlertInfo alertsInfo = Util.makeWSRequest(sharepointClientContext,
alertsWS, new Util.RequestExecutor<AlertInfo>() {
public AlertInfo onRequest(final BaseWS ws) throws Throwable {
return ((AlertsWS) ws).getAlerts();
}
public void onError(final Throwable e) {
LOGGER.log(Level.WARNING, "Unable to get alerts.", e);
}
});
if (alertsInfo != null) {
try {
// To keep track of those IDs which are deleted
final StringBuffer knownAlerts = alertListState.getIDs();
final StringBuffer currentAlerts = new StringBuffer();
final Alert[] alerts = alertsInfo.getAlerts();
if ((alerts == null) || (alerts.length == 0)) {
alertListState.setExisting(false);
return lstAllAlerts;
}