Interface RetryStore
- All Superinterfaces:
ComponentLifecycle,ComponentLifecycleExtension
- All Known Implementing Classes:
FilesystemRetryStore,JdbcRetryStore
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledge(String acknowledgeId) Acknowledge that the message with the passed ID has now been successfully processed and should not be retried again.default AdaptrisMessagebuildForRetry(String msgId) Retrieve the message id from the store.default AdaptrisMessagebuildForRetry(String msgId, Map<String, String> metadata) Retrieve the message id from the store.buildForRetry(String msgId, Map<String, String> metadata, AdaptrisMessageFactory factory) Build the message for retrying from the store.default booleanDelete a message from the store (optional operation).voidDelete any messages that have been successfully Acknowledged.getMetadata(String msgId) Retrieve the metadata associated with the msgId the store.voidmakeConnection(AdaptrisConnection connection) Used for any implementations that have a connected RetryStoredefault List<AdaptrisMessage>Obtain a list ofAdaptrisMessages which meet the expiration criteria.default List<AdaptrisMessage>Obtain a list ofAdaptrisMessages which meet the criteria for retrying.default voidprepare()Prepare for initialisation.default Iterable<RemoteBlob>report()Report on a list of blobs that is present in the store (optional operation).voidupdateRetryCount(String messageId) Update the number of retries which have taken place for the message with the passed ID.voidwrite(AdaptrisMessage msg) Write a message to the store.Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stop
-
Method Details
-
report
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.
-
write
Write a message to the store.- Throws:
InterlokException
-
buildForRetry
Retrieve the message id from the store.- Throws:
InterlokException- Implementation Note:
- The default implementation delegates to
buildForRetry(String, Map)viagetMetadata(String)
-
buildForRetry
default AdaptrisMessage buildForRetry(String msgId, Map<String, String> metadata) throws InterlokExceptionRetrieve the message id from the store.- Throws:
InterlokException- Implementation Note:
- The default implementation delegates to
buildForRetry(String, Map, AdaptrisMessageFactory)viagetMetadata(String)
-
buildForRetry
AdaptrisMessage buildForRetry(String msgId, Map<String, String> metadata, AdaptrisMessageFactory factory) throws InterlokExceptionBuild the message for retrying from the store.- Parameters:
msgId- the message id.metadata- the metadata you want to apply to the messagefactory- the message factory to use- Returns:
- a message.
- Throws:
CoreExceptionInterlokException
-
getMetadata
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
Delete a message from the store (optional operation).- Throws:
InterlokException- Implementation Note:
- The default implementation throws an instance of
UnsupportedOperationExceptionand performs no other action.
-
prepare
Description copied from interface:ComponentLifecycleExtensionPrepare for initialisation.- Specified by:
preparein interfaceComponentLifecycleExtension- Throws:
CoreException
-
acknowledge
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 anyExceptionwhich occurs
-
deleteAcknowledged
Delete any messages that have been successfully Acknowledged.- Throws:
InterlokException- wrapping anyExceptionwhich occurs
-
obtainExpiredMessages
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 anyExceptionwhich occurs- Implementation Note:
- The default implementation throws an instance of
UnsupportedOperationExceptionand performs no other action.
-
obtainMessagesToRetry
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 anyExceptionwhich occurs- Implementation Note:
- The default implementation throws an instance of
UnsupportedOperationExceptionand performs no other action.
-
updateRetryCount
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 anyExceptionwhich occurs
-
makeConnection
Used for any implementations that have a connected RetryStore
-