org.sandev.basics.util
Class ConfirmationValidator

java.lang.Object
  extended byorg.sandev.basics.util.ConfirmationValidator
All Implemented Interfaces:
MessageValidator

public class ConfirmationValidator
extends java.lang.Object
implements MessageValidator

The ConfirmationValidator implements the MessageValidator interface by simply confirming everything is what it looks like. So all possible errors are confirmed as errors, and all reasonable input is confirmed as reasonable input. Essentially it is a no-op validator. This is useful as a default for simple tests that do not require any real analysis of results beyond the match specification.


Field Summary
 
Fields inherited from interface org.sandev.basics.util.MessageValidator
INVALID, UNKNOWN, VALID
 
Constructor Summary
ConfirmationValidator()
           
 
Method Summary
 int asynchError(SandMessage msg, MessageDriverNode driver)
          The given message may be an error according to the match specification.
 int asynchExpected(SandMessage msg, MessageDriverNode driver)
          The given message may be correct input according to the match specification.
 int queryResult(SandMessage sent, SandMessage received, MessageDriverNode driver)
          Confirm the status of this response to the given query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfirmationValidator

public ConfirmationValidator()
Method Detail

asynchError

public int asynchError(SandMessage msg,
                       MessageDriverNode driver)
Description copied from interface: MessageValidator
The given message may be an error according to the match specification. Confirm what the status is, using the reference to the MessageDriver for logging and other purposes.

Specified by:
asynchError in interface MessageValidator

asynchExpected

public int asynchExpected(SandMessage msg,
                          MessageDriverNode driver)
Description copied from interface: MessageValidator
The given message may be correct input according to the match specification. Confirm what the status is, using the reference to the MessageDriver for logging and other purposes.

Specified by:
asynchExpected in interface MessageValidator

queryResult

public int queryResult(SandMessage sent,
                       SandMessage received,
                       MessageDriverNode driver)
Description copied from interface: MessageValidator
Confirm the status of this response to the given query. Use the reference to the MessageDriver for logging and other purposes.

Specified by:
queryResult in interface MessageValidator