java.lang.Object
com.irurueta.authserver.authorization.infrastructure.sms.LoggingSmsSender
All Implemented Interfaces:
SmsSender

public class LoggingSmsSender extends Object implements SmsSender
Default SmsSender: sends nothing, it records the message in the SmsOutbox and logs the masked recipient. The text (which carries a one-time code) is never logged at INFO.
  • Field Details

    • VISIBLE_DIGITS

      static final int VISIBLE_DIGITS
      Number of trailing digits of the recipient that are logged.
      See Also:
    • outbox

      private final SmsOutbox outbox
      Records the messages.
    • clock

      private final Clock clock
      Source of the recording instant.
  • Constructor Details

    • LoggingSmsSender

      public LoggingSmsSender()
  • Method Details

    • send

      public void send(PhoneNumber to, String text)
      Description copied from interface: SmsSender
      Sends a text message.
      Specified by:
      send in interface SmsSender
      Parameters:
      to - recipient.
      text - text of the message.