Package com.avoka.fc.core.service
Class TransactionProcessor
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.CayenneService
-
- com.avoka.fc.core.service.TransactionProcessor
-
- All Implemented Interfaces:
IServiceDefinitionAware
,ITransactionProcessor
public class TransactionProcessor extends CayenneService implements ITransactionProcessor, IServiceDefinitionAware
Provides the default service of type "Transaction Processor". This implementation performs task expiry, submission abandonment, receipting and delivery in this order. For each step, the set of eligible submissions is calculated separately. Submissions may take part in multiple steps, e.g. receipting and then delivery. Each step can be turned off using service parameters, but this means submissions will not be processed, creating a backlog. Therefore, turning off a step should be used only for a short time when needed.- Since:
- 4.1.0
-
-
Constructor Summary
Constructors Constructor Description TransactionProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
getFetchLimitForAbandonment()
Returns the fetch limit to use for submission abandonment.int
getFetchLimitForDelivery()
Returns the fetch limit to use for submission delivery.int
getFetchLimitForHistory()
Returns the fetch limit to use for transaction history creationint
getFetchLimitForTransactionPurging()
The maximum number of records to process for Transaction record purgingint
getMaxDataRetentionPeriod()
ServiceDefinition
getServiceDefinition()
Return the service definition for this service.int
getSystemAlertTimeMinutes()
Returns the number of minutes that the system monitoring job will use when determining whether system alerts need to be raised about the transaction processing service.void
interruptProcessing()
Interrupt ongoing transaction processing.boolean
isIncludeAbandonment()
Returns whether the transaction processor will perform submission abandonment.boolean
isIncludeDataRetention()
Returns whether the transaction processor will perform data retentionboolean
isIncludeDelivery()
Returns whether the transaction processor will perform submission delivery.boolean
isIncludeRESTDeliveryRetry()
boolean
isIncludeTaskExpiry()
Deprecated.boolean
isIncludeTransactionHistory()
Returns whether the transaction processor will create transaction history recordsvoid
processTransactions()
Process the list of transactions in the system, performing necessary steps such as abandonment, receipting and delivery in a meaningful sequence.void
setFetchLimitForAbandonment(int fetchLimitForAbandonment)
Set the fetch limit to use for submission abandonment.void
setFetchLimitForDelivery(int fetchLimitForDelivery)
Set the fetch limit to use for submission delivery.void
setFetchLimitForHistory(int fetchLimitForHistory)
Set the fetch limit to use for transaction history creationvoid
setFetchLimitForTransactionPurging(int limit)
The maximum number of records to process for Transaction record purgingvoid
setIncludeAbandonment(boolean includeAbandonment)
Set whether the transaction processor will perform submission abandonment.void
setIncludeDataRetention(boolean includeDataRetention)
Set whether the transaction processor will perform data retention.void
setIncludeDelivery(boolean includeDelivery)
Set whether the transaction processor will perform delivery.void
setIncludeRESTDeliveryRetry(boolean includeRESTDeliveryRetry)
Set whether the transaction processor will perform REST delivery retry.void
setIncludeTaskExpiry(boolean includeTaskExpiry)
Deprecated.void
setIncludeTransactionHistory(boolean transactionHistory)
Set whether the transaction processor will will create transaction history recordsvoid
setLogToEventLog(boolean value)
Specify whether to log the results of the transaction processing to the event log.void
setMaxDataRetentionPeriod(int maxDataRetentionPeriod)
Set the maximum data retention period in seconds to perform.void
setServiceDefinition(ServiceDefinition serviceDefinition)
Set the service definition for this service.void
setSystemAlertTimeMinutes(int systemAlertTimeMinutes)
Set the number of minutes that the system monitoring job will use when determining whether system alerts need to be raised about the transaction processing service.-
Methods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
-
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
-
-
-
Method Detail
-
processTransactions
public void processTransactions()
Process the list of transactions in the system, performing necessary steps such as abandonment, receipting and delivery in a meaningful sequence. Each step will operate only on the set of transactions eligible for it and commit its work before the next step starts.- Specified by:
processTransactions
in interfaceITransactionProcessor
- See Also:
ITransactionProcessor.processTransactions()
-
interruptProcessing
public void interruptProcessing()
Interrupt ongoing transaction processing. This does not happen instantaneously, but the service will check at suitable occasions (e.g. after processing a submission) and stop processing.- Specified by:
interruptProcessing
in interfaceITransactionProcessor
- See Also:
ITransactionProcessor.interruptProcessing()
-
isIncludeTaskExpiry
@Deprecated public boolean isIncludeTaskExpiry()
Deprecated.Obsolete in TM 18.5.0.- Specified by:
isIncludeTaskExpiry
in interfaceITransactionProcessor
- Returns:
- the value of the includeTaskExpiry service parameter
- See Also:
ITransactionProcessor.isIncludeTaskExpiry()
-
setIncludeTaskExpiry
@Deprecated public void setIncludeTaskExpiry(boolean includeTaskExpiry)
Deprecated.Obsolete in TM 18.5.0. Note: Turning off a processing step will cause a backlog. Use with caution and re-enable the step as soon as possible.- Parameters:
includeTaskExpiry
- the new value of the includeTaskExpiry service parameter
-
isIncludeAbandonment
public boolean isIncludeAbandonment()
Returns whether the transaction processor will perform submission abandonment.- Specified by:
isIncludeAbandonment
in interfaceITransactionProcessor
- Returns:
- the value of the includeAbandonment service parameter
- See Also:
ITransactionProcessor.isIncludeAbandonment()
-
setIncludeAbandonment
public void setIncludeAbandonment(boolean includeAbandonment)
Set whether the transaction processor will perform submission abandonment. Note: Turning off a processing step will cause a backlog. Use with caution and re-enable the step as soon as possible.- Parameters:
includeAbandonment
- the new value of the includeAbandonment service parameter
-
isIncludeDelivery
public boolean isIncludeDelivery()
Returns whether the transaction processor will perform submission delivery.- Specified by:
isIncludeDelivery
in interfaceITransactionProcessor
- Returns:
- the value of the includeDelivery service parameter
- See Also:
ITransactionProcessor.isIncludeDelivery()
-
setIncludeDelivery
public void setIncludeDelivery(boolean includeDelivery)
Set whether the transaction processor will perform delivery. Note: Turning off a processing step will cause a backlog. Use with caution and re-enable the step as soon as possible.- Parameters:
includeDelivery
- the new value of the includeDelivery service parameter
-
isIncludeRESTDeliveryRetry
public boolean isIncludeRESTDeliveryRetry()
- Specified by:
isIncludeRESTDeliveryRetry
in interfaceITransactionProcessor
- Returns:
- whether the transaction processor will perform REST delivery retry.
- Since:
- 4.1.8
-
setIncludeRESTDeliveryRetry
public void setIncludeRESTDeliveryRetry(boolean includeRESTDeliveryRetry)
Set whether the transaction processor will perform REST delivery retry. Note: Turning off a processing step will cause a backlog. Use with caution and re-enable the step as soon as possible.- Parameters:
includeRESTDeliveryRetry
- the new value of the includeDelivery service parameter- Since:
- 4.1.8
-
isIncludeTransactionHistory
public boolean isIncludeTransactionHistory()
Returns whether the transaction processor will create transaction history records- Specified by:
isIncludeTransactionHistory
in interfaceITransactionProcessor
- Returns:
- whether the transaction processor will create transaction history records
- Since:
- 5.1.0
- See Also:
ITransactionProcessor.isIncludeTransactionHistory()
-
setIncludeTransactionHistory
public void setIncludeTransactionHistory(boolean transactionHistory)
Set whether the transaction processor will will create transaction history records- Parameters:
transactionHistory
- the new value of the transactionHistory service parameter- Since:
- 5.1.0
-
isIncludeDataRetention
public boolean isIncludeDataRetention()
Returns whether the transaction processor will perform data retention- Specified by:
isIncludeDataRetention
in interfaceITransactionProcessor
- Returns:
- whether the transaction processor will perform data retention.
- Since:
- 4.3.3
- See Also:
ITransactionProcessor.isIncludeDataRetention()
-
setIncludeDataRetention
public void setIncludeDataRetention(boolean includeDataRetention)
Set whether the transaction processor will perform data retention.- Parameters:
includeDataRetention
- the new value of the includeDataRetention service parameter- Since:
- 4.3.3
-
getFetchLimitForAbandonment
public int getFetchLimitForAbandonment()
Returns the fetch limit to use for submission abandonment. Note: Abandonment works on four different classes of submission. Each of them uses the fetch limit, so in theory the abandonment step may process up to 4xfetchLimitForAbandonment records- Returns:
- the value of the fetchLimitForAbandonment service parameter
-
setFetchLimitForAbandonment
public void setFetchLimitForAbandonment(int fetchLimitForAbandonment)
Set the fetch limit to use for submission abandonment. Note: Abandonment works on four different classes of submission. Each of them uses the fetch limit, so in theory the abandonment step may process up to 4xfetchLimitForAbandonment records- Parameters:
fetchLimitForAbandonment
- the new value of the fetchLimitForAbandonment service parameter
-
getFetchLimitForDelivery
public int getFetchLimitForDelivery()
Returns the fetch limit to use for submission delivery.- Returns:
- the value of the fetchLimitForDelivery service parameter
-
setFetchLimitForDelivery
public void setFetchLimitForDelivery(int fetchLimitForDelivery)
Set the fetch limit to use for submission delivery.- Parameters:
fetchLimitForDelivery
- the new value of the fetchLimitForDelivery service parameter
-
getFetchLimitForHistory
public int getFetchLimitForHistory()
Returns the fetch limit to use for transaction history creation- Returns:
- the value of the fetchLimitForHistory service parameter
-
setFetchLimitForHistory
public void setFetchLimitForHistory(int fetchLimitForHistory)
Set the fetch limit to use for transaction history creation- Parameters:
fetchLimitForHistory
- the new value of the fetchLimitForHistory service parameter
-
getFetchLimitForTransactionPurging
public int getFetchLimitForTransactionPurging()
The maximum number of records to process for Transaction record purging- Returns:
- the maximum number of records to process for Transaction record purging
- Since:
- 4.3.3
-
setFetchLimitForTransactionPurging
public void setFetchLimitForTransactionPurging(int limit)
The maximum number of records to process for Transaction record purging- Parameters:
limit
- the maximum number of records to process for Transaction record purging- Since:
- 4.3.3
-
setLogToEventLog
public void setLogToEventLog(boolean value)
Specify whether to log the results of the transaction processing to the event log.- Specified by:
setLogToEventLog
in interfaceITransactionProcessor
- Parameters:
value
- to specify whether to log the results of the transaction processing to the event log- Since:
- 4.3.3
-
getSystemAlertTimeMinutes
public int getSystemAlertTimeMinutes()
Returns the number of minutes that the system monitoring job will use when determining whether system alerts need to be raised about the transaction processing service. For example, if the transaction processing job has not run in the last n minutes (as determined by this setting) and is not paused, a system alert will be raised.- Specified by:
getSystemAlertTimeMinutes
in interfaceITransactionProcessor
- Returns:
- the number of minutes to use in system monitoring
- See Also:
ITransactionProcessor.getSystemAlertTimeMinutes()
-
setSystemAlertTimeMinutes
public void setSystemAlertTimeMinutes(int systemAlertTimeMinutes)
Set the number of minutes that the system monitoring job will use when determining whether system alerts need to be raised about the transaction processing service. For example, if the transaction processing job has not run in the last n minutes (as determined by this setting) and is not paused, a system alert will be raised.- Parameters:
systemAlertTimeMinutes
- the new value of the systemAlertTimeMinutes service parameter
-
getMaxDataRetentionPeriod
public int getMaxDataRetentionPeriod()
- Returns:
- the maximum data retention period in seconds to perform.
- Since:
- 18.11.0
-
setMaxDataRetentionPeriod
public void setMaxDataRetentionPeriod(int maxDataRetentionPeriod)
Set the maximum data retention period in seconds to perform.- Parameters:
maxDataRetentionPeriod
- the maximum data retention period in seconds- Since:
- 18.11.0
-
getServiceDefinition
public ServiceDefinition getServiceDefinition()
Return the service definition for this service.- Specified by:
getServiceDefinition
in interfaceIServiceDefinitionAware
- Returns:
- the service definition
- See Also:
IServiceDefinitionAware.getServiceDefinition()
-
setServiceDefinition
public void setServiceDefinition(ServiceDefinition serviceDefinition)
Set the service definition for this service.- Specified by:
setServiceDefinition
in interfaceIServiceDefinitionAware
- Parameters:
serviceDefinition
- the new service definition- See Also:
IServiceDefinitionAware.setServiceDefinition(ServiceDefinition)
-
-