Interface MessageDetailService

All Superinterfaces:
Service

public interface MessageDetailService
extends Service
Each Message can contain potentially contain thousands or even millions of records. To store all such records could overwhelm the MESSAGE_DETAIL table. To remedy this, MessageDetail can be set at a specific level for a queue+interface combination to capture nothing, errors only or all records.

It is required to use external reference type: PLT.MessageDetail:Enable If Message Detail is enabled for "AllRecords" via ExternalReference for a queue+interface or queue, then it will captures all records that came on input. If Message Detail is enabled for "ErrorRecordsOnly" via ExternalReference for that queue+interface or queue, then it will captures only those records which failed to process successfully. If the external reference entry is not present or the local_value is set to "None" then the MessageDetail entries will not be populated by default.

  • Method Summary

    Modifier and Type Method Description
    MessageDetail createMessageDetail​(java.lang.String strRecordIdentifier, java.lang.String strErrorMessage, java.lang.String strPrimaryRefTransNumber, java.lang.String strModelType, java.lang.String strRawData, Message msg, java.util.List<MessageDetail> messageDetails, PlatformUserContext pltUsrContext)
    Checks the external reference configuration to see if MessageDetail is enabled for the given message.
    MessageDetailLevel getMessageDetailLevel​(Message message, PlatformUserContext pltUsrContext)
    This method is used for identifying whether message detail should capture "AllRecords", "ErrorRecordsOnly" or "None" for a queue+interface combination using ExternalReference where ref type is PLT.MessageDetail:Enable.
    void saveMessageDetails​(java.util.List<MessageDetail> messageDetails, PlatformUserContext pltUsrContext)
    Saves the given MessageDetail objects in a new transaction.
  • Method Details

    • getMessageDetailLevel

      MessageDetailLevel getMessageDetailLevel​(Message message, PlatformUserContext pltUsrContext)
      This method is used for identifying whether message detail should capture "AllRecords", "ErrorRecordsOnly" or "None" for a queue+interface combination using ExternalReference where ref type is PLT.MessageDetail:Enable. By default it is disabled if no entry found in external reference and method will return None.
      Parameters:
      message - message for which MessageDetail might need to be captured Based on these values, this method is looking for external reference entry, Note: Consider enterprise name for Message Detail look up, only when it is not null. For external reference type: PLT.MessageDetail:Enable First it checks for external reference entry(~~~~): for "AllRecords" if exists, it returns MessageDetailLevel.ALL else for "ErrorRecordsOnly" if exists, it returns MessageDetailLevel.ERRORS_ONLY else it checks for external reference entry(~~): for "AllRecords" if exists, it returns MessageDetailLevel.ALL else for "ErrorRecordsOnly" if exists, it returns MessageDetailLevel.ERRORS_ONLY else it returns MessageDetailLevel.NONE
      pltUsrContext - PlatformUserContext
      Returns:
      MessageDetailLevel ALL: Message Detail is enabled for "AllRecords". ERRORS_ONLY: Message Detail is enabled for "ErrorRecordsOnly". NONE: Message Detail is disabled for that message.
    • createMessageDetail

      MessageDetail createMessageDetail​(java.lang.String strRecordIdentifier, java.lang.String strErrorMessage, java.lang.String strPrimaryRefTransNumber, java.lang.String strModelType, java.lang.String strRawData, Message msg, java.util.List<MessageDetail> messageDetails, PlatformUserContext pltUsrContext)
      Checks the external reference configuration to see if MessageDetail is enabled for the given message. If not enabled for the given message, or if set to error only and errorMsg is null, then this method does nothing (returns null). Else, creates a new MessageDetail in memory and adds it to the given collection.

      This method does not write anything to the DB. The client is expected to call saveMessageDetails after all relevant MessageDetail objects are created for the current message.

      Parameters:
      strRecordIdentifier - record identifier, for example row number
      strErrorMessage - error message when processing the row, or null or blank if no error encountered
      strPrimaryRefTransNumber - reference number for the business transaction this message detail affected
      strModelType - model type of the business transaction this message detail affected
      strRawData - raw data of the message detail (for example CSV row content)
      msg - message from which the message detail was pulled
      messageDetails - List of MessageDetails to which the new MessageDetail should be added if it was created
      pltUsrContext - caller's context
      Returns:
      the MessageDetail created, or null if no MessageDetail is needed
    • saveMessageDetails

      void saveMessageDetails​(java.util.List<MessageDetail> messageDetails, PlatformUserContext pltUsrContext)
      Saves the given MessageDetail objects in a new transaction. If collection is empty, this no operation is performed.
      Parameters:
      messageDetails -
      pltUsrContext -