public class XmlFileRepository extends TransactionIdRepository
This object is probably not particularly thread-safe, it does attempt to lock the file for access using a semaphore file, however, this is not guaranteed to work on some filesystems.
By default, entries that are present for over 90 days will be purged.
In the adapter configuration file this class is aliased as sap-xml-tid-repository which is the preferred alternative to the fully qualified classname when building your configuration.
logR
Constructor and Description |
---|
XmlFileRepository() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFileName()
Get the filename to use.
|
java.lang.String |
getLockFile()
Get the lockfile.
|
java.lang.Integer |
getMaxLockAttempts()
Return the maximum number of lock attempts.
|
java.lang.Integer |
getPurgeOlderThanDays()
Get the configured purge time for transactions.
|
java.lang.Boolean |
getUseGzip()
Get the GZIP compression setting.
|
TransactionId |
retrieveByMessageId(java.lang.String id)
Retrieve a tid from the store.
|
TransactionId |
retrieveByTid(java.lang.String s)
Retrieve a tid from the store.
|
void |
saveOrUpdate(TransactionId tid)
Store this transaction id.
|
void |
setFileName(java.lang.String s)
Set the filename to be use.
|
void |
setLockFile(java.lang.String s)
Set the lock file.
|
void |
setMaxLockAttempts(java.lang.Integer i)
Set the maximum number of attempts to make a lock.
|
void |
setPurgeOlderThanDays(java.lang.Integer i)
Set the purge Time for transactions.
|
void |
setUseGzip(java.lang.Boolean b)
By default we expect that files will become rather large so GZIP
compression of the file is enabled.
|
java.lang.String |
toString() |
public void setFileName(java.lang.String s)
s
- the filename.public java.lang.String getFileName()
public void setUseGzip(java.lang.Boolean b)
If debugging, or diskspace is not an issue, you can disable this setting.
b
- true to enable gzip compression default=true.public java.lang.Boolean getUseGzip()
public void setLockFile(java.lang.String s)
s
- the lockfile.public java.lang.String getLockFile()
public void saveOrUpdate(TransactionId tid) throws java.lang.Exception
TransactionIdRepository
saveOrUpdate
in class TransactionIdRepository
tid
- the transaction id.java.lang.Exception
- if there was any error, such as the TID already existing.TransactionIdRepository.saveOrUpdate(TransactionId)
public void setPurgeOlderThanDays(java.lang.Integer i)
i
- the expiry time in days, if zero or less then it assumes that
transactions do not expire.public java.lang.Integer getPurgeOlderThanDays()
public TransactionId retrieveByTid(java.lang.String s) throws java.lang.Exception
TransactionIdRepository
retrieveByTid
in class TransactionIdRepository
s
- the transcation id.java.lang.Exception
- on error.TransactionIdRepository.retrieveByTid(java.lang.String)
public TransactionId retrieveByMessageId(java.lang.String id) throws java.lang.Exception
TransactionIdRepository
retrieveByMessageId
in class TransactionIdRepository
id
- the AdaptrisMessage id.java.lang.Exception
- on error.TransactionIdRepository.retrieveByMessageId(java.lang.String)
public void setMaxLockAttempts(java.lang.Integer i)
i
- the number of attempts, if less than or equal to zero, then an
infinite number of attempts is assumed.public java.lang.Integer getMaxLockAttempts()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
Copyright Adaptris