[ 
https://issues.apache.org/jira/browse/LABS-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638780#action_12638780
 ] 

Thorsten Scherler commented on LABS-197:
----------------------------------------

public interface TaskValidator {
  public boolean validateTask( Task task ) throws InvalidTaskException;
} 

I wonder whether 
public boolean isValidTask( Task task ); 
is more  descriptive.

Regarding a "Validator may change the task so it is valid" not sure whether it 
should be the concern of a validator. IMO a validator only wants to change the 
status of the task to accepted/denied. 

However maybe we want to have both 
 public interface TaskValidator {
/**
* Validator may change the task so it is valid (perhaps normalize a URL or 
something) or throw an exception. 
**/
  public Task validateTask( Task task ) throws InvalidTaskException;
/**
* Validator only changes the status of the task to accepted (returning true) or 
denied (returning false). 
* It will not change any other properties beside the isAccepted state.
**/
  public boolean isValidTask( Task task ); 
} 

> Create TaskValidator -- include concepts like: maxDepth and maxSize
> -------------------------------------------------------------------
>
>                 Key: LABS-197
>                 URL: https://issues.apache.org/jira/browse/LABS-197
>             Project: Labs
>          Issue Type: Improvement
>          Components: Droids
>            Reporter: Ryan McKinley
>            Priority: Blocker
>         Attachments: LABS-197-taskValidator.patch
>
>
> The TaskQueue should have an expendable way to check if a Task is valid.
> perhaps something like:
> {code:java}
>  
> public interface TaskValidator {
>   public boolean validateTask( Task task ) throws InvalidTaskException;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to