Caplin Trader 5.1.0

Class: module:ct-trading/validation/TradingSystemAvailableValidator


Determines whether the trading system that will be used by a particular trade is down or not, and if so fails the validation for the transition. This provides fast failure feedback within GUIs that do not listen to the trading system status explicitly, and also provides a safety net for those GUIs that do listen to the status but the user has just managed to click to trade before the GUI updated.


new module:ct-trading/validation/TradingSystemAvailableValidator()

Constructs a new TradingSystemAvailableValidator.




(static) validate(data, result)

Extracts the module:ct-trading/trademodel/Trade from the __trade field within the specified data to validate. If the trading status for the Trade is module:ct-trading/trademodel/TradingStatus#UNAVAILABLE, a message will be logged and an error added to the specified ValidationResult.

Name Type Description
data module:ct-trading/trademodel/DataHolder

The data to validate. Must not be null or undefined.

result module:ct-trading/validation/ValidationResult

The module:ct-trading/validation/ValidationResult which a failure message will be added to. Must not be null or undefined.

validate(oDataToValidate, oValidationResult)

Performs the validation on oDataToValidate according to rules in the class that implements the interface and appends information about errors found to oValidationResult.

Name Type Description
oDataToValidate module:ct-trading/trademodel/DataHolder

The data to validate. Must not be null or undefined.

oValidationResult module:ct-trading/validation/ValidationResult

A module:ct-trading/validation/ValidationResult to which information about validations is added. Must not be null or undefined.

Inherited From:

if there is something wrong with the data to validate or some other exception occurs during validation.