Class PurgeArgumentsValidator


  • public final class PurgeArgumentsValidator
    extends Object
    Utility class to check arguments validity and conflicts for the purge command or task.
    • Constructor Detail

      • PurgeArgumentsValidator

        public PurgeArgumentsValidator()
    • Method Detail

      • backendNames

        public PurgeArgumentsValidator backendNames​(com.forgerock.opendj.cli.StringArgument backendNames)
        Sets the list of the backend names to purge as a StringArgument.
        Parameters:
        backendNames - The list of the backend names to purge.
        Returns:
        A reference to this validator.
      • backendNames

        public PurgeArgumentsValidator backendNames​(Entry entry,
                                                    String attributeBackendNames)
        Sets the list of backend names to purge.
        Parameters:
        entry - The entry which has an attribute with a list of the backend names.
        attributeBackendNames - The attribute description of the attribute which holds the list of the backend names to purge.
        Returns:
        A reference to this validator.
      • backupIds

        public PurgeArgumentsValidator backupIds​(com.forgerock.opendj.cli.StringArgument backupIds)
        Sets the list of backup IDs as a StringArgument.
        Parameters:
        backupIds - The list of backup IDs of a purge.
        Returns:
        A reference to this validator.
      • backupIds

        public PurgeArgumentsValidator backupIds​(Entry entry,
                                                 String attributeDescription)
        Sets the list of backup IDs.
        Parameters:
        entry - The entry which has an attribute with a list of backup IDs.
        attributeDescription - The attribute description of the attribute which holds the value of the list of backup IDs.
        Returns:
        A reference to this validator.
      • keepCount

        public PurgeArgumentsValidator keepCount​(com.forgerock.opendj.cli.IntegerArgument keepCount)
        Sets the "keep count" as a IntegerArgument.
        Parameters:
        keepCount - The purge tool "keep count" argument.
        Returns:
        A reference to this validator.
      • olderThan

        public PurgeArgumentsValidator olderThan​(com.forgerock.opendj.cli.DurationArgument olderThan)
        Sets the "remove older than" as a DurationArgument.
        Parameters:
        olderThan - The purge tool "remove older than" argument.
        Returns:
        A reference to this validator.
      • forceOlderThan

        public PurgeArgumentsValidator forceOlderThan​(com.forgerock.opendj.cli.BooleanArgument forceOlderThan)
        Indicates whether "older than" must or not purge all the backups even the latest ones if they are older than the specified threshold.
        Parameters:
        forceOlderThan - The purge tool "force" argument.
        Returns:
        A reference to this validator.
      • forceOlderThan

        public PurgeArgumentsValidator forceOlderThan​(Entry entry,
                                                      String attributeDescription)
        Indicates whether "older than" must or not purge all the backups even the latest ones if they are older than the specified threshold.
        Parameters:
        entry - The entry which has an attribute ConfigConstants.ATTR_TASK_PURGE_FORCE_OLDER_THAN.
        attributeDescription - The attribute description of the attribute which holds the "remove older than" value.
        Returns:
        A reference to this validator.
      • validate

        public void validate()
                      throws com.forgerock.opendj.cli.ArgumentException
        Checks all arguments are valid and not conflicting each others.
        Throws:
        com.forgerock.opendj.cli.ArgumentException - whenever the arguments for the purge were not valid or conflicting each others