Class Session


  • public class Session
    extends Object
    Session is main class for CME STP connection.
    • Constructor Detail

      • Session

        public Session​(URL url,
                       String senderCompID,
                       String senderSubID,
                       String password)
                throws LicenseException
        Session constructor. Polling interval = 3 sec. SSL Protocol = TLS 1.2
        Parameters:
        url - Uri of CME server.
        senderCompID - Assigned value used to identify customer firm sending message.
        senderSubID - The user ID assigned to the sender must be provided in all uppercase letters.
        password - CME assigned password.
        Throws:
        LicenseException - when the License is missing or overdue
      • Session

        public Session​(URL url,
                       String senderCompID,
                       String senderSubID,
                       String password,
                       int pollingInterval)
                throws LicenseException
        Session constructor. SSL Protocol = TLS 1.2
        Parameters:
        url - Uri of CME server.
        senderCompID - Assigned value used to identify customer firm sending message.
        senderSubID - The user ID assigned to the sender must be provided in all uppercase letters.
        password - CME assigned password.
        pollingInterval - Interval in milliseconds between normal subscription polls. Failed polls retry after at least three seconds.
        Throws:
        LicenseException - when the License is missing or overdue
      • Session

        public Session​(URL url,
                       String senderCompID,
                       String senderSubID,
                       String password,
                       String sslProtocol)
                throws LicenseException
        Session constructor. Polling interval = 3 sec.
        Parameters:
        url - Uri of CME server.
        senderCompID - Assigned value used to identify customer firm sending message.
        senderSubID - The user ID assigned to the sender must be provided in all uppercase letters.
        password - CME assigned password.
        sslProtocol - SSL Protocol. Values like 'TLSv1.1' or 'TLSv1.2' can be used. Please see protocol names at SSLContext Algorithms.
        Throws:
        LicenseException - when the License is missing or overdue
      • Session

        public Session​(URL url,
                       String senderCompID,
                       String senderSubID,
                       String password,
                       int pollingInterval,
                       String sslProtocol)
                throws LicenseException
        Session constructor.
        Parameters:
        url - Uri of CME server.
        senderCompID - Assigned value used to identify customer firm sending message.
        senderSubID - The user ID assigned to the sender must be provided in all uppercase letters.
        password - CME assigned password.
        pollingInterval - Interval in milliseconds between normal subscription polls. Failed polls retry after at least three seconds.
        sslProtocol - SSL Protocol. Values like 'TLSv1.1' or 'TLSv1.2' can be used. Please see protocol names at SSLContext Algorithms.
        Throws:
        LicenseException - when the License is missing or overdue
    • Method Detail

      • getLicenseFile

        public static String getLicenseFile()
        Gets license file name or absolute path to license.
        Returns:
        License file name or absolute path to license.
      • setLicenseFile

        public static void setLicenseFile​(String value)
        Sets license file name or absolute path to license.
        Parameters:
        value - License file name or absolute path to license.
      • getLicenseDirectory

        public static String getLicenseDirectory()
        Gets path to directory where license file is located.
        Returns:
        Path to directory where license file is located.
      • setLicenseDirectory

        public static void setLicenseDirectory​(String value)
        Sets path to directory where license file is located.
        Parameters:
        value - Path to directory where license file is located.
      • getLicenseExpirationDate

        public final LocalDate getLicenseExpirationDate()
        Returns:
        license expiration date.
      • registerErrorListener

        public void registerErrorListener​(ErrorListener errorListener)
        Register listener of error event.
        Parameters:
        errorListener - Listener.
      • unregisterErrorListener

        public void unregisterErrorListener()
        Unregister listener of error event.
      • registerWarningListener

        public void registerWarningListener​(WarningListener warningListener)
        Register a listener for non-fatal parsing warnings.
        Parameters:
        warningListener - Listener.
      • unregisterWarningListener

        public void unregisterWarningListener()
        Unregister the warning listener.
      • registerMessageListener

        public void registerMessageListener​(MessageListener messageListener)
        Register listener of message events.
        Parameters:
        messageListener - Listener.
      • unregisterMessageListener

        public void unregisterMessageListener()
        Unregister listener of message events.
      • registerFixmlMessageListener

        public void registerFixmlMessageListener​(FixmlMessageListener messageListener)
        Register listener of FIXML message events.
        Parameters:
        messageListener - Listener.
      • unregisterFixmlMessageListener

        public void unregisterFixmlMessageListener()
        Unregister listener of Fixml message events.
      • subscribe

        public final String subscribe​(TradeCaptureReportRequest request)
        Subscribe to Trade Capture Reporting with filtering.
        Parameters:
        request - Request which contains filtering information.
        Returns:
        Subscription ID.
      • subscribe

        public final String subscribe()
        Subscribe to Trade Capture Reporting without filtering (all trades).
        Returns:
        Subscription ID.
      • subscribe

        public final String subscribe​(ZonedDateTime startTime)
        Subscribe to Trade Capture Reporting without filtering (all trades).
        Parameters:
        startTime - The starting time of the subscription.
        Returns:
        Subscription ID.
      • unsubscribe

        public final void unsubscribe​(String id)
        Unsubscribe from Trade Capture Reporting.
        Parameters:
        id - Subscription ID.
      • query

        public final void query​(TradeCaptureReportRequest request)
        Query request to retrieve the current status of trades.
        Parameters:
        request - Request which contains filtering information.