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 char
ACTION_ADD
static char
ACTION_DELETE
static char
ACTION_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 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 updatedlong
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 updatedcom.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 updatedchar
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 updatedvoid
onMsg(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:
onMsg
in 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:
getSrcTime
in 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:
getActivityTime
in interfaceMamdaBasicEvent
- 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 interfaceMamdaBasicEvent
- Returns:
- Source sequence number. The exchange generated sequence number.
-
getEventTime
public com.wombat.mama.MamaDateTime getEventTime()
- Specified by:
getEventTime
in 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: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 interfaceMamdaBasicEvent
-
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 interfaceMamdaBasicEvent
-
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 interfaceMamdaBasicEvent
-
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 interfaceMamdaBasicEvent
-
getOptionContract
public MamdaOptionContract getOptionContract()
Description copied from interface:MamdaOptionSeriesUpdate
Get the option contract to which the most recent event applies.- Specified by:
getOptionContract
in 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:MamdaOptionSeriesUpdate
Get the most recent action.- Specified by:
getOptionAction
in interfaceMamdaOptionSeriesUpdate
- Returns:
- The action related to the last series update message.
-
-