@ComponentProfile(summary="Store message for retry on the filesystem.", since="3.11.1") public class FilesystemRetryStore extends java.lang.Object implements RetryStore
While not tightly coupled with RetryFromJetty
it is designed somewhat exclusively for
that. You may be able to make use of it in other ways, but behaviour may change unexpectedly due
to changes in RetryFromJetty
.
The behaviour of this store will assume that each message-id
will form a sub-directory
off baseUrl
. Metadata will be stored [baseUrl]/[msgId]/metadata.properties
as a
standard properties file; the payload will be stored in [baseUrl]/[msgId]/payload.blob
.
In the adapter configuration file this class is aliased as retry-store-filesystem which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
FilesystemRetryStore() |
Modifier and Type | Method and Description |
---|---|
AdaptrisMessage |
buildForRetry(java.lang.String msgId,
java.util.Map<java.lang.String,java.lang.String> metadata,
AdaptrisMessageFactory msgFac)
Build the message for retrying from the store.
|
protected static RemoteBlob |
createForReport(java.io.File baseDir) |
boolean |
delete(java.lang.String msgId)
Delete a message from the store (optional operation).
|
java.lang.String |
getBaseUrl()
The base URL
file:///... where we can discover files. |
java.util.Map<java.lang.String,java.lang.String> |
getMetadata(java.lang.String msgId)
Retrieve the metadata associated with the msgId the store.
|
void |
prepare()
Prepare for initialisation.
|
java.lang.Iterable<RemoteBlob> |
report()
Report on a list of blobs that is present in the store (optional operation).
|
void |
setBaseUrl(java.lang.String baseUrl)
The base URL
file:///... where we can discover files. |
FilesystemRetryStore |
withBaseUrl(java.lang.String s) |
void |
write(AdaptrisMessage msg)
Write a message to the store.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildForRetry, buildForRetry
close, init, start, stop
public void prepare() throws CoreException
ComponentLifecycleExtension
prepare
in interface ComponentLifecycleExtension
prepare
in interface RetryStore
CoreException
public void write(AdaptrisMessage msg) throws InterlokException
RetryStore
write
in interface RetryStore
InterlokException
public AdaptrisMessage buildForRetry(java.lang.String msgId, java.util.Map<java.lang.String,java.lang.String> metadata, AdaptrisMessageFactory msgFac) throws InterlokException
RetryStore
buildForRetry
in interface RetryStore
msgId
- the message id.metadata
- the metadata you want to apply to the messagemsgFac
- the message factory to useCoreException
InterlokException
public java.util.Map<java.lang.String,java.lang.String> getMetadata(java.lang.String msgId) throws InterlokException
RetryStore
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.
getMetadata
in interface RetryStore
InterlokException
- if no metadata could be retrieved (e.g the msgId doesn't exist)public java.lang.Iterable<RemoteBlob> report() throws InterlokException
RetryStore
report
in interface RetryStore
InterlokException
public boolean delete(java.lang.String msgId) throws InterlokException
RetryStore
delete
in interface RetryStore
InterlokException
protected static RemoteBlob createForReport(java.io.File baseDir)
public FilesystemRetryStore withBaseUrl(java.lang.String s)
public java.lang.String getBaseUrl()
file:///...
where we can discover files.public void setBaseUrl(java.lang.String baseUrl)
file:///...
where we can discover files.