Class ProtocolCleaner


  • public class ProtocolCleaner
    extends Object
    Deletes protocol entries for clients
    Author:
    XIMA MEDIA GmbH
    • Field Detail

      • DEFAULT_OLDER_THAN_DAYS

        public static final int DEFAULT_OLDER_THAN_DAYS
        See Also:
        Constant Field Values
    • Method Detail

      • getClient

        public Mandant getClient()
        Returns:
        Mandant for which protocol entries should be deleted
      • withClient

        public ProtocolCleaner withClient​(Mandant client)
        Sets the client for which protocol entries should be deleted
        Parameters:
        client - Mandant for which protocol entries should be deleted
        Returns:
        ProtocolCleaner for chaining.
      • getOlderThanDate

        public Date getOlderThanDate()
        Returns:
        Date cut off date. Only protocol entries older than this date will be deleted
      • withOlderThanDate

        public ProtocolCleaner withOlderThanDate​(Date olderThanDate)
        Sets the cut off date. Only protocol entries older than this date will be deleted
        Parameters:
        olderThanDate - Date cut off date
        Returns:
        ProtocolCleaner for chaining.
      • getOlderThanDuration

        public Duration getOlderThanDuration()
        Returns:
        Duration cut off duration. Only protocol entries older than this duration will be deleted
      • withOlderThanDuration

        public ProtocolCleaner withOlderThanDuration​(Duration olderThanDuration)
        Sets the cut off duration. Only protocol entries older than this duration will be deleted
        Parameters:
        olderThanDuration - Duration cut off duration
        Returns:
        ProtocolCleaner for chaining.
      • withOlderThanDays

        public ProtocolCleaner withOlderThanDays​(long days)
        Sets the cut off duration. Only protocol entries older than this duration will be deleted
        Parameters:
        days - Long number of days
        Returns:
        ProtocolCleaner for chaining.
      • keepFormRecordHistory

        public ProtocolCleaner keepFormRecordHistory​(boolean keepFormRecordHistory)
        Sets whether process protocol entries should be preserved (not deleted) when there are still form records in the inbox that reference these protocol entries.
        Parameters:
        keepFormRecordHistory - true to keep protocol entries of existing form records, false to delete them anyway.
        Returns:
        ProtocolCleaner for chaining.
      • withOlderThanDaysAndHours

        public ProtocolCleaner withOlderThanDaysAndHours​(long days,
                                                         long hours)
        Sets the cut off duration. Only protocol entries older than this duration will be deleted
        Parameters:
        days - Long number of days
        hours - Long number of hours
        Returns:
        ProtocolCleaner
      • execute

        public int execute​(IEntityContext ec)
        Deletes all protocol entries for the set configuration
        Parameters:
        ec - IEntityContext contains the user that is executing the task
        Returns:
        the number of protocol entries that have bee deleted