Package org.opends.server.tools.dsbackup
Class PurgeArgumentsValidator
- java.lang.Object
-
- org.opends.server.tools.dsbackup.PurgeArgumentsValidator
-
public final class PurgeArgumentsValidator extends Object
Utility class to check arguments validity and conflicts for the purge command or task.
-
-
Constructor Summary
Constructors Constructor Description PurgeArgumentsValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PurgeArgumentsValidator
backendNames(com.forgerock.opendj.cli.StringArgument backendNames)
Sets the list of the backend names to purge as aStringArgument
.PurgeArgumentsValidator
backendNames(Entry entry, String attributeBackendNames)
Sets the list of backend names to purge.PurgeArgumentsValidator
backupIds(com.forgerock.opendj.cli.StringArgument backupIds)
Sets the list of backup IDs as aStringArgument
.PurgeArgumentsValidator
backupIds(Entry entry, String attributeDescription)
Sets the list of backup IDs.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.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.PurgeArgumentsValidator
keepCount(com.forgerock.opendj.cli.IntegerArgument keepCount)
Sets the "keep count" as aIntegerArgument
.PurgeArgumentsValidator
keepCount(Entry entry, String attributeDescription)
Sets the keep count.PurgeArgumentsValidator
olderThan(com.forgerock.opendj.cli.DurationArgument olderThan)
Sets the "remove older than" as aDurationArgument
.PurgeArgumentsValidator
olderThan(Entry entry, String attributeDescription)
Sets the "remove older than".void
validate()
Checks all arguments are valid and not conflicting each others.
-
-
-
Method Detail
-
backendNames
public PurgeArgumentsValidator backendNames(com.forgerock.opendj.cli.StringArgument 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
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 aStringArgument
.- 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 aIntegerArgument
.- Parameters:
keepCount
- The purge tool "keep count" argument.- Returns:
- A reference to this validator.
-
keepCount
public PurgeArgumentsValidator keepCount(Entry entry, String attributeDescription)
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
public PurgeArgumentsValidator olderThan(com.forgerock.opendj.cli.DurationArgument olderThan)
Sets the "remove older than" as aDurationArgument
.- Parameters:
olderThan
- The purge tool "remove older than" argument.- Returns:
- A reference to this validator.
-
olderThan
public PurgeArgumentsValidator olderThan(Entry entry, String attributeDescription)
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
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 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.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
-
-