Package com.avoka.fc.core.service.impl
Class DataRetentionManagementServiceImpl
java.lang.Object
com.avoka.fc.core.service.BaseService
com.avoka.fc.core.service.CayenneService
com.avoka.fc.core.service.impl.DataRetentionManagementServiceImpl
- All Implemented Interfaces:
IDataRetentionManagementService
public class DataRetentionManagementServiceImpl
extends CayenneService
implements IDataRetentionManagementService
Provides an implementation class for log purge services.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The maximum age for failed email queue items(hard-coded)static final int
The maximum age for import log entries, both successful and failed (hard-coded)int
The maximum age for email queue itemsFields inherited from interface com.avoka.fc.core.service.IDataRetentionManagementService
PARAM_ENFORCE_GLOBAL_THRESHOLD, PARAM_MAX_AUDIT_LOG_AGE_DAYS, PARAM_MAX_COLLABORATION_JOB_ABANDON_AGE_DAYS, PARAM_MAX_COLLABORATION_JOB_AGE_DAYS, PARAM_MAX_DELIVERED_SUBMISSION_DATA_AGE_DAYS, PARAM_MAX_EMAIL_QUEUE_AGE_DAYS, PARAM_MAX_ERROR_LOG_AGE_DAYS, PARAM_MAX_EVENT_LOG_AGE_DAYS, PARAM_MAX_GROOVY_SERVICE_LOG_AGE_DAYS, PARAM_MAX_OFFLINE_SYNC_LOG_AGE_DAYS, PARAM_MAX_SAVED_SUBMISSION_AGE_DAYS, PARAM_MAX_SCHEDULED_JOB_HISTORY_AGE_DAYS, PARAM_MAX_SECURITY_MANAGER_LOG_AGE_DAYS, PARAM_MAX_SUBMISSION_LOG_AGE_DAYS, PARAM_MAX_TRANSACTION_HISTORY_AGE_DAYS, PARAM_MAX_USER_AUTH_EVENT_AGE_DAYS, PARAM_PII_SEARCH_PURGE_MODE, PARAM_PII_SEARCH_PURGE_MODE_PURGE_TIME, PII_SEARCH_PURGE_MODE_DELIVERY_COMPLETED, PII_SEARCH_PURGE_MODE_FORM_COMPLETED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
applyDataRetentionPolicy
(int fetchLimit, int maxPeriodSec) Purge database records which are due to purged (deleted) from the database.int
Return the age in days at which an audit log entry becomes eligible for purging.int
Return the age in days at which a collaboration job becomes eligible for Abandonment.int
Return the age in days at which a collaboration job becomes eligible for purging.int
Gets the max delivered submission data age in days.int
Returns the max email queue age days.int
Return the age in days at which an error log entry becomes eligible for purging.int
Return the age in days at which an event log entry becomes eligible for purging.int
Return the age in days at which a groovy service log entry becomes eligible for purging.int
Gets the max import log age days.int
Return the age in days at which a Field Worker sync log entry becomes eligible for purging.int
Gets the max saved submission age days.int
Return the age in days at which a scheduled job history entry becomes eligible for purging.int
Return the age in days at which a security manager log entry becomes eligible for purging.int
Return the age in days at which a request log entry becomes eligible for purging.int
Gets the max submission log age days.int
Return the maximum age of the transaction history in days.int
Return the age in days at which a user authentication event becomes eligible for purging.boolean
Return whether the service is configured to enforce global policies over organization and form level policies.void
setEnforceGlobalThreshold
(boolean enforceGlobalThreshold) void
setLogToEventLog
(boolean value) Specify whether to log the results of the data retention job to the event log.void
setMaxAuditLogAgeDays
(int maxAuditLogAgeDays) Set the age in days at which an audit log entry becomes eligible for purging.void
setMaxCollaborationJobAbandonAgeDays
(int maxCollaborationJobAbandonAgeDays) Set the age in days at which a collaboration job becomes eligible for Abandonment.void
setMaxCollaborationJobAgeDays
(int maxCollaborationJobAgeDays) Set the age in days at which a collaboration job becomes eligible for purging.void
setMaxDeliveredSubmissionDataAgeDays
(int maxAge) Sets the max delivered submission data age in days.void
setMaxEmailQueueAgeDays
(int maxEmailQueueAgeDays) Sets the max email queue entry age in days.void
setMaxErrorLogAgeDays
(int maxErrorLogAgeDays) Set the age in days at which an error log entry becomes eligible for purging.void
setMaxEventLogAgeDays
(int maxEventLogAgeDays) Set the age in days at which an event log entry becomes eligible for purging.void
setMaxGroovyServiceLogAgeDays
(int maxGroovyServiceLogAgeDays) Set the age in days at which a groovy service log entry becomes eligible for purging.void
setMaxOfflineSyncLogAgeDays
(int maxOfflineSyncLogAgeDays) Set the age in days at which a Field Worker sync log entry becomes eligible for purging.void
setMaxSavedSubmissionAgeDays
(int maxSavedSubmissionAgeDays) Sets the max saved submission age days.void
setMaxScheduledJobHistoryAgeDays
(int maxScheduledJobHistoryAgeDays) Return the age in days at which a scheduled job history entry becomes eligible for purging.void
setMaxSecurityManagerLogAgeDays
(int maxSecurityManagerLogAgeDays) Set the age in days at which a security manager log entry becomes eligible for purging.void
setMaxServerHealthLogAgeDays
(int maxServerHealthLogAgeDays) Set the age in days at which a server health log entry becomes eligible for purging.void
setMaxSubmissionLogAgeDays
(int maxSubmissionLogAgeDays) Sets the max submission log age days.void
setMaxTransactionHistoryAgeDays
(int maxTransactionHistoryAgeDays) void
setMaxUserAuthEventAgeDays
(int maxUserAuthEventAgeDays) Set the age in days at which a user authentication event becomes eligible for purging.void
setPiiSearchPurgeMode
(String piiSearchPurgeMode) Sets the piiSearchPurgeMode String.void
setStorageExpiryDays
(int storageExpiryDays) This method does nothing and is provided for backward compatibility purposes.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
-
Field Details
-
EMAIL_QUEUE_MAX_AGE_DAYS
public static final int EMAIL_QUEUE_MAX_AGE_DAYSThe maximum age for failed email queue items(hard-coded)- See Also:
-
IMPORT_LOG_MAX_AGE_DAYS
public static final int IMPORT_LOG_MAX_AGE_DAYSThe maximum age for import log entries, both successful and failed (hard-coded)- See Also:
-
maxEmailQueueAgeDays
public int maxEmailQueueAgeDaysThe maximum age for email queue items
-
-
Constructor Details
-
DataRetentionManagementServiceImpl
public DataRetentionManagementServiceImpl()
-
-
Method Details
-
applyDataRetentionPolicy
public int applyDataRetentionPolicy(int fetchLimit, int maxPeriodSec) Purge database records which are due to purged (deleted) from the database. Note that this method contains database transactions.- Specified by:
applyDataRetentionPolicy
in interfaceIDataRetentionManagementService
- Parameters:
fetchLimit
- the purge fetch limitmaxPeriodSec
- the maximum amount of time to perform data retention in seconds- Returns:
- the number of records deleted
- See Also:
-
getMaxAuditLogAgeDays
public int getMaxAuditLogAgeDays()Return the age in days at which an audit log entry becomes eligible for purging.- Specified by:
getMaxAuditLogAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- The age in days at which an audit log entry becomes eligible for purging
-
setMaxAuditLogAgeDays
public void setMaxAuditLogAgeDays(int maxAuditLogAgeDays) Set the age in days at which an audit log entry becomes eligible for purging.- Parameters:
maxAuditLogAgeDays
- the age in days at which an audit log entry becomes eligible for purging
-
getMaxUserAuthEventAgeDays
public int getMaxUserAuthEventAgeDays()Return the age in days at which a user authentication event becomes eligible for purging.- Specified by:
getMaxUserAuthEventAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- The age in days at which a user authentication event becomes eligible for purging
- Since:
- 4.1.3
-
setMaxUserAuthEventAgeDays
public void setMaxUserAuthEventAgeDays(int maxUserAuthEventAgeDays) Set the age in days at which a user authentication event becomes eligible for purging.- Parameters:
maxUserAuthEventAgeDays
- the age in days at which a user authentication event becomes eligible for purging- Since:
- 4.1.3
-
getMaxCollaborationJobAgeDays
public int getMaxCollaborationJobAgeDays()Return the age in days at which a collaboration job becomes eligible for purging.- Specified by:
getMaxCollaborationJobAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- The age in days at which a collaboration job becomes eligible for purging
- Since:
- 4.3.3
-
setMaxCollaborationJobAgeDays
public void setMaxCollaborationJobAgeDays(int maxCollaborationJobAgeDays) Set the age in days at which a collaboration job becomes eligible for purging.- Parameters:
maxCollaborationJobAgeDays
- the age in days at which a collaboration job becomes eligible for purging- Since:
- 4.3.3
-
getMaxErrorLogAgeDays
public int getMaxErrorLogAgeDays()Return the age in days at which an error log entry becomes eligible for purging.- Specified by:
getMaxErrorLogAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- the age in days at which an error log entry becomes eligible for purging
-
setMaxErrorLogAgeDays
public void setMaxErrorLogAgeDays(int maxErrorLogAgeDays) Set the age in days at which an error log entry becomes eligible for purging.- Parameters:
maxErrorLogAgeDays
- the age in days at which an error log entry becomes eligible for purging
-
getMaxEventLogAgeDays
public int getMaxEventLogAgeDays()Return the age in days at which an event log entry becomes eligible for purging.- Specified by:
getMaxEventLogAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- The age in days at which an event log entry becomes eligible for purging
-
setMaxEventLogAgeDays
public void setMaxEventLogAgeDays(int maxEventLogAgeDays) Set the age in days at which an event log entry becomes eligible for purging.- Parameters:
maxEventLogAgeDays
- the age in days at which an event log entry becomes eligible for purging
-
getMaxGroovyServiceLogAgeDays
public int getMaxGroovyServiceLogAgeDays()Return the age in days at which a groovy service log entry becomes eligible for purging.- Specified by:
getMaxGroovyServiceLogAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- The age in days at which a groovy service log entry becomes eligible for purging
- Since:
- 4.1.0
-
setMaxGroovyServiceLogAgeDays
public void setMaxGroovyServiceLogAgeDays(int maxGroovyServiceLogAgeDays) Set the age in days at which a groovy service log entry becomes eligible for purging.- Parameters:
maxGroovyServiceLogAgeDays
- the age in days at which a groovy service log entry becomes eligible for purging- Since:
- 4.1.0
-
setMaxOfflineSyncLogAgeDays
public void setMaxOfflineSyncLogAgeDays(int maxOfflineSyncLogAgeDays) Set the age in days at which a Field Worker sync log entry becomes eligible for purging.- Parameters:
maxOfflineSyncLogAgeDays
- the age in days at which a Field Worker sync log entry becomes eligible for purging
-
getMaxOfflineSyncLogAgeDays
public int getMaxOfflineSyncLogAgeDays()Return the age in days at which a Field Worker sync log entry becomes eligible for purging.- Specified by:
getMaxOfflineSyncLogAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- the age in days at which a Field Worker sync log entry becomes eligible for purging
-
getMaxScheduledJobHistoryAgeDays
public int getMaxScheduledJobHistoryAgeDays()Return the age in days at which a scheduled job history entry becomes eligible for purging.- Specified by:
getMaxScheduledJobHistoryAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- the age in days at which a scheduled job history entry becomes eligible for purging.
- Since:
- 4.3.0
-
setMaxScheduledJobHistoryAgeDays
public void setMaxScheduledJobHistoryAgeDays(int maxScheduledJobHistoryAgeDays) Return the age in days at which a scheduled job history entry becomes eligible for purging.- Parameters:
maxScheduledJobHistoryAgeDays
- the maximum age in days for scheduled job history entry- Since:
- 4.3.0
-
getMaxSecurityManagerLogAgeDays
public int getMaxSecurityManagerLogAgeDays()Return the age in days at which a security manager log entry becomes eligible for purging.- Specified by:
getMaxSecurityManagerLogAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- the age in days at which a security manager log entry becomes eligible for purging.
- Since:
- 5.1.0
-
setMaxSecurityManagerLogAgeDays
public void setMaxSecurityManagerLogAgeDays(int maxSecurityManagerLogAgeDays) Set the age in days at which a security manager log entry becomes eligible for purging.- Parameters:
maxSecurityManagerLogAgeDays
- the age in days at which a security manager log entry becomes eligible for purging.- Since:
- 5.1.0
-
getMaxServerHealthLogAgeDays
public int getMaxServerHealthLogAgeDays()Return the age in days at which a request log entry becomes eligible for purging.- Specified by:
getMaxServerHealthLogAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- the age in days at which a request log entry becomes eligible for purging
-
setMaxServerHealthLogAgeDays
public void setMaxServerHealthLogAgeDays(int maxServerHealthLogAgeDays) Set the age in days at which a server health log entry becomes eligible for purging.- Parameters:
maxServerHealthLogAgeDays
- the age in days at which a system health log entry becomes eligible for purging
-
getMaxSubmissionLogAgeDays
public int getMaxSubmissionLogAgeDays()Gets the max submission log age days.- Specified by:
getMaxSubmissionLogAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- the max submission log age days
-
setMaxSubmissionLogAgeDays
public void setMaxSubmissionLogAgeDays(int maxSubmissionLogAgeDays) Sets the max submission log age days.- Parameters:
maxSubmissionLogAgeDays
- the new max submission log age days
-
getMaxEmailQueueAgeDays
public int getMaxEmailQueueAgeDays()Returns the max email queue age days.- Specified by:
getMaxEmailQueueAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- the max email queue age days
-
setMaxEmailQueueAgeDays
public void setMaxEmailQueueAgeDays(int maxEmailQueueAgeDays) Sets the max email queue entry age in days.- Parameters:
maxEmailQueueAgeDays
- the new purge email queue days
-
setStorageExpiryDays
public void setStorageExpiryDays(int storageExpiryDays) This method does nothing and is provided for backward compatibility purposes.- Parameters:
storageExpiryDays
- the new storage expiry days
-
getMaxDeliveredSubmissionDataAgeDays
public int getMaxDeliveredSubmissionDataAgeDays()Gets the max delivered submission data age in days.- Specified by:
getMaxDeliveredSubmissionDataAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- the purge delivered submission days
-
setMaxDeliveredSubmissionDataAgeDays
public void setMaxDeliveredSubmissionDataAgeDays(int maxAge) Sets the max delivered submission data age in days.- Parameters:
maxAge
- the new purge delivered submission days
-
getMaxCollaborationJobAbandonAgeDays
public int getMaxCollaborationJobAbandonAgeDays()Return the age in days at which a collaboration job becomes eligible for Abandonment.- Specified by:
getMaxCollaborationJobAbandonAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- The age in days at which a collaboration job becomes eligible for Abandonment
- Since:
- 22.4.0
-
setMaxCollaborationJobAbandonAgeDays
public void setMaxCollaborationJobAbandonAgeDays(int maxCollaborationJobAbandonAgeDays) Set the age in days at which a collaboration job becomes eligible for Abandonment.- Parameters:
maxCollaborationJobAbandonAgeDays
- the age in days at which a collaboration job becomes eligible for Abandonment- Since:
- 22.4.0
-
getMaxSavedSubmissionAgeDays
public int getMaxSavedSubmissionAgeDays()Gets the max saved submission age days.- Specified by:
getMaxSavedSubmissionAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- the max saved submission age days
-
setMaxSavedSubmissionAgeDays
public void setMaxSavedSubmissionAgeDays(int maxSavedSubmissionAgeDays) Sets the max saved submission age days.- Parameters:
maxSavedSubmissionAgeDays
- the new max saved submission age days
-
getMaxImportLogAgeDays
public int getMaxImportLogAgeDays()Gets the max import log age days.- Specified by:
getMaxImportLogAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- the max import log age days
-
getMaxTransactionHistoryAgeDays
public int getMaxTransactionHistoryAgeDays()Description copied from interface:IDataRetentionManagementService
Return the maximum age of the transaction history in days.- Specified by:
getMaxTransactionHistoryAgeDays
in interfaceIDataRetentionManagementService
- Returns:
- the maxTransactionHistoryAgeDays
-
setMaxTransactionHistoryAgeDays
public void setMaxTransactionHistoryAgeDays(int maxTransactionHistoryAgeDays) - Parameters:
maxTransactionHistoryAgeDays
- the maxTransactionHistoryAgeDays to set
-
isEnforceGlobalThreshold
public boolean isEnforceGlobalThreshold()Description copied from interface:IDataRetentionManagementService
Return whether the service is configured to enforce global policies over organization and form level policies. If set, organizations and forms cannot specify retention times that are less restrictive (=longer) than the current global settings.- Specified by:
isEnforceGlobalThreshold
in interfaceIDataRetentionManagementService
- Returns:
- the enforceGlobalThreshold
-
getPiiSearchPurgeMode
- Specified by:
getPiiSearchPurgeMode
in interfaceIDataRetentionManagementService
- Returns:
- the piiSearchPurgeMode String
- Since:
- 18.11.0
-
setPiiSearchPurgeMode
Sets the piiSearchPurgeMode String.- Parameters:
piiSearchPurgeMode
- the PII Search Purge Mode String- Since:
- 18.11.0
-
setEnforceGlobalThreshold
public void setEnforceGlobalThreshold(boolean enforceGlobalThreshold) - Parameters:
enforceGlobalThreshold
- the enforceGlobalThreshold to set
-
setLogToEventLog
public void setLogToEventLog(boolean value) Specify whether to log the results of the data retention job to the event log.- Specified by:
setLogToEventLog
in interfaceIDataRetentionManagementService
- Parameters:
value
- to specify whether to log the results of the data retention job to the event log- Since:
- 4.3.3
-