Class TickCursorClientAeron

    • Constructor Detail

      • TickCursorClientAeron

        public TickCursorClientAeron​(deltix.qsrv.hf.tickdb.comm.client.DXRemoteDB db,
                                     VSChannel channel,
                                     SelectionOptions options,
                                     long time,
                                     boolean allEntitiesSubscribed,
                                     boolean allTypesSubscribed,
                                     InstrumentToObjectMap<java.lang.Long> subscribedEntities,
                                     java.util.HashSet<java.lang.String> subscribedTypes,
                                     java.util.HashSet<TickStream> subscribedStreams,
                                     io.aeron.Aeron aeron,
                                     int aeronDataStreamId,
                                     int aeronCommandStreamId,
                                     DXAeronSubscriptionChecker subscriptionChecker)
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface deltix.util.lang.Disposable
      • writeStreamKeys

        public static void writeStreamKeys​(java.io.DataOutputStream out,
                                           TickStream[] streams)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • reset

        public void reset​(long time)
        Description copied from interface: TimeController
        Reposition the message source to a new point in time, while preserving current subscription.
        Specified by:
        reset in interface TimeController
        Parameters:
        time - The new position in time.
      • removeEntity

        public void removeEntity​(deltix.qsrv.hf.pub.InstrumentIdentity id)
        Description copied from interface: EntitySubscriptionController
        Remove the specified entity from subscription. The type and symbol are copied from the incoming object, if necessary, so the argument can be re-used after the call.
        Specified by:
        removeEntity in interface EntitySubscriptionController
      • removeEntities

        public void removeEntities​(deltix.qsrv.hf.pub.InstrumentIdentity[] ids,
                                   int offset,
                                   int length)
        Description copied from interface: EntitySubscriptionController
        Remove the specified entities from subscription. The type and symbol are copied from the incoming objects, if necessary, so the arguments can be re-used after the call.
        Specified by:
        removeEntities in interface EntitySubscriptionController
      • addEntity

        public void addEntity​(deltix.qsrv.hf.pub.InstrumentIdentity id)
        Description copied from interface: EntitySubscriptionController
        Add the specified entity to subscription. The type and symbol are copied from the incoming object, if necessary, so the argument can be re-used after the call. Special note about options: The following fragment will subscribe to specific option contract "DAV 100417P00085000": addEntity(new InstrumentKey(InstrumentType.OPTION, "DAV 100417P00085000")); While the following will subscribe to option root (and you will get all instruments with this root): addEntity(new InstrumentKey(InstrumentType.OPTION, "DAV "));
        Specified by:
        addEntity in interface EntitySubscriptionController
      • addEntities

        public void addEntities​(deltix.qsrv.hf.pub.InstrumentIdentity[] ids,
                                int offset,
                                int length)
        Description copied from interface: EntitySubscriptionController
        Bulk add the specified entities to subscription. The type and symbol are copied from the incoming objects, if necessary, so the arguments can be re-used after the call.
        Specified by:
        addEntities in interface EntitySubscriptionController
      • getSubscribedEntities

        public deltix.qsrv.hf.pub.InstrumentIdentity[] getSubscribedEntities()
        Description copied from interface: SubscriptionInfo
        Get the specified entities of the current subscription.
        Specified by:
        getSubscribedEntities in interface SubscriptionInfo
        Returns:
        not-nullable array of subscribed entities.
      • isAllEntitiesSubscribed

        public boolean isAllEntitiesSubscribed()
        Description copied from interface: SubscriptionInfo
        Indicates that all entities subscribed (no filtering).
        Specified by:
        isAllEntitiesSubscribed in interface SubscriptionInfo
        Returns:
        true if all entities subscribed.
      • getSubscribedTypes

        public java.lang.String[] getSubscribedTypes()
        Description copied from interface: SubscriptionInfo
        Get the specified type names of the current subscription.
        Specified by:
        getSubscribedTypes in interface SubscriptionInfo
        Returns:
        not-nullable array of subscribed type names.
      • isAllTypesSubscribed

        public boolean isAllTypesSubscribed()
        Description copied from interface: SubscriptionInfo
        Indicates that all types subscribed (no filtering).
        Specified by:
        isAllTypesSubscribed in interface SubscriptionInfo
        Returns:
        true if all types subscribed.
      • hasSubscribedTypes

        public boolean hasSubscribedTypes()
        Description copied from interface: SubscriptionInfo
        Indicates true if types subscription is not empty.
        Specified by:
        hasSubscribedTypes in interface SubscriptionInfo
        Returns:
        true if at least one type was subscribed.
      • add

        public void add​(deltix.qsrv.hf.pub.InstrumentIdentity[] ids,
                        java.lang.String[] types)
        Description copied from interface: EntityAndTypeSubscriptionController
        Add the specified entities and types to subscription. The type and symbol are copied from the incoming object, if necessary, so the argument can be re-used after the call.
        Specified by:
        add in interface EntityAndTypeSubscriptionController
        Parameters:
        ids - not-null array of instruments to subscribe.
        types - not-null array of type names to subscribe.
      • remove

        public void remove​(deltix.qsrv.hf.pub.InstrumentIdentity[] ids,
                           java.lang.String[] types)
        Description copied from interface: EntityAndTypeSubscriptionController
        Remove the specified entities and types from subscription. The type and symbol are copied from the incoming objects, if necessary, so the arguments can be re-used after the call.
        Specified by:
        remove in interface EntityAndTypeSubscriptionController
        Parameters:
        ids - not-null array of instruments to subscribe.
        types - not-null array of type names to subscribe.
      • nextIfAvailable

        public deltix.util.concurrent.NextResult nextIfAvailable()
        Specified by:
        nextIfAvailable in interface deltix.util.concurrent.IntermittentlyAvailableCursor
      • next

        public boolean next()
        Specified by:
        next in interface deltix.util.concurrent.AbstractCursor
      • onFragment

        public io.aeron.logbuffer.ControlledFragmentHandler.Action onFragment​(org.agrona.DirectBuffer buffer,
                                                                              int offset,
                                                                              int length,
                                                                              io.aeron.logbuffer.Header header)
        Specified by:
        onFragment in interface io.aeron.logbuffer.ControlledFragmentHandler
      • getCurrentStreamKey

        public java.lang.String getCurrentStreamKey()
        Description copied from interface: MessageInfo
        Return the key of the stream that is the source of the current message.
        Specified by:
        getCurrentStreamKey in interface MessageInfo
        Returns:
        The source stream key.
      • getCurrentStream

        public TickStream getCurrentStream()
        Description copied from interface: MessageInfo
        Return the current stream instance, unless it has been removed, in which case null is returned.
        Specified by:
        getCurrentStream in interface MessageInfo
      • getCurrentStreamIndex

        public int getCurrentStreamIndex()
        Description copied from interface: MessageInfo
        Return the index of the stream that is the source of the current message.
        Specified by:
        getCurrentStreamIndex in interface MessageInfo
        Returns:
        The current message source stream's index.
      • getMessage

        public deltix.qsrv.hf.pub.InstrumentMessage getMessage()
        Description copied from interface: MessageInfo
        Returns the current message.
        Specified by:
        getMessage in interface InstrumentMessageSource
        Specified by:
        getMessage in interface MessageInfo
        Specified by:
        getMessage in interface deltix.data.stream.MessageSource<deltix.qsrv.hf.pub.InstrumentMessage>
      • isAtEnd

        public boolean isAtEnd()
        Specified by:
        isAtEnd in interface deltix.util.concurrent.AbstractCursor
      • getCurrentEntityIndex

        public int getCurrentEntityIndex()
        Description copied from interface: MessageInfo
        Return a small number identifying the returned entity. This number is unique throughout the life of the message source. Removing entities from subscription does not create reusable holes in the "space" of entity indexes.
        Specified by:
        getCurrentEntityIndex in interface MessageInfo
        See Also:
        EntitySubscriptionController
      • setAvailabilityListener

        public void setAvailabilityListener​(java.lang.Runnable lnr)
        Specified by:
        setAvailabilityListener in interface deltix.util.concurrent.IntermittentlyAvailableResource
      • isRealTime

        public boolean isRealTime()
        Specified by:
        isRealTime in interface RealTimeMessageSource<deltix.qsrv.hf.pub.InstrumentMessage>
        Returns:
        true if this source already switched from historical to real-time data portion
      • realTimeAvailable

        public boolean realTimeAvailable()
        Specified by:
        realTimeAvailable in interface RealTimeMessageSource<deltix.qsrv.hf.pub.InstrumentMessage>
        Returns:
        true if source can be switched in real-time. When realtime mode is available client can use method RealTimeMessageSource.isRealTime() ()} to detect switch from historical to real-time portion of data. Also in this mode client will receive special message RealTimeStartMessage .