Interface MessagingProvider


  • public interface MessagingProvider
    Interface to support customized sending providers and logics for email or sms.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean send​(java.lang.String loginUser, java.lang.String contextId, java.lang.String fromAddress, java.util.Map<java.lang.String,​java.lang.String> recipients, java.util.Map<java.lang.String,​java.lang.String> configMap, java.util.Map<java.lang.String,​java.lang.Object> contextMap, java.lang.String deliveryType)
      Method to perform message sending action.
    • Method Detail

      • send

        boolean send​(java.lang.String loginUser,
                     java.lang.String contextId,
                     java.lang.String fromAddress,
                     java.util.Map<java.lang.String,​java.lang.String> recipients,
                     java.util.Map<java.lang.String,​java.lang.String> configMap,
                     java.util.Map<java.lang.String,​java.lang.Object> contextMap,
                     java.lang.String deliveryType)
              throws java.lang.Exception
        Method to perform message sending action. This interfae is used ONLY for customizing sending of Email and SMS.
        Method implementer is responsible for formatting and sending message. In some cases this code should should also check the status of send, before returning status.
        Properties of the corresponding enum (Email or SMS) are made available to implementers using the configMap parameter. Implementers should configure required parameters as properties of that enum, and have the properties for enum correspondingly updated.
        Please refer to ConfigMap parameter below.
        Note: This API contains Maps as input parameters to send function. The input map itself will not be null. However it can be empty, or can have values that are null.
        Parameters:
        loginUser - Loginid of the user for whom the challenge is initiated.
        contextId - ContextId associated with this challenge.
        fromAddress - This is the address, which should appear in the "from" field of the message that is sent. For example "OAA"
        recipients - A map of recipients email addresses or a map of recipients phone numbers.
        Both keys and values are in String format.
        If multiple values exist for the same key, values would be comma separated.

        Keys in the map for Email factor:
        recipient: recipient email address.
        ccRecipient: recipient email address where a CC of the email is sent.
        bccRecipient: recipient email address where a BCC of the email is sent.

        Keys in the map for SMS factor:
        recipient: recipient phone numbers.

        configMap - A map that contains config values for the challenge factor enum. Both keys and values are in String format.
        Name/Values specified below will be populated in the map.b
        Custom Impmenenters can add additional properties of the corresponding enum (email/sms), to the senderSpecificProperties of that enum.
        Those properties will be made available in this map at runtime to this implementation.

        The default keys in the map:
        otpexpirytimeMs: the expiry time for email or sms, in milliseconds.
        msgSubject: message subject. For example: One Time Pin: OAA.
        msgType: type of message. For example: text/plain; charset=UTF-8.
        msgPinTemplate: text template for pin of the message. For example: Please use following one time pin to login to protected resource:
        msgTimeTemplate: text template for populating time of the message. For example: Time of Access:
        msgIPTemplate: text template for ip of the message. For example: IP Address:
        msgResourceURLTemplate: text template for redirect url of the message. For example: Resource URL Access:
        fromName: default name of fromAddress. For example: oaa@oracle.com.
        appName: default name of the map. For example: OAA.

        contextMap - A map that contains contexts values that for this user challenge.
        Key is in String format, value is in Object format.

        Following keys (and values) will be present in the map:
        pin: generated pin of the challenge. Value is represented as a String object.
        time: time associated with the challenge. The format is UTC time converted to String. Value is represented as a Date object.
        ip: ip address of the access request.Value is represented as a InetAddress object.
        resourceURL: URL accessed / requested by the user/application. Value is represented as a URL object.

        deliveryType - A String that indicates that the message to be sent is email or sms.
        Returns:
        Boolean indicates if message is sent successfully.
        Throws:
        java.lang.Exception - When sender encounters unforeseen error.