CommcareDataForwardingEndpointService

public interface CommcareDataForwardingEndpointService

A service to perform queries and updates against CommCareHQ’s data forwarding endpoints.

Methods

createNewDataForwardingRule

boolean createNewDataForwardingRule(CommcareDataForwardingEndpoint newForwardingRule, Config config)

Creates a new data forwarding rule for the CommCareHQ.

Returns:true - if data was successfully sent; otherwise - false

getAllDataForwardingEndpoints

List<CommcareDataForwardingEndpoint> getAllDataForwardingEndpoints(Config config)

Queries CommCareHQ for a list of all data forwarding rules on the configured domain.

Parameters:
  • config – the configuration to be used when connecting to the CommcareHQ server
Returns:

the list of CommcareDataForwardingEndpoints that represent the information about each data forwarding rule from CommCareHQ

getDataForwardingEndpoints

List<CommcareDataForwardingEndpoint> getDataForwardingEndpoints(Integer pageSize, Integer pageNumber, Config config)

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

Parameters:
  • pageSize – the size of the page
  • pageNumber – the number of the page
  • config – the configuration to be used when connecting to the CommcareHQ server
Returns:

the list of CommcareDataForwardingEndpoints that represent the information about each data forwarding rule located on the given page from CommCareHQ

updateDataForwardingRule

boolean updateDataForwardingRule(CommcareDataForwardingEndpoint updatedForwardingRule, Config config)

Updates specified CommCareHQ data forwarding rule.

Parameters:
  • updatedForwardingRule – the rule to be updated
  • config – the configuration to be used when connecting to the CommcareHQ server
Returns:

true - if the data has been updated, false otherwise