// Get the UserTeamAssociationService.
UserTeamAssociationServiceInterface userTeamAssociationService =
user.getService(DfpService.V201306.USER_TEAM_ASSOCIATION_SERVICE);
// Set defaults for page and filterStatement.
UserTeamAssociationPage page = new UserTeamAssociationPage();
Statement filterStatement = new Statement();
int offset = 0;
do {
// Create a statement to get all user team associations.
filterStatement.setQuery("LIMIT 500 OFFSET " + offset);
// Get user team associations by statement.
page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement);
if (page.getResults() != null) {
int i = page.getStartIndex();
for (UserTeamAssociation userTeamAssociation : page.getResults()) {
System.out.println(i + ") User team association between user with ID \""
+ userTeamAssociation.getUserId() + "\" and team with ID \""
+ userTeamAssociation.getTeamId() + "\" was found.");
i++;
}
}
offset += 500;
} while (offset < page.getTotalResultSetSize());
System.out.println("Number of results found: " + page.getTotalResultSetSize());
} catch (Exception e) {
e.printStackTrace();
}
}