Class MamdaOptionChainListener

  • All Implemented Interfaces:
    MamdaBasicEvent, MamdaMsgListener, MamdaOptionSeriesUpdate

    public class MamdaOptionChainListener
    extends java.lang.Object
    implements MamdaMsgListener, MamdaOptionSeriesUpdate
    MamdaOptionChainListener is a class that specializes in handling and managing option chain updates. Developers provide their own implementation of the MamdaOptionChainHandler interface and will be delivered notifications for various types of options-related events.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHandler​(MamdaOptionChainHandler handler)
      Add a specialized option chain handler.
      com.wombat.mama.MamaDateTime getActivityTime()  
      short getActivityTimeFieldState()
      return Activity time Field State MODIFIED (2) value indicates the fied was updated in last tick NOT MODIFIED (1) value indicate that there was no change in the last tick NOT_INITIALISED (0) value indicates that the field has never been updated
      long getEventSeqNum()  
      short getEventSeqNumFieldState()
      return source sequence number Field State MODIFIED (2) value indicates the fied was updated in last tick NOT MODIFIED (1) value indicate that there was no change in the last tick NOT_INITIALISED (0) value indicates that the field has never been updated
      com.wombat.mama.MamaDateTime getEventTime()  
      short getEventTimeFieldState()
      return event time Field State MODIFIED (2) value indicates the fied was updated in last tick NOT MODIFIED (1) value indicate that there was no change in the last tick NOT_INITIALISED (0) value indicates that the field has never been updated
      char getOptionAction()
      Get the most recent action.
      MamdaOptionChain getOptionChain()
      Return the option chain associated with this listener.
      MamdaOptionContract getOptionContract()
      Get the option contract to which the most recent event applies.
      com.wombat.mama.MamaDateTime getSrcTime()  
      short getSrcTimeFieldState()
      return Source time Field State MODIFIED (2) value indicates the fied was updated in last tick NOT MODIFIED (1) value indicate that there was no change in the last tick NOT_INITIALISED (0) value indicates that the field has never been updated
      void onMsg​(MamdaSubscription subscription, com.wombat.mama.MamaMsg msg, short msgType)
      Implementation of MamdaListener interface.
      • Methods inherited from class java.lang.Object

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

      • MamdaOptionChainListener

        public MamdaOptionChainListener​(java.lang.String underlyingSymbol)
        Create a specialized option chain listener. This listener handles option chain updates.
      • MamdaOptionChainListener

        public MamdaOptionChainListener​(MamdaOptionChain chain)
        Create a specialized option chain listener. This listener handles option chain updates.
    • Method Detail

      • addHandler

        public void addHandler​(MamdaOptionChainHandler handler)
        Add a specialized option chain handler. Currently, only one handler can (and must) be registered.
      • getOptionChain

        public MamdaOptionChain getOptionChain()
        Return the option chain associated with this listener.
      • onMsg

        public void onMsg​(MamdaSubscription subscription,
                          com.wombat.mama.MamaMsg msg,
                          short msgType)
        Implementation of MamdaListener interface.
        Specified by:
        onMsg in interface MamdaMsgListener
        Parameters:
        subscription - The MamdaSubscription to which this listener was registered.
        msg - The MamaMsg received by the underlying MAMA API and which resulted in this callback being invoked.
        msgType - The message type. e.g. INITIAL, RECAP, UPDATE etc.
      • getSrcTime

        public com.wombat.mama.MamaDateTime getSrcTime()
        Specified by:
        getSrcTime in interface MamdaBasicEvent
        Returns:
        Source time. Typically, the exchange generated feed time stamp. This is often the same as the "event time", because many feeds do not distinguish between the actual event time and when the exchange sent the message.
      • getActivityTime

        public com.wombat.mama.MamaDateTime getActivityTime()
        Specified by:
        getActivityTime in interface MamdaBasicEvent
        Returns:
        Activity time. A feed handler generated time stamp representing when the data item was last updated.
      • getEventSeqNum

        public long getEventSeqNum()
        Specified by:
        getEventSeqNum in interface MamdaBasicEvent
        Returns:
        Source sequence number. The exchange generated sequence number.
      • getEventTime

        public com.wombat.mama.MamaDateTime getEventTime()
        Specified by:
        getEventTime in interface MamdaBasicEvent
        Returns:
        Event time. Typically, when the event actually occurred. This is often the same as the "source time", because many feeds do not distinguish between the actual event time and when the exchange sent the message.
      • getSrcTimeFieldState

        public short getSrcTimeFieldState()
        Description copied from interface: MamdaBasicEvent
        return Source time Field State MODIFIED (2) value indicates the fied was updated in last tick NOT MODIFIED (1) value indicate that there was no change in the last tick NOT_INITIALISED (0) value indicates that the field has never been updated
        Specified by:
        getSrcTimeFieldState in interface MamdaBasicEvent
      • getActivityTimeFieldState

        public short getActivityTimeFieldState()
        Description copied from interface: MamdaBasicEvent
        return Activity time Field State MODIFIED (2) value indicates the fied was updated in last tick NOT MODIFIED (1) value indicate that there was no change in the last tick NOT_INITIALISED (0) value indicates that the field has never been updated
        Specified by:
        getActivityTimeFieldState in interface MamdaBasicEvent
      • getEventSeqNumFieldState

        public short getEventSeqNumFieldState()
        Description copied from interface: MamdaBasicEvent
        return source sequence number Field State MODIFIED (2) value indicates the fied was updated in last tick NOT MODIFIED (1) value indicate that there was no change in the last tick NOT_INITIALISED (0) value indicates that the field has never been updated
        Specified by:
        getEventSeqNumFieldState in interface MamdaBasicEvent
      • getEventTimeFieldState

        public short getEventTimeFieldState()
        Description copied from interface: MamdaBasicEvent
        return event time Field State MODIFIED (2) value indicates the fied was updated in last tick NOT MODIFIED (1) value indicate that there was no change in the last tick NOT_INITIALISED (0) value indicates that the field has never been updated
        Specified by:
        getEventTimeFieldState in interface MamdaBasicEvent
      • getOptionContract

        public MamdaOptionContract getOptionContract()
        Description copied from interface: MamdaOptionSeriesUpdate
        Get the option contract to which the most recent event applies.
        Specified by:
        getOptionContract in interface MamdaOptionSeriesUpdate
        Returns:
        The option contract to which the most recent event applies. If the contract is new, it will have already been added to the chain. If it is being removed, it will have already been removed from the chain.