SmsRecordsDataService

public interface SmsRecordsDataService extends MotechDataService<SmsRecord>

Used to query and save audit records in the database. This is a service interface for which MDS will generate the implementation at runtime.

Fields

MOTECH_ID

String MOTECH_ID

PROVIDER_ID

String PROVIDER_ID

Methods

countFindByCriteria

long countFindByCriteria(String config, Set<SmsDirection> directions, String phoneNumber, String messageContent, Range<DateTime> timestamp, Set<String> deliveryStatuses, String providerStatus, String motechId, String providerId, String errorMessage)

Retrieves the total count of SMS messages matching the given criteria. All string fields in this lookup are matched using the matches() operator, meaning they will be matched using the same rules that String.matches(String) uses.

Parameters:
  • config – the name of the configuration associated with the SMS message
  • directions – the set of directions (inbound, outbound)
  • phoneNumber – the number of the phone the message was received from or delivered to
  • messageContent – the contents of the SMS message
  • timestamp – the date-time range the timestamp of the SMS should fall into
  • deliveryStatuses – the set of delivery status for the messages
  • providerStatus
  • motechId – the id by which MOTECH identifies the message
  • providerId – the provider generated ID for the SMS
  • errorMessage – the error message for the SMS
Returns:

the matching records

findByCriteria

List<SmsRecord> findByCriteria(String config, Set<SmsDirection> directions, String phoneNumber, String messageContent, Range<DateTime> timestamp, Set<String> deliveryStatuses, String providerStatus, String motechId, String providerId, String errorMessage, QueryParams queryParams)

Retrieves all sms records matching the given criteria. All string fields in this lookup are matched using the matches() operator, meaning they will be matched using the same rules that String.matches(String) uses.

Parameters:
  • config – the name of the configuration associated with the SMS message
  • directions – the set of directions (inbound, outbound)
  • phoneNumber – the number of the phone the message was received from or delivered to
  • messageContent – the contents of the SMS message
  • timestamp – the date-time range the timestamp of the SMS should fall into
  • deliveryStatuses – the set of delivery status for the messages
  • providerStatus
  • motechId – the id by which MOTECH identifies the message
  • providerId – the provider generated ID for the SMS
  • errorMessage – the error message for the SMS
  • queryParams – the query params controlling the ordering and size of the lookup
Returns:

the matching records

findByMotechId

List<SmsRecord> findByMotechId(String motechId)

Retrieves records by the MOTECH ID.

Parameters:
  • motechId – the MOTECH ID
Returns:

the list of matching records

findByProviderAndMotechId

List<SmsRecord> findByProviderAndMotechId(String providerId, String motechId)

Retrieves records by both provider and MOTECH IDs.

Parameters:
  • providerId – the provider ID
  • motechId – the MOTECH ID
Returns:

the list of matching records

findByProviderId

List<SmsRecord> findByProviderId(String providerId)

Retrieves records by the provider ID.

Parameters:
  • providerId – the provider ID
Returns:

the list of matching records