org.keridwen.core.messaging
Interface Condition

All Known Implementing Classes:
DefaultCondition

public interface Condition

A Condition encapsulates one condition of validity of a data packet. The Condition also stores a list of the Commands that can validate it.


Method Summary
 void addConditionListener(ConditionListener listener)
          Adds a ConditionListener to the Condition.
 Collection<Class<? extends Command<?,?>>> getValidationCommands()
          Gets the list of Commands that validate the Condition.
 boolean isValid()
          Indicates if the Condition is fulfilled or not.
 void registerValidationCommand(Class<? extends Command<?,?>> command)
          Registers a Command that validates the Condition.
 void removeConditionListener(ConditionListener listener)
          Removes the given ConditionListener that observes the Condition.
 void setValid(boolean validity)
          Sets the Condition validity.
 void unregisterValidationCommand(Class<? extends Command<?,?>> command)
          Unregisters the given Command from the list of Commands able to validate the Condition.
 

Method Detail

addConditionListener

void addConditionListener(ConditionListener listener)
Adds a ConditionListener to the Condition.

Parameters:
listener - the ConditionListener to add.

getValidationCommands

Collection<Class<? extends Command<?,?>>> getValidationCommands()
Gets the list of Commands that validate the Condition.

Returns:
the list of Commands that validate the Condition.

isValid

boolean isValid()
Indicates if the Condition is fulfilled or not.

Returns:
true if the Condition is fulfilled

registerValidationCommand

void registerValidationCommand(Class<? extends Command<?,?>> command)
Registers a Command that validates the Condition.

Parameters:
command - a Command that validates the Condition

removeConditionListener

void removeConditionListener(ConditionListener listener)
Removes the given ConditionListener that observes the Condition.

Parameters:
listener - the ConditionListener to remove

setValid

void setValid(boolean validity)
Sets the Condition validity.

Parameters:
validity - the validity to set

unregisterValidationCommand

void unregisterValidationCommand(Class<? extends Command<?,?>> command)
Unregisters the given Command from the list of Commands able to validate the Condition.

Parameters:
command - the Command to unregister


Copyright © 2010-2013 Artenum. All Rights Reserved.