Package gov.nasa.pds.tools.validate.task
Class ValidationTask
java.lang.Object
gov.nasa.pds.tools.validate.task.ValidationTask
- All Implemented Interfaces:
Task
public class ValidationTask extends Object implements Task
Implements a background task for performing a validation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface gov.nasa.pds.tools.validate.task.Task
Task.Status
-
Constructor Summary
Constructors Constructor Description ValidationTask(ProblemListener problemListener, RuleContext context, TargetRegistrar targetRegistrar)
Creates a new instance of the validation task. -
Method Summary
Modifier and Type Method Description void
execute(TaskAdvisor advisor)
Executes the task with a given advisor to detect cancel requests.List<TargetWithErrors>
getAllTargets()
int
getErrorCount()
Gets the count of errors encountered.int
getErrorLimit()
Gets the limit on the number of errors found.int
getInfoCount()
Gets the count of informational events encountered.String
getLocation()
Gets the location of the target to validate.ProblemListener
getProblemListener()
Gets the problem listener for getting problems found.TargetRegistrar
getRegistrar()
Gets the registrar for getting target information.String
getValidationType()
Gets the type of validation.int
getWarningCount()
Gets the count of warnings encountered.void
setErrorLimit(int limit)
Sets the limit on the number of errors encountered before the validation will terminate.void
setLocation(String location)
Sets the location to validate.void
setRule(ValidationRule rule)
Sets the validation rule to use.void
setRuleManager(ValidationRuleManager ruleManager)
Sets the validation rule manager to use for finding validation rules.
-
Constructor Details
-
ValidationTask
public ValidationTask(ProblemListener problemListener, RuleContext context, TargetRegistrar targetRegistrar)Creates a new instance of the validation task.- Parameters:
listener
- the problem listener for the task
-
-
Method Details
-
getLocation
Gets the location of the target to validate.- Returns:
- the target location
-
setLocation
Sets the location to validate.- Parameters:
location
- the location to validate
-
getErrorLimit
public int getErrorLimit()Gets the limit on the number of errors found.- Returns:
- the error limit
-
setErrorLimit
public void setErrorLimit(int limit)Sets the limit on the number of errors encountered before the validation will terminate.- Parameters:
limit
- the error limit
-
getValidationType
Gets the type of validation.- Returns:
- the validation type
-
setRule
Sets the validation rule to use.- Parameters:
rule
- the validation rule
-
execute
Description copied from interface:Task
Executes the task with a given advisor to detect cancel requests. -
getErrorCount
public int getErrorCount()Gets the count of errors encountered.- Returns:
- the error count
-
getWarningCount
public int getWarningCount()Gets the count of warnings encountered.- Returns:
- the warning count
-
getInfoCount
public int getInfoCount()Gets the count of informational events encountered.- Returns:
- the count of info messages
-
setRuleManager
Sets the validation rule manager to use for finding validation rules.- Parameters:
ruleManager
- the rule manager to use
-
getRegistrar
Gets the registrar for getting target information.- Returns:
- the target registrar
-
getProblemListener
Gets the problem listener for getting problems found.- Returns:
- the problem listener
-
getAllTargets
-