Package com.wombat.mamda.options
Class MamdaOptionChainListener
- java.lang.Object
-
- com.wombat.mamda.options.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.
-
-
Field Summary
Fields Modifier and Type Field Description static charACTION_ADDstatic charACTION_DELETEstatic charACTION_UNKNOWN
-
Constructor Summary
Constructors Constructor Description MamdaOptionChainListener(MamdaOptionChain chain)Create a specialized option chain listener.MamdaOptionChainListener(java.lang.String underlyingSymbol)Create a specialized option chain listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHandler(MamdaOptionChainHandler handler)Add a specialized option chain handler.com.wombat.mama.MamaDateTimegetActivityTime()shortgetActivityTimeFieldState()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 updatedlonggetEventSeqNum()shortgetEventSeqNumFieldState()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 updatedcom.wombat.mama.MamaDateTimegetEventTime()shortgetEventTimeFieldState()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 updatedchargetOptionAction()Get the most recent action.MamdaOptionChaingetOptionChain()Return the option chain associated with this listener.MamdaOptionContractgetOptionContract()Get the option contract to which the most recent event applies.com.wombat.mama.MamaDateTimegetSrcTime()shortgetSrcTimeFieldState()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 updatedvoidonMsg(MamdaSubscription subscription, com.wombat.mama.MamaMsg msg, short msgType)Implementation of MamdaListener interface.
-
-
-
Field Detail
-
ACTION_UNKNOWN
public static final char ACTION_UNKNOWN
- See Also:
- Constant Field Values
-
ACTION_ADD
public static final char ACTION_ADD
- See Also:
- Constant Field Values
-
ACTION_DELETE
public static final char ACTION_DELETE
- See Also:
- Constant Field Values
-
-
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:
onMsgin interfaceMamdaMsgListener- 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:
getSrcTimein interfaceMamdaBasicEvent- 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:
getActivityTimein interfaceMamdaBasicEvent- Returns:
- Activity time. A feed handler generated time stamp representing when the data item was last updated.
-
getEventSeqNum
public long getEventSeqNum()
- Specified by:
getEventSeqNumin interfaceMamdaBasicEvent- Returns:
- Source sequence number. The exchange generated sequence number.
-
getEventTime
public com.wombat.mama.MamaDateTime getEventTime()
- Specified by:
getEventTimein interfaceMamdaBasicEvent- 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:MamdaBasicEventreturn 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:
getSrcTimeFieldStatein interfaceMamdaBasicEvent
-
getActivityTimeFieldState
public short getActivityTimeFieldState()
Description copied from interface:MamdaBasicEventreturn 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:
getActivityTimeFieldStatein interfaceMamdaBasicEvent
-
getEventSeqNumFieldState
public short getEventSeqNumFieldState()
Description copied from interface:MamdaBasicEventreturn 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:
getEventSeqNumFieldStatein interfaceMamdaBasicEvent
-
getEventTimeFieldState
public short getEventTimeFieldState()
Description copied from interface:MamdaBasicEventreturn 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:
getEventTimeFieldStatein interfaceMamdaBasicEvent
-
getOptionContract
public MamdaOptionContract getOptionContract()
Description copied from interface:MamdaOptionSeriesUpdateGet the option contract to which the most recent event applies.- Specified by:
getOptionContractin interfaceMamdaOptionSeriesUpdate- 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.
-
getOptionAction
public char getOptionAction()
Description copied from interface:MamdaOptionSeriesUpdateGet the most recent action.- Specified by:
getOptionActionin interfaceMamdaOptionSeriesUpdate- Returns:
- The action related to the last series update message.
-
-