*/
public class GetAllUsers {
public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
// Get the UserService.
UserServiceInterface userService = dfpServices.get(session, UserServiceInterface.class);
// Create a statement to get all users.
StatementBuilder statementBuilder = new StatementBuilder()
.orderBy("id ASC")
.limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);
// Default for total result set size.
int totalResultSetSize = 0;
do {
// Get users by statement.
UserPage page = userService.getUsersByStatement(statementBuilder.toStatement());
if (page.getResults() != null) {
totalResultSetSize = page.getTotalResultSetSize();
int i = page.getStartIndex();
for (User user : page.getResults()) {