Package com.epam.fix.validation.engine
Class ValidationEngine
java.lang.Object
com.epam.fix.validation.engine.ValidationEngine
- All Implemented Interfaces:
IMessageValidator
Validator provides functionality for validation FIX message using custom
validators.
- Author:
- Serhiy_Zahriychuk Created on Sep 9, 2008
-
Constructor Summary
ConstructorsConstructorDescriptionValidationEngine
(IValidatorContainer validators) Constructor Validator creates a new Validator instance.ValidationEngine
(IValidatorContainer validators, boolean isContentValidation) Constructor Validator creates a new Validator instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
preloadDictionary
(FIXVersion version, String uriToDictionary, boolean replaceData) Pre-loads dictionaries from pathuriToDictionary
.static void
preloadDictionary
(FIXVersion version, String uriToDictionary, boolean isExternalResource, boolean replaceData) Deprecated.static void
preloadDictionary
(com.epam.fixengine.configuration.FIXVersionContainer fixVersionContainer, boolean replaceData) Pre-loads dictionaries from pathuriToDictionary
.static void
preloadDictionary
(String dictionaryID, FIXVersion version, String uriToDictionary, boolean replaceData) Pre-loads dictionaries from pathuriToDictionary
.void
setContentValidation
(boolean contentValidation) Enable/disable content validation.toString()
validateFIXMessage
(FIXFieldList message) Validates the fix message.validateFIXMessage
(String msgType, FIXFieldList message) Method validateFIXMessage validates the FIXMessage.
-
Constructor Details
-
ValidationEngine
Constructor Validator creates a new Validator instance.- Parameters:
validators
- of type ListisContentValidation
- Indicates that will be validation only content of FIXMessage.
-
ValidationEngine
Constructor Validator creates a new Validator instance.- Parameters:
validators
- of type List
-
-
Method Details
-
validateFIXMessage
Description copied from interface:IMessageValidator
Validates the fix message.- Specified by:
validateFIXMessage
in interfaceIMessageValidator
- Parameters:
message
- the fix message- Returns:
- returns the validation result
-
validateFIXMessage
Method validateFIXMessage validates the FIXMessage.- Specified by:
validateFIXMessage
in interfaceIMessageValidator
- Parameters:
msgType
- of type Stringmessage
- of type FIXFieldList- Returns:
- List of errors of validation , if validate is successful method returns empty list
-
preloadDictionary
public static void preloadDictionary(com.epam.fixengine.configuration.FIXVersionContainer fixVersionContainer, boolean replaceData) Pre-loads dictionaries from pathuriToDictionary
. IfuriToDictionary
is empty or null.- Parameters:
fixVersionContainer
- Version of FIX dictionary.replaceData
- Iftrue
systems replace the old dictionary(if old dictionary is null system create new dictionary with input elements.)
-
preloadDictionary
public static void preloadDictionary(FIXVersion version, String uriToDictionary, boolean replaceData) Pre-loads dictionaries from pathuriToDictionary
. IfuriToDictionary
is empty or null.- Parameters:
version
- Version of FIX dictionary.uriToDictionary
- Path to the dictionary. If path empty or null system loads dictionary from the class path.replaceData
- Iftrue
systems replace the old dictionary(if old dictionary is null system create new dictionary with input elements.) In other way system adds input elements or replace if found the differences in the same elements.
-
preloadDictionary
public static void preloadDictionary(String dictionaryID, FIXVersion version, String uriToDictionary, boolean replaceData) Pre-loads dictionaries from pathuriToDictionary
. IfuriToDictionary
is empty or null.- Parameters:
dictionaryID
- Unique ID of dictionaryversion
- Version of FIX dictionary.uriToDictionary
- Path to the dictionary. If path empty or null system loads dictionary from the class path.replaceData
- Iftrue
systems replace the old dictionary(if old dictionary is null system create new dictionary with input elements.) In other way system adds input elements or replace if found the differences in the same elements.
-
preloadDictionary
@Deprecated public static void preloadDictionary(FIXVersion version, String uriToDictionary, boolean isExternalResource, boolean replaceData) Deprecated.Pre-loads dictionaries from pathuriToDictionary
. IfuriToDictionary
is empty or null.- Parameters:
version
- Version of FIX dictionary.uriToDictionary
- Path to the dictionary. If path empty or null system loads dictionary from the class path.isExternalResource
- the flagreplaceData
- Iftrue
systems replace the old dictionary(if old dictionary is null system create new dictionary with input elements.) In other way system adds input elements or replace if found the differences in the same elements. NOTE: isExternalResource parameters is not used eny more. By default path is interpreted as external. To define classpath resource need to add "classpath:" prefix.- See Also:
-
setContentValidation
public void setContentValidation(boolean contentValidation) Enable/disable content validation.- Specified by:
setContentValidation
in interfaceIMessageValidator
- Parameters:
contentValidation
-
-
toString
-