com.epam.fix.validation.engine
Class ValidationEngine

java.lang.Object
  extended by com.epam.fix.validation.engine.ValidationEngine
All Implemented Interfaces:
IMessageValidator

public class ValidationEngine
extends Object
implements IMessageValidator

Validator provides functionality for validation FIX message using custom validators.

Author:
Serhiy_Zahriychuk Created on Sep 9, 2008

Constructor Summary
ValidationEngine(IValidatorContainer validators)
          Constructor Validator creates a new Validator instance.
ValidationEngine(IValidatorContainer validators, boolean isContentValidation)
          Constructor Validator creates a new Validator instance.
 
Method Summary
static void preloadDictionary(FIXVersionContainer fixVersionContainer, boolean replaceData)
          Pre-loads dictionaries from path uriToDictionary.
static void preloadDictionary(FIXVersion version, String uriToDictionary, boolean replaceData)
          Pre-loads dictionaries from path uriToDictionary.
static void preloadDictionary(FIXVersion version, String uriToDictionary, boolean isExternalResource, boolean replaceData)
          Deprecated. @see #preloadDictionary(FIXVersion version, String uriToDictionary, boolean replaceData)
static void preloadDictionary(String dictionaryID, FIXVersion version, String uriToDictionary, boolean replaceData)
          Pre-loads dictionaries from path uriToDictionary.
 void setContentValidation(boolean contentValidation)
          Enable/disable content validation.
 String toString()
           
 FIXErrorContainer validateFIXMessage(FIXFieldList message)
          Validates the fix message.
 FIXErrorContainer validateFIXMessage(String msgType, FIXFieldList message)
          Method validateFIXMessage validates the FIXMessage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidationEngine

public ValidationEngine(IValidatorContainer validators,
                        boolean isContentValidation)
Constructor Validator creates a new Validator instance.

Parameters:
validators - of type List
isContentValidation - Indicates that will be validation only content of FIXMessage.

ValidationEngine

public ValidationEngine(IValidatorContainer validators)
Constructor Validator creates a new Validator instance.

Parameters:
validators - of type List
Method Detail

validateFIXMessage

public FIXErrorContainer validateFIXMessage(FIXFieldList message)
Description copied from interface: IMessageValidator
Validates the fix message.

Specified by:
validateFIXMessage in interface IMessageValidator
Parameters:
message - the fix message
Returns:
returns the validation result

validateFIXMessage

public FIXErrorContainer validateFIXMessage(String msgType,
                                            FIXFieldList message)
Method validateFIXMessage validates the FIXMessage.

Specified by:
validateFIXMessage in interface IMessageValidator
Parameters:
msgType - of type String
message - of type FIXFieldList
Returns:
List of errors of validation , if validate is successful method returns empty list

preloadDictionary

public static void preloadDictionary(FIXVersionContainer fixVersionContainer,
                                     boolean replaceData)
Pre-loads dictionaries from path uriToDictionary. If uriToDictionary is empty or null.

Parameters:
fixVersionContainer - Version of FIX dictionary.
replaceData - If true 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 path uriToDictionary. If uriToDictionary 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 - If true 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 path uriToDictionary. If uriToDictionary is empty or null.

Parameters:
dictionaryID - Unique ID of dictionary
version - Version of FIX dictionary.
uriToDictionary - Path to the dictionary. If path empty or null system loads dictionary from the class path.
replaceData - If true 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. @see #preloadDictionary(FIXVersion version, String uriToDictionary, boolean replaceData)

Pre-loads dictionaries from path uriToDictionary. If uriToDictionary 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 flag
replaceData - If true 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.

setContentValidation

public void setContentValidation(boolean contentValidation)
Enable/disable content validation.

Specified by:
setContentValidation in interface IMessageValidator
Parameters:
contentValidation -

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.