Interface RetryStore

    • Method Detail

      • report

        default java.lang.Iterable<RemoteBlob> report()
                                               throws InterlokException
        Report on a list of blobs that is present in the store (optional operation).
        Throws:
        InterlokException
        Implementation Note:
        The default implementation just returns an empty list.
      • buildForRetry

        AdaptrisMessage buildForRetry​(java.lang.String msgId,
                                      java.util.Map<java.lang.String,​java.lang.String> metadata,
                                      AdaptrisMessageFactory factory)
                               throws InterlokException
        Build the message for retrying from the store.
        Parameters:
        msgId - the message id.
        metadata - the metadata you want to apply to the message
        factory - the message factory to use
        Returns:
        a message.
        Throws:
        CoreException
        InterlokException
      • getMetadata

        java.util.Map<java.lang.String,​java.lang.String> getMetadata​(java.lang.String msgId)
                                                                    throws InterlokException
        Retrieve the metadata associated with the msgId the store.

        This is used to assert that the workflow exists in this instance for that message; there is no point building the whole message only to fail because the workflow doesn't exist.

        Throws:
        InterlokException - if no metadata could be retrieved (e.g the msgId doesn't exist)
      • delete

        default boolean delete​(java.lang.String msgId)
                        throws InterlokException
        Delete a message from the store (optional operation).
        Throws:
        InterlokException
        Implementation Note:
        The default implementation throws an instance of UnsupportedOperationException and performs no other action.
      • acknowledge

        void acknowledge​(java.lang.String acknowledgeId)
                  throws InterlokException

        Acknowledge that the message with the passed ID has now been successfully processed and should not be retried again. NB this method does not throw an Exception if the acknowledge ID does not exist in the store.

        Parameters:
        acknowledgeId - the acknowledge ID of the message to acknowledge
        Throws:
        InterlokException - wrapping any Exception which occurs
      • deleteAcknowledged

        void deleteAcknowledged()
                         throws InterlokException
        Delete any messages that have been successfully Acknowledged.
        Throws:
        InterlokException - wrapping any Exception which occurs
      • obtainExpiredMessages

        java.util.List<AdaptrisMessage> obtainExpiredMessages()
                                                       throws InterlokException

        Obtain a list of AdaptrisMessages which meet the expiration criteria. In the most abstract sense, expired messages are those that have exceeded their max retry count but not yet been acknowledged.

        Returns:
        a list of AdaptrisMessages which meet the expiration criteria.
        Throws:
        InterlokException - wrapping any Exception which occurs
      • obtainMessagesToRetry

        java.util.List<AdaptrisMessage> obtainMessagesToRetry()
                                                       throws InterlokException

        Obtain a list of AdaptrisMessages which meet the criteria for retrying.

        Returns:
        a list of AdaptrisMessages which meet the criteria for retrying
        Throws:
        InterlokException - wrapping any Exception which occurs
      • updateRetryCount

        void updateRetryCount​(java.lang.String messageId)
                       throws InterlokException

        Update the number of retries which have taken place for the message with the passed ID. NB this method does not throw an Exception if an attempt is made to update the retry count for a message ID which does not exist in the store.

        Parameters:
        messageId - the ID of the message to update
        Throws:
        InterlokException - wrapping any Exception which occurs
      • makeConnection

        void makeConnection​(AdaptrisConnection connection)

        Used for any implementations that have a connected RetryStore