// Create selector.
AlertSelector selector = new AlertSelector();
selector.setQuery(alertQuery);
selector.setPaging(new Paging(offset, PAGE_SIZE));
AlertPage page = null;
do {
// Get all alerts.
page = alertService.get(selector);
// Display alerts.
if (page.getEntries() != null && page.getEntries().length > 0) {
for (Alert alert : page.getEntries()) {
System.out.printf(
"Alert of type '%s' and severity '%s' for account '%d' was found.\n",
alert.getAlertType(), alert.getAlertSeverity(),
alert.getClientCustomerId());
}
} else {
System.out.println("No alerts were found.\n");
}
offset += PAGE_SIZE;
selector.getPaging().setStartIndex(offset);
} while (offset < page.getTotalNumEntries());
}