Package org.marketcetera.util.quickfix
Class SpringSessionDescriptor
- java.lang.Object
-
- org.marketcetera.util.spring.LazyBean
-
- org.marketcetera.util.quickfix.SpringSessionDescriptor
-
public class SpringSessionDescriptor extends LazyBean
A Spring-aware QuickFIX/J session descriptor. It also offers these extensions:The descriptor may be associated with overall session settings
SpringSessionSettings, which contain default session parameter values used by the descriptor when its own dictionary does not override them.The descriptor's data dictionary parameter can be set to
DEFAULT_DATA_DICTIONARY, in which case validation will take place using the default data dictionary appropriate for the FIX version implied by the descriptor's begin string.
- Since:
- 1.0.0
- Version:
- $Id: SpringSessionDescriptor.java 17411 2017-04-28 14:50:38Z colin $
- Author:
- tlerios@marketcetera.com
-
-
Field Summary
Fields Modifier and Type Field Description private static Map<String,String>DATA_DICTIONARY_MAPThe map of begin strings to default data dictionaries.static StringDEFAULT_DATA_DICTIONARYThe sentinel value for the data dictionary parameter which forces validation using the default data dictionary appropriate for the FIX version implied by the descriptor's begin string.private Map<String,String>mDictionaryprivate quickfix.DictionarymQDictionaryprivate quickfix.SessionIDmQSessionIDprivate SpringSessionSettingsmSettings
-
Constructor Summary
Constructors Constructor Description SpringSessionDescriptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidassertValueSet(String key, String value)Asserts that the given key has a non-null value in the receiver's dictionary.Map<String,String>getDictionary()Returns the receiver's dictionary.private StringgetKeyValue(String key)Returns the value in the receiver's dictionary for the given key.quickfix.DictionarygetQDictionary()Returns the receiver's QuickFIX/J dictionary.quickfix.SessionIDgetQSessionID()Returns the receiver's QuickFIX/J session ID.SpringSessionSettingsgetSettings()Returns the receiver's session settings.protected voidprocess()Processes the receiver.voidsetDictionary(Map<String,String> dictionary)Sets the receiver's dictionary to the given one.voidsetSettings(SpringSessionSettings settings)Sets the receiver's session settings to the given ones.-
Methods inherited from class org.marketcetera.util.spring.LazyBean
assertNotProcessed, ensureProcessed, forceProcess
-
-
-
-
Field Detail
-
DEFAULT_DATA_DICTIONARY
public static final String DEFAULT_DATA_DICTIONARY
The sentinel value for the data dictionary parameter which forces validation using the default data dictionary appropriate for the FIX version implied by the descriptor's begin string.- See Also:
- Constant Field Values
-
DATA_DICTIONARY_MAP
private static final Map<String,String> DATA_DICTIONARY_MAP
The map of begin strings to default data dictionaries.
-
mSettings
private SpringSessionSettings mSettings
-
mQDictionary
private quickfix.Dictionary mQDictionary
-
mQSessionID
private quickfix.SessionID mQSessionID
-
-
Method Detail
-
setDictionary
public void setDictionary(Map<String,String> dictionary)
Sets the receiver's dictionary to the given one. This dictionary is a key-value map of QuickFIX/J session parameters; it is not the data dictionary.- Parameters:
dictionary- The dictionary. It may be null.
-
getDictionary
public Map<String,String> getDictionary()
Returns the receiver's dictionary. This dictionary is a key-value map of QuickFIX/J session parameters; it is not the data dictionary.- Returns:
- The dictionary. It may be null.
-
setSettings
public void setSettings(SpringSessionSettings settings)
Sets the receiver's session settings to the given ones.- Parameters:
settings- The settings. It may be null.
-
getSettings
public SpringSessionSettings getSettings()
Returns the receiver's session settings.- Returns:
- The settings. It may be null.
-
getQDictionary
public quickfix.Dictionary getQDictionary()
Returns the receiver's QuickFIX/J dictionary.- Returns:
- The dictionary.
-
getQSessionID
public quickfix.SessionID getQSessionID()
Returns the receiver's QuickFIX/J session ID.- Returns:
- The ID.
-
getKeyValue
private String getKeyValue(String key)
Returns the value in the receiver's dictionary for the given key. If the dictionary has no value, and the receiver has valid session settings, the value stored within those settings is returned.- Parameters:
key- The key.- Returns:
- The value. It may be null.
-
assertValueSet
private void assertValueSet(String key, String value) throws I18NRuntimeException
Asserts that the given key has a non-null value in the receiver's dictionary.- Parameters:
key- The key.value- The value.- Throws:
I18NRuntimeException- Thrown if the assertion is false.
-
process
protected void process()
Description copied from class:LazyBeanProcesses the receiver. This method will only be called once throughLazyBean.ensureProcessed().
-
-