LOGGER.log(Level.INFO,
"Retrieving all email lists.");
URL retrieveUrl = new URL(domainUrlBase + "emailList/"
+ SERVICE_VERSION + "/");
EmailListFeed allEmailLists = new EmailListFeed();
EmailListFeed currentPage;
Link nextLink;
do {
currentPage = emailListService.getFeed(retrieveUrl, EmailListFeed.class);
allEmailLists.getEntries().addAll(currentPage.getEntries());
nextLink = currentPage.getLink(Link.Rel.NEXT, Link.Type.ATOM);
if (nextLink != null) {
retrieveUrl = new URL(nextLink.getHref());
}
} while (nextLink != null);