Class DataRetentionUtils


  • public class DataRetentionUtils
    extends Object
    Provides utility methods for calculating data retention policies.
    Since:
    4.1.0
    • Constructor Detail

      • DataRetentionUtils

        public DataRetentionUtils()
    • Method Detail

      • getSubmissionRetentionThresholds

        public static SubmissionRetentionSettings getSubmissionRetentionThresholds​(Form form)
        Calculate the upper limits that apply to data retention policies for the given form. The limits apply only if the system IDataRetentionManagementService is configured to enforce global thresholds. If so, the form's policies cannot be more lenient (=keep data for longer) than the organization and system policies.
        Parameters:
        form - the form (required)
        Returns:
        the submission retention thresholds applying to the form. If a specific setting is not constrained, the value in the result object will be null.
      • getSubmissionRetentionThresholds

        public static SubmissionRetentionSettings getSubmissionRetentionThresholds​(Client client)
        Calculate the upper limits that apply to data retention policies for the given client. The limits apply only if the system IDataRetentionManagementService is configured to enforce global thresholds. If so, the client's policies cannot be more lenient (=keep data for longer) than the system policies.
        Parameters:
        client - the client (required)
        Returns:
        the submission retention thresholds applying to the client. If a specific setting is not constrained, the value in the result object will be null.
      • getSubmissionRetentionDefaults

        public static SubmissionRetentionSettings getSubmissionRetentionDefaults​(Form form)
        Calculate the global/organization default values that apply to data retention policies for the given form.
        Parameters:
        form - the form (required)
        Returns:
        the submission retention defaults for the form. All settings in the result should be set to values >= 0.
      • getSubmissionRetentionDefaults

        public static SubmissionRetentionSettings getSubmissionRetentionDefaults​(Client client)
        Calculate the global/organization default values that apply to data retention policies for the given client.
        Parameters:
        client - the client (required)
        Returns:
        the submission retention defaults for the client. All settings in the result should be set to values >= 0.
      • getRetentionPolicyRange

        public static Map<String,​Integer> getRetentionPolicyRange​(String retentionParameterName,
                                                                        Client client,
                                                                        Form form)
        Return the possible range in days for a data retention parameter, as well as (on client and form levels) information on the inherited value. If a client or form is passed in, the range is modified to take into account enforcement of thresholds from parent levels. For example, if the range for a parameter is 1-90 and the current system setting is 20, and this method is called with a client, the range returned will be 1-20 if thresholds are being enforced, or 1-90 if thresholds are not being enforced for this system. Note: Not all data retention parameters are accepted, see below.
        Parameters:
        retentionParameterName - required, must be one of IDataRetentionManagementService.PARAM_MAX_COLLABORATION_JOB_AGE_DAYS, IDataRetentionManagementService.PARAM_MAX_DELIVERED_SUBMISSION_DATA_AGE_DAYS, IDataRetentionManagementService.PARAM_MAX_SAVED_SUBMISSION_AGE_DAYS and IDataRetentionManagementService.PARAM_MAX_SUBMISSION_LOG_AGE_DAYS
        client - the organization to retrieve settings for (required if the range will be applied on the organization level)
        form - the form to retrieve settings for (required if the range will be applied on the form level)
        Returns:
        the valid range for the requested data retention parameter map keys: min: the lower bound (always set) max: the upper bound (always set) systemValue: the value of the parameter on the system level (set for clients, as well as for forms where the client does not specify a value) clientValue: the value of the parameter on the system level (set for forms, where the parameter is specified on the client level)
        Since:
        4.3.3