Implementation Guide for Oracle Self-Service E-Billing > Using and Customizing Email Notifications >

Adding a Custom Message Provider


Use the following procedure to add a custom message provider.

To add a custom message provider

  1. Create a new message type and accompanying class to override the com.edocs.common.api.notification.AbstractMessage class.
  2. Initialize the new class with all the information necessary to send a message of that type using the custom messaging provider.

    It is not necessary to include static information that does not vary by individual message. For example, an email address is necessary if you are using an SMTP provider and the address changes for every message. However, the SMTP hostname does not change with every message.

    If an existing implementation has all the necessary information, then you can use that implementation without modification, except that you must provide a unique message by calling the setMessageType method on the object after object creation. The class com.edocs.common.notification.extensions.InternalMessage provides a reference implementation.

  3. Create a new transport class with the logic for sending messages using the new message provider, overriding the com.edocs.common.notification.extensionsapi.AbstractTransporter class.

    This transport class contains the methods for sending the message. All of the information necessary for this class is available from the IMessage object.

  4. Add a JavaBean definition to the notification.cfg.xma.xml file. Give the file a name that ends with Bean, such as CustomTransportBean.

    This name (without the Bean part) is used inside the NotificationService class to return the correct messenger, for example: IMessenger messenger = MessengerFactory.getMessenger(CustomTransport).

    The notification.cfg.xma.xml file is located in the following directory:

    • UNIX. EDX_HOME/xma/config/com/edocs/common/notification\
    • Windows. EDX_HOME\xma\config\com\edocs\common\notification\
  5. In the JavaBean definition, add all the properties required by the transporter to use the messaging provider, such as the SMTP name. Do not include items like the email address, which the message object provides.

    The class com.edocs.common.notification.extensions.TrueTransporter and the JavaBean definition for TrueTransporterBean in the notification.cfg.xma.xml file provide a reference implementation.

  6. Create a new NotificationService class that determines when to use the transport class, which you wrote in Step 3, which overrides the com.edocs.common.api.notification.INotificationService class.

    INotificationService has two methods for sending instant messages and batch messages. These methods decide which transport to use based on the IMessage object being passed in. You must supply the logic to call the MessengerFactory with the transport in Step 3 as the transport type, for the types of Messages you want that transport to send.

  7. After you create the NotificationService class, add or modify the JavaBean called NotificationService to the notification.cfg.xma.xml file. NotificationServiceFactory looks up the JavaBean called NotificationService from the XML file.

    The class com.edocs.common.notification.core.NotificationService and the JavaBean definition for NotificationService in the notification.cfg.xma.xml file provide a reference implementation.

Implementation Guide for Oracle Self-Service E-Billing Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Legal Notices.