Interface RetryStore
-
- All Superinterfaces:
ComponentLifecycle
,ComponentLifecycleExtension
- All Known Implementing Classes:
FilesystemRetryStore
,JdbcRetryStore
public interface RetryStore extends ComponentLifecycle, ComponentLifecycleExtension
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
acknowledge(java.lang.String acknowledgeId)
Acknowledge that the message with the passed ID has now been successfully processed and should not be retried again.default AdaptrisMessage
buildForRetry(java.lang.String msgId)
Retrieve the message id from the store.default AdaptrisMessage
buildForRetry(java.lang.String msgId, java.util.Map<java.lang.String,java.lang.String> metadata)
Retrieve the message id from the store.AdaptrisMessage
buildForRetry(java.lang.String msgId, java.util.Map<java.lang.String,java.lang.String> metadata, AdaptrisMessageFactory factory)
Build the message for retrying from the store.default boolean
delete(java.lang.String msgId)
Delete a message from the store (optional operation).void
deleteAcknowledged()
Delete any messages that have been successfully Acknowledged.java.util.Map<java.lang.String,java.lang.String>
getMetadata(java.lang.String msgId)
Retrieve the metadata associated with the msgId the store.void
makeConnection(AdaptrisConnection connection)
Used for any implementations that have a connected RetryStorejava.util.List<AdaptrisMessage>
obtainExpiredMessages()
Obtain a list ofAdaptrisMessage
s which meet the expiration criteria.java.util.List<AdaptrisMessage>
obtainMessagesToRetry()
Obtain a list ofAdaptrisMessage
s which meet the criteria for retrying.default void
prepare()
Prepare for initialisation.default java.lang.Iterable<RemoteBlob>
report()
Report on a list of blobs that is present in the store (optional operation).void
updateRetryCount(java.lang.String messageId)
Update the number of retries which have taken place for the message with the passed ID.void
write(AdaptrisMessage msg)
Write a message to the store.-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stop
-
-
-
-
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.
-
write
void write(AdaptrisMessage msg) throws InterlokException
Write a message to the store.- Throws:
InterlokException
-
buildForRetry
default AdaptrisMessage buildForRetry(java.lang.String msgId) throws InterlokException
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(java.lang.String msgId, java.util.Map<java.lang.String,java.lang.String> metadata) throws InterlokException
Retrieve the message id from the store.- Throws:
InterlokException
- Implementation Note:
- The default implementation delegates to
buildForRetry(String, Map, AdaptrisMessageFactory)
viagetMetadata(String)
-
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 messagefactory
- 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.
-
prepare
default void prepare() throws CoreException
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Specified by:
prepare
in interfaceComponentLifecycleExtension
- Throws:
CoreException
-
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 anyException
which occurs
-
deleteAcknowledged
void deleteAcknowledged() throws InterlokException
Delete any messages that have been successfully Acknowledged.- Throws:
InterlokException
- wrapping anyException
which occurs
-
obtainExpiredMessages
java.util.List<AdaptrisMessage> obtainExpiredMessages() throws InterlokException
Obtain a list of
AdaptrisMessage
s 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
AdaptrisMessage
s which meet the expiration criteria. - Throws:
InterlokException
- wrapping anyException
which occurs
-
obtainMessagesToRetry
java.util.List<AdaptrisMessage> obtainMessagesToRetry() throws InterlokException
Obtain a list of
AdaptrisMessage
s which meet the criteria for retrying.- Returns:
- a list of
AdaptrisMessage
s which meet the criteria for retrying - Throws:
InterlokException
- wrapping anyException
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 anyException
which occurs
-
makeConnection
void makeConnection(AdaptrisConnection connection)
Used for any implementations that have a connected RetryStore
-
-