int entriesPerPage = 15;
if (requestedPage != null && requestedPage.length() > 0) {
pageNumber = new Integer(requestedPage);
}
try {
UsageServiceClient serviceClient = new UsageServiceClient(config, session);
String yearMonth = request.getParameter("year-month");
if (yearMonth == null) {
// get the current year month
yearMonth = getCurrentYearMonth();
}
return serviceClient.retrievePaginatedInstanceUsage(yearMonth, pageNumber, entriesPerPage);
} catch (Exception e) {
String msg = "Failed to get paginated instance usages.";
log.error(msg, e);
throw new UIException(msg, e);
}