SmsRecordSearchCriteria

public class SmsRecordSearchCriteria

Helper used to generate a database lookup from log filter UI

Methods

getConfig

public String getConfig()
Returns:the configuration name which with the SMS should be associated with

getDeliveryStatuses

public Set<String> getDeliveryStatuses()
Returns:the set of expected delivery statuses for SMS messages

getErrorMessage

public String getErrorMessage()
Returns:the error message for the SMS

getMessageContent

public String getMessageContent()
Returns:the content of the sms message

getMotechId

public String getMotechId()
Returns:the ID by which MOTECH identifies the SMS

getPhoneNumber

public String getPhoneNumber()
Returns:the phone number which received or sent the sms

getProviderId

public String getProviderId()
Returns:the ID by which the provider identifies the SMS

getProviderStatus

public String getProviderStatus()

getQueryParams

public QueryParams getQueryParams()
Returns:the query params that will control the result set for the lookup

getSmsDirections

public Set<String> getSmsDirections()
Returns:the set of expected SMS directions (inbound, outbound)

getTimestampRange

public Range<DateTime> getTimestampRange()
Returns:the timestamp range into which SNS messages should fall

toString

public String toString()

withConfig

public SmsRecordSearchCriteria withConfig(String config)

Sets the configuration name part of the search.

Parameters:
  • config – the config name associated with the SMS
Returns:

this instance of the search criteria

withDeliverystatuses

public SmsRecordSearchCriteria withDeliverystatuses(Set<String> deliveryStatuses)

Sets the delivery statuses the SMS messages retrieved by this search must match.

Parameters:
  • deliveryStatuses – the set of delivery status that will be taken into consideration when executing the query
Returns:

this instance of the search criteria

withErrorMessage

public SmsRecordSearchCriteria withErrorMessage(String errorMessage)

Sets the error message part of this search query.

Parameters:
  • errorMessage – the error message for the SMS
Returns:

this instance of the search criteria

withMessageContent

public SmsRecordSearchCriteria withMessageContent(String messageContent)

Sets the message content part of this search query.

Parameters:
  • messageContent – the content of the SMS
Returns:

this instance of the search criteria

withMotechId

public SmsRecordSearchCriteria withMotechId(String motechId)

Sets the MOTECH ID part of the search query.

Parameters:
  • motechId – the ID used by MOTECH to identify this SMS message
Returns:

this instance of the search criteria

withPhoneNumber

public SmsRecordSearchCriteria withPhoneNumber(String phoneNumber)

Sets the phone number part of the search.

Parameters:
  • phoneNumber – the phone number which received or sent the SMS
Returns:

this instance of the search criteria

withProviderId

public SmsRecordSearchCriteria withProviderId(String providerId)

Sets the provider ID part of the search query.

Parameters:
  • providerId – the ID used by the provider to identify this SMS message
Returns:

this instance of the search criteria

withProviderStatus

public SmsRecordSearchCriteria withProviderStatus(String providerStatus)

withQueryParams

public SmsRecordSearchCriteria withQueryParams(QueryParams queryParam)

Sets the query params that will be used when performing the lookup. This params will control the ordering and size of the result set.

Parameters:
  • queryParam – the params that will be passed to the lookup
Returns:

this instance of the search criteria

withSmsDirections

public SmsRecordSearchCriteria withSmsDirections(Set<SmsDirection> smsDirections)

Sets the sms directions which should be included in the query.

Parameters:
  • smsDirections – the set of directions (inbound, outbound)
Returns:

this instance of the search criteria

withTimestamp

public SmsRecordSearchCriteria withTimestamp(DateTime timestamp)

Sets the expected timestamp for the messages retrieved by this query.

Parameters:
  • timestamp – the timestamp of the messages
Returns:

this instance of the search criteria

withTimestampRange

public SmsRecordSearchCriteria withTimestampRange(Range<DateTime> timestampRange)

Sets the expected timestamp range into which the messages retrieved by this query must fall into.

Parameters:
  • timestampRange – the timestamp range into which the messages must fall into
Returns:

this instance of the search criteria