CommcareUserService

public interface CommcareUserService

A service to perform queries against CommCareHQ’s user APIs. CommCareHQ exposes one user API, therefore getting a user by Id simply filters the list of all users returned by CommCareHQ.

Methods

getCommcareUserById

CommcareUser getCommcareUserById(String id, String configName)

Queries CommCareHQ for a list of all users on the configured domain and filters the list to return the user that matches the provided id.

Parameters:
  • id – the id of the user to retrieve.
  • configName – the name of the configuration used for connecting to CommcareHQ, null means default configuration
Returns:

the CommcareUser object representing the information about the user from CommCareHQ, or null if that user did not exist on that domain.

getCommcareUserById

CommcareUser getCommcareUserById(String id)

Same as getCommcareUserById but uses default Commcare configuration.

getCommcareUsers

List<CommcareUser> getCommcareUsers(Integer pageSize, Integer pageNumber, String configName)

Queries CommCareHQ for a list of users(located on the given page) on the configured domain.

Parameters:
  • pageSize – the size of the page
  • pageNumber – the number of the page
  • configName – the name of the configuration used for connecting to CommcareHQ, null means default configuration
Returns:

the list of CommcareUsers that represent the information about each user located on the given page from CommCareHQ

getCommcareUsers

List<CommcareUser> getCommcareUsers(Integer pageSize, Integer pageNumber)

Same as getCommcareUsers but uses default Commcare configuration.