Package org.opends.server.tools.dsbackup
Class PurgeArgumentsValidator
java.lang.Object
org.opends.server.tools.dsbackup.PurgeArgumentsValidator
Utility class to check arguments validity and conflicts for the purge command or task.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbackendNames
(com.forgerock.opendj.cli.StringArgument backendNames) Sets the list of the backend names to purge as aStringArgument
.backendNames
(Entry entry, String attributeBackendNames) Sets the list of backend names to purge.backupIds
(com.forgerock.opendj.cli.StringArgument backupIds) Sets the list of backup IDs as aStringArgument
.Sets the list of backup IDs.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.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.keepCount
(com.forgerock.opendj.cli.IntegerArgument keepCount) Sets the "keep count" as aIntegerArgument
.Sets the keep count.olderThan
(com.forgerock.opendj.cli.DurationArgument olderThan) Sets the "remove older than" as aDurationArgument
.Sets the "remove older than".void
validate()
Checks all arguments are valid and not conflicting each others.
-
Constructor Details
-
PurgeArgumentsValidator
public PurgeArgumentsValidator()
-
-
Method Details
-
backendNames
Sets the list of the backend names to purge as aStringArgument
.- Parameters:
backendNames
- The list of the backend names to purge.- Returns:
- A reference to this validator.
-
backendNames
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
Sets the list of backup IDs as aStringArgument
.- Parameters:
backupIds
- The list of backup IDs of a purge.- Returns:
- A reference to this validator.
-
backupIds
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
Sets the "keep count" as aIntegerArgument
.- Parameters:
keepCount
- The purge tool "keep count" argument.- Returns:
- A reference to this validator.
-
keepCount
Sets the keep count.- Parameters:
entry
- The entry which has an attributeConfigConstants.ATTR_TASK_PURGE_KEEP_COUNT
.attributeDescription
- The attribute description of the attribute which holds the keep count value.- Returns:
- A reference to this validator.
-
olderThan
Sets the "remove older than" as aDurationArgument
.- Parameters:
olderThan
- The purge tool "remove older than" argument.- Returns:
- A reference to this validator.
-
olderThan
Sets the "remove older than".- Parameters:
entry
- The entry which has an attributeConfigConstants.ATTR_TASK_PURGE_OLDER_THAN
.attributeDescription
- The attribute description of the attribute which holds the "remove older than" value.- 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
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 attributeConfigConstants.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.ArgumentExceptionChecks 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
-