SmsRecord

public class SmsRecord

SMS audit record for the database.

Constructors

SmsRecord

public SmsRecord()

Constructs a new instance of a record without filling out any fields.

SmsRecord

public SmsRecord(String config, SmsDirection smsDirection, String number, String message, DateTime timestamp, String deliveryStatus, String providerStatus, String motechId, String providerId, String errorMessage)

Constructs a new instance using the provided data.

Parameters:
  • config – the name of the configuration to which this SMS should be associated with
  • smsDirection – the direction of the SMS - either inbound or outbound
  • number – the phone number to which this SMS was sent, or which it was received
  • message – the content of the SMS message
  • timestamp – the timestamp for this SMS
  • deliveryStatus – the delivery status for this SMS
  • providerStatus
  • motechId – the ID by which MOTECH identifies this SMS.
  • providerId – the ID generated by the provider for this SMS
  • errorMessage – the error message for this SMS, if applicable

Methods

equals

public boolean equals(Object obj)

getConfig

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

getDeliveryStatus

public String getDeliveryStatus()
Returns:the delivery status for this SMS

getErrorMessage

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

getMessageContent

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

getMotechId

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

getPhoneNumber

public String getPhoneNumber()
Returns:the phone number to which this SMS was sent, or which it was received

getProviderId

public String getProviderId()
Returns:the ID generated by the provider for this SMS

getProviderStatus

public String getProviderStatus()

getSmsDirection

public SmsDirection getSmsDirection()
Returns:the direction of the SMS - either inbound or outbound

getTimestamp

public DateTime getTimestamp()
Returns:the timestamp for this SMS

hashCode

public int hashCode()

setConfig

public void setConfig(String config)
Parameters:
  • config – the name of the configuration to which this SMS should be associated with

setDeliveryStatus

public void setDeliveryStatus(String deliveryStatus)
Parameters:
  • deliveryStatus – the delivery status for this SMS

setErrorMessage

public void setErrorMessage(String errorMessage)
Parameters:
  • errorMessage – the error message for this SMS

setMessageContent

public void setMessageContent(String messageContent)
Parameters:
  • messageContent – he tcontent of the SMS message

setMotechId

public void setMotechId(String motechId)
Parameters:
  • motechId – the ID by which MOTECH identifies this SMS.

setPhoneNumber

public void setPhoneNumber(String phoneNumber)
Parameters:
  • phoneNumber – the phone number to which this SMS was sent, or which it was received

setProviderId

public void setProviderId(String providerId)
Parameters:
  • providerId – the ID generated by the provider for this SMS

setProviderStatus

public void setProviderStatus(String providerStatus)

setSmsDirection

public void setSmsDirection(SmsDirection smsDirection)
Parameters:
  • smsDirection – the direction of the SMS - either inbound or outbound

setTimestamp

public void setTimestamp(DateTime timestamp)
Parameters:
  • timestamp – the timestamp for this SMS

toString

public String toString()