Config

public class Config

A connection to a particular SMS provider, there may be more than one config for a given provider and/or multiple connections to multiple providers. But realistically, most implementations will have one config.

Methods

getExcludeLastFooter

public Boolean getExcludeLastFooter()
Returns:true to exclude the split footer in the last part of a split SMS message, false otherwise

getMaxRetries

public Integer getMaxRetries()

Gets the maximum number of retries that will be performed when sending an SMS. If there was an error when sending the SMS, we will initiate a retry.

Returns:the maximum number of retries

getName

public String getName()
Returns:the unique name identifying the configuration

getProps

public List<ConfigProp> getProps()
Returns:additional configuration properties that will be always passed to the template

getSplitFooter

public String getSplitFooter()
Returns:the footer that will be included in split SMS messages

getSplitHeader

public String getSplitHeader()
Returns:the header that will be included in split SMS messages

getTemplateName

public String getTemplateName()
Returns:the name of the configuration template for this config

retryOrAbortStatus

public String retryOrAbortStatus(Integer failureCount)

Returns an appropriate Delivery Status for the given failure count. If the failure count is higher than the maximum number of retries for this configuration, then ABORTED Status is returned. Otherwise RETRYING Status is returned, indicating the retries are ongoing.

Parameters:
  • failureCount – the failure count to check
Returns:

the delivery status matching the failure count

retryOrAbortSubject

public String retryOrAbortSubject(Integer failureCount)

Returns an appropriate subject for an event indicating an SMS send failure. If the failure count is higher than the maximum number of retries for this configuration, then a subject indicating that to abort the SMS will be sent.

Parameters:
  • failureCount – the failure count to check
Returns:

the subject for the event

setExcludeLastFooter

public void setExcludeLastFooter(Boolean excludeLastFooter)
Parameters:
  • excludeLastFooter – true to exclude the split footer in the last part of a split SMS message, false otherwise

setMaxRetries

public void setMaxRetries(Integer maxRetries)

Sets the maximum number of retries that will be performed when sending an SMS. If there was an error when sending the SMS, we will initiate a retry.

Parameters:
  • maxRetries – the maximum number of retries

setName

public void setName(String name)
Parameters:
  • name – the unique name identifying the configuration

setProps

public void setProps(List<ConfigProp> props)
Parameters:
  • props – additional configuration properties that will be always passed to the template

setSplitFooter

public void setSplitFooter(String splitFooter)
Parameters:
  • splitFooter – the footer that will be included in split SMS messages

setSplitHeader

public void setSplitHeader(String splitHeader)
Parameters:
  • splitHeader – the header that will be included in split SMS messages

setTemplateName

public void setTemplateName(String templateName)
Parameters:
  • templateName – the name of the configuration template for this config