Class 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 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.
      • mQDictionary

        private quickfix.Dictionary mQDictionary
      • mQSessionID

        private quickfix.SessionID mQSessionID
    • Constructor Detail

      • SpringSessionDescriptor

        public SpringSessionDescriptor()
    • 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.