Interface ReceiptParser


  • public interface ReceiptParser
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      byte[] genReceiptMessage​(java.lang.String destinationNode, java.lang.String messageId, ReceiptStatus status, java.lang.String errorDescription)
      Alternative method to generate a receipt message from the supplied data but with a specified destination in header data.
      byte[] genReceiptMessage​(java.lang.String messageId, ReceiptStatus status, java.lang.String errorDescription)
      Method to generate a receipt message from the supplied data.
      void init​(MessageSecurityProvider securityProvider, java.util.Properties config)
      Method that initializes the receipt parser with property set.
      java.util.List<ReceiptMessage> parseMessage​(byte[] messageData)
      Method to parse the messageData into a ReceiptMessage with validation according to the specification.
    • Method Detail

      • init

        void init​(MessageSecurityProvider securityProvider,
                  java.util.Properties config)
           throws ReceiptMessageException
        Method that initializes the receipt parser with property set.
        Parameters:
        securityProvider - the message security provider to use.
        config - the configuration of the parser.
        Throws:
        ReceiptMessageException - if configuration contained bad configuration of security provider.
      • parseMessage

        java.util.List<ReceiptMessage> parseMessage​(byte[] messageData)
                                             throws java.lang.IllegalArgumentException,
                                                    ReceiptMessageException
        Method to parse the messageData into a ReceiptMessage with validation according to the specification.
        Parameters:
        messageData - the message data to parse
        Returns:
        a list of ReceiptMessage that is valid, never null.
        Throws:
        java.lang.IllegalArgumentException - if receipt message contained invalid data not conforming to the standard.
        ReceiptMessageException - if internal state occurred when processing the message
      • genReceiptMessage

        byte[] genReceiptMessage​(java.lang.String messageId,
                                 ReceiptStatus status,
                                 java.lang.String errorDescription)
                          throws java.lang.IllegalArgumentException,
                                 ReceiptMessageException
        Method to generate a receipt message from the supplied data. Using destination node specified in configuration (if applicable).
        Parameters:
        messageId - the unique message id
        status - the status of the receipt message
        errorDescription - optional error description, null if not applicable
        Returns:
        a generated receipt message, never null.
        Throws:
        java.lang.IllegalArgumentException - if supplied arguments were invalid.
        ReceiptMessageException - if internal problems occurred when generating the receipt message.
      • genReceiptMessage

        byte[] genReceiptMessage​(java.lang.String destinationNode,
                                 java.lang.String messageId,
                                 ReceiptStatus status,
                                 java.lang.String errorDescription)
                          throws java.lang.IllegalArgumentException,
                                 ReceiptMessageException
        Alternative method to generate a receipt message from the supplied data but with a specified destination in header data. (if applicable).
        Parameters:
        messageId - the unique message id
        status - the status of the receipt message
        errorDescription - optional error description, null if not applicable
        Returns:
        a generated receipt message, never null.
        Throws:
        java.lang.IllegalArgumentException - if supplied arguments were invalid.
        ReceiptMessageException - if internal problems occurred when generating the receipt message.