Class InstrumentMessageSourceAdapter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, java.lang.String[] types)
      Add the specified entities and types to subscription.
      void add​(java.lang.CharSequence[] symbols, java.lang.String[] types)
      Add symbols of certain types to the subscription.
      void addEntities​(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, int offset, int length)
      Bulk add the specified entities to subscription.
      void addEntity​(deltix.qsrv.hf.pub.InstrumentIdentity id)
      Add the specified entity to subscription.
      void addStream​(TickStream... tickStreams)
      Add streams to subscription.
      void addSymbol​(java.lang.CharSequence symbol)
      Add symbol to the subscription.
      void addSymbols​(java.lang.CharSequence[] symbols)
      Add array of symbols to the subscription.
      void addSymbols​(java.lang.CharSequence[] symbols, int offset, int length)
      Add array of symbols to the subscription from index offset to index offset + length.
      void addTypes​(java.lang.String... names)
      Add the specified type names to subscription.
      void clearAllEntities()
      Switch to selective subscription mode (if necessary) and clear the list.
      void clearAllSymbols()
      Unsubscribe all symbols.
      void close()  
      int getCurrentEntityIndex()
      Return a small number identifying the returned entity.
      TickStream getCurrentStream()
      Return the current stream instance, unless it has been removed, in which case null is returned.
      int getCurrentStreamIndex()
      Return the index of the stream that is the source of the current message.
      java.lang.String getCurrentStreamKey()
      Return the key of the stream that is the source of the current message.
      RecordClassDescriptor getCurrentType()
      Returns the type of the current message.
      int getCurrentTypeIndex()
      Returns the type index of the current message.
      protected InstrumentMessageSource getDelegate()  
      deltix.qsrv.hf.pub.InstrumentMessage getMessage()
      Returns the current message.
      boolean isAtEnd()  
      boolean isClosed()  
      boolean isRealTime()  
      boolean next()  
      boolean realTimeAvailable()  
      void remove​(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, java.lang.String[] types)
      Remove the specified entities and types from subscription.
      void remove​(java.lang.CharSequence[] symbols, java.lang.String[] types)
      Remove symbols of certain types from the subscription.
      void removeAllStreams()
      Remove all streams from subscription.
      void removeEntities​(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, int offset, int length)
      Remove the specified entities from subscription.
      void removeEntity​(deltix.qsrv.hf.pub.InstrumentIdentity id)
      Remove the specified entity from subscription.
      void removeStream​(TickStream... tickStreams)
      Remove streams from subscription.
      void removeSymbol​(java.lang.CharSequence symbol)
      Remove symbol from the subscription.
      void removeSymbols​(java.lang.CharSequence[] symbols)
      Remove array of symbols from the subscription.
      void removeSymbols​(java.lang.CharSequence[] symbols, int offset, int length)
      Remove array of symbols from the subscription from index offset to index offset + length.
      void removeTypes​(java.lang.String... names)
      Remove the specified types from subscription.
      void reset​(long time)
      Reposition the message source to a new point in time, while preserving current subscription.
      void setAvailabilityListener​(java.lang.Runnable maybeAvailable)  
      void setTimeForNewSubscriptions​(long time)
      This method affects subsequent "add subscription" methods, such as, for instance, addEntity ().
      void setTypes​(java.lang.String... names)
      Subscribe to specified types.
      void subscribeToAllEntities()
      Subscribe to all available entities.
      void subscribeToAllSymbols()
      Subscribe to all present symbols.
      void subscribeToAllTypes()
      Subscribe to all available types (no filtering).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • next

        public boolean next()
        Specified by:
        next in interface deltix.util.concurrent.AbstractCursor
        Overrides:
        next in class MessageSourceAdapter<deltix.qsrv.hf.pub.InstrumentMessage>
      • isAtEnd

        public boolean isAtEnd()
        Specified by:
        isAtEnd in interface deltix.util.concurrent.AbstractCursor
        Overrides:
        isAtEnd in class MessageSourceAdapter<deltix.qsrv.hf.pub.InstrumentMessage>
      • 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
        Overrides:
        close in class MessageSourceAdapter<deltix.qsrv.hf.pub.InstrumentMessage>
      • 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
      • 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
      • 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.
      • addSymbols

        public void addSymbols​(java.lang.CharSequence[] symbols,
                               int offset,
                               int length)
        Description copied from interface: SymbolSubscriptionController
        Add array of symbols to the subscription from index offset to index offset + length.
        Specified by:
        addSymbols in interface SymbolSubscriptionController
        Parameters:
        symbols - array of symbols to be added to subscription
        offset - start index
        length - length of symbols to be added
      • removeSymbols

        public void removeSymbols​(java.lang.CharSequence[] symbols,
                                  int offset,
                                  int length)
        Description copied from interface: SymbolSubscriptionController
        Remove array of symbols from the subscription from index offset to index offset + length.
        Specified by:
        removeSymbols in interface SymbolSubscriptionController
        Parameters:
        symbols - array of symbols to be removed
        offset - start index
        length - length of symbols to be removed
      • 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.
      • 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.
      • 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
      • 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 maybeAvailable)
        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 .