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 voidexecute(TaskAdvisor advisor)Executes the task with a given advisor to detect cancel requests.List<TargetWithErrors>getAllTargets()intgetErrorCount()Gets the count of errors encountered.intgetErrorLimit()Gets the limit on the number of errors found.intgetInfoCount()Gets the count of informational events encountered.StringgetLocation()Gets the location of the target to validate.ProblemListenergetProblemListener()Gets the problem listener for getting problems found.TargetRegistrargetRegistrar()Gets the registrar for getting target information.StringgetValidationType()Gets the type of validation.intgetWarningCount()Gets the count of warnings encountered.voidsetErrorLimit(int limit)Sets the limit on the number of errors encountered before the validation will terminate.voidsetLocation(String location)Sets the location to validate.voidsetRule(ValidationRule rule)Sets the validation rule to use.voidsetRuleManager(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:TaskExecutes 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
-