Package com.wombat.mamda.orderbook
Class MamdaBookAtomicListener
- java.lang.Object
-
- com.wombat.mamda.orderbook.MamdaBookAtomicListener
-
- All Implemented Interfaces:
MamdaBasicEvent,MamdaBasicRecap,MamdaMsgListener,MamdaBookAtomicGap,MamdaBookAtomicLevel,MamdaBookAtomicLevelEntry
public class MamdaBookAtomicListener extends java.lang.Object implements MamdaMsgListener, MamdaBookAtomicLevel, MamdaBookAtomicLevelEntry, MamdaBookAtomicGap
-
-
Constructor Summary
Constructors Constructor Description MamdaBookAtomicListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBookHandler(MamdaBookAtomicBookHandler handler)voidaddLevelEntryHandler(MamdaBookAtomicLevelEntryHandler handler)voidaddLevelHandler(MamdaBookAtomicLevelHandler handler)java.util.IteratorentryIterator()Returns ajava.util.Iteratorfor all entries within this level.com.wombat.mama.MamaDateTimegetActivityTime()Activity time.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 updatedlonggetBeginGapSeqNum()Beginning sequence number in a detected gap event.longgetEndGapSeqNum()Ending sequence number in a detected gap event.longgetEventSeqNum()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 updatedbooleangetHasMarketOrders()com.wombat.mama.MamaDateTimegetLineTime()Get the line time of the update.shortgetLineTimeFieldState()shortgetMsgQual()chargetOrderType()java.lang.StringgetPartId()Get the participant identifier.shortgetPartIdFieldState()chargetPriceLevelAction()The action to apply to the orderbook for this price level.longgetPriceLevelActNumEntries()chargetPriceLevelEntryAction()Order book entry action to apply to the full order book.java.lang.StringgetPriceLevelEntryId()Order book entry Id.chargetPriceLevelEntryReason()Reason for order book entry.longgetPriceLevelEntrySize()Return the order book entry sizecom.wombat.mama.MamaDateTimegetPriceLevelEntryTime()Return the time of order book entry update.com.wombat.mama.MamaPricegetPriceLevelMamaPrice()Return the MamaPrice for this price level.longgetPriceLevelNum()Return at which position this level is within an update containing a number of levels.doublegetPriceLevelNumEntries()Number of order book entries at current price level.longgetPriceLevelNumLevels()Return the number of price levels in the order book update.doublegetPriceLevelPrice()Return the price for this price level.chargetPriceLevelSide()Side of book at current price level.doublegetPriceLevelSize()Return the number of order entries comprising this price level.longgetPriceLevelSizeChange()Aggregate size at current price level.com.wombat.mama.MamaDateTimegetPriceLevelTime()Time of order book price level.com.wombat.mama.MamaDateTimegetSendTime()Get the send time of the update.shortgetSendTimeFieldState()com.wombat.mama.MamaDateTimegetSrcTime()Source time.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 updatedjava.lang.StringgetSymbol()Get the string symbol for the instrument.shortgetSymbolFieldState()booleanisVisible()voidonMsg(MamdaSubscription subscription, com.wombat.mama.MamaMsg msg, short msgType)Invoked for each message received for the subscription to which the Listener is registered.voidsetOrderType(char orderType)voidsetPriceLevel(long priceLevel)voidsetProcessMarketOrders(boolean process)
-
-
-
Method Detail
-
entryIterator
public java.util.Iterator entryIterator()
Returns ajava.util.Iteratorfor all entries within this level. Price Level entries are represented by theMamdaOrderBookEntryclass.- Specified by:
entryIteratorin interfaceMamdaBookAtomicLevel- Specified by:
entryIteratorin interfaceMamdaBookAtomicLevelEntry- Returns:
- Iterator The iterator for the price level entries
-
addBookHandler
public void addBookHandler(MamdaBookAtomicBookHandler handler)
-
addLevelHandler
public void addLevelHandler(MamdaBookAtomicLevelHandler handler)
-
addLevelEntryHandler
public void addLevelEntryHandler(MamdaBookAtomicLevelEntryHandler handler)
-
getSymbol
public java.lang.String getSymbol()
Description copied from interface:MamdaBasicRecapGet the string symbol for the instrument.- Specified by:
getSymbolin interfaceMamdaBasicRecap- Returns:
- Symbol. This is the "well-known" symbol for the security, including any symbology mapping performed by the publisher.
-
getPartId
public java.lang.String getPartId()
Description copied from interface:MamdaBasicRecapGet the participant identifier.- Specified by:
getPartIdin interfaceMamdaBasicRecap- Returns:
- Participant ID. This may be an exchange identifier, a market maker ID, etc., or NULL (if this is not related to any specific participant).
-
getSrcTime
public com.wombat.mama.MamaDateTime getSrcTime()
Description copied from interface:MamdaBasicRecapSource time. Typically, the exchange generated feed- Specified by:
getSrcTimein interfaceMamdaBasicEvent- Specified by:
getSrcTimein interfaceMamdaBasicRecap- 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()
Description copied from interface:MamdaBasicRecapActivity time. A feed handler generated time stamp representing when the data item was last updated.- Specified by:
getActivityTimein interfaceMamdaBasicEvent- Specified by:
getActivityTimein interfaceMamdaBasicRecap- Returns:
- Activity time. A feed handler generated time stamp representing when the data item was last updated.
-
getLineTime
public com.wombat.mama.MamaDateTime getLineTime()
Description copied from interface:MamdaBasicRecapGet the line time of the update.- Specified by:
getLineTimein interfaceMamdaBasicRecap- Returns:
- Line time. A feed handler (or similar publisher) time stamp representing the time that such publisher received the update message pertaining to the event. If clocks are properly synchronized and the source time (see above) is accurate enough, then the difference between the source time and line time is the latency between the data source and the feed handler.
-
getSendTime
public com.wombat.mama.MamaDateTime getSendTime()
Description copied from interface:MamdaBasicRecapGet the send time of the update.- Specified by:
getSendTimein interfaceMamdaBasicRecap- Returns:
- Send time. A feed handler (or similar publisher) time stamp representing the time that such publisher sent the current message. The difference between the line time and send time is the latency within the feed handler itself. Also, if clocks are properly synchronized then the difference between the send time and current time is the latency within the market data distribution framework (i.e. MAMA and the underlying middleware).
-
getMsgQual
public short getMsgQual()
-
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.
-
getPriceLevelNumLevels
public long getPriceLevelNumLevels()
Description copied from interface:MamdaBookAtomicLevelReturn the number of price levels in the order book update.- Specified by:
getPriceLevelNumLevelsin interfaceMamdaBookAtomicLevel- Returns:
- The number of price levels.
-
getPriceLevelNum
public long getPriceLevelNum()
Description copied from interface:MamdaBookAtomicLevelReturn at which position this level is within an update containing a number of levels. (i.e. level m of n levels in the update)- Specified by:
getPriceLevelNumin interfaceMamdaBookAtomicLevel- Returns:
- The position of this level in the update received.
-
getPriceLevelPrice
public double getPriceLevelPrice()
Description copied from interface:MamdaBookAtomicLevelReturn the price for this price level.- Specified by:
getPriceLevelPricein interfaceMamdaBookAtomicLevel- Specified by:
getPriceLevelPricein interfaceMamdaBookAtomicLevelEntry- Returns:
- The price level price.
- See Also:
MamdaBookAtomicLevel.getPriceLevelPrice()
-
getPriceLevelMamaPrice
public com.wombat.mama.MamaPrice getPriceLevelMamaPrice()
Description copied from interface:MamdaBookAtomicLevelReturn the MamaPrice for this price level.- Specified by:
getPriceLevelMamaPricein interfaceMamdaBookAtomicLevel- Specified by:
getPriceLevelMamaPricein interfaceMamdaBookAtomicLevelEntry- Returns:
- The price level price.
- See Also:
MamdaBookAtomicLevel.getPriceLevelMamaPrice()
-
getPriceLevelSize
public double getPriceLevelSize()
Description copied from interface:MamdaBookAtomicLevelReturn the number of order entries comprising this price level.
Not supported for V5 entry book updates.- Specified by:
getPriceLevelSizein interfaceMamdaBookAtomicLevel- Specified by:
getPriceLevelSizein interfaceMamdaBookAtomicLevelEntry- Returns:
- The number of entries in this price level.
- See Also:
MamdaBookAtomicLevel.getPriceLevelSize()
-
getPriceLevelSizeChange
public long getPriceLevelSizeChange()
Description copied from interface:MamdaBookAtomicLevelAggregate size at current price level.
Not supported for V5 entry book updates.- Specified by:
getPriceLevelSizeChangein interfaceMamdaBookAtomicLevel- Returns:
- The aggregate size at the current price level.
-
getPriceLevelAction
public char getPriceLevelAction()
Description copied from interface:MamdaBookAtomicLevelThe action to apply to the orderbook for this price level. Can have a value of:- A : Add a new price level
- U : Update an existing price level
- D : Delete an existing price level
- C : Closing information for price level (often treat the same as Update).
- Specified by:
getPriceLevelActionin interfaceMamdaBookAtomicLevel- Specified by:
getPriceLevelActionin interfaceMamdaBookAtomicLevelEntry- Returns:
- The price level action.
- See Also:
MamdaBookAtomicLevel.getPriceLevelAction()
-
getPriceLevelSide
public char getPriceLevelSide()
Description copied from interface:MamdaBookAtomicLevelSide of book at current price level.- B : Bid side. Same as 'buy' side.
- A : Ask side. Same as 'sell' side.
- Specified by:
getPriceLevelSidein interfaceMamdaBookAtomicLevel- Specified by:
getPriceLevelSidein interfaceMamdaBookAtomicLevelEntry- Returns:
- The price level side.
- See Also:
MamdaBookAtomicLevel.getPriceLevelSide()
-
getPriceLevelTime
public com.wombat.mama.MamaDateTime getPriceLevelTime()
Description copied from interface:MamdaBookAtomicLevelTime of order book price level.- Specified by:
getPriceLevelTimein interfaceMamdaBookAtomicLevel- Specified by:
getPriceLevelTimein interfaceMamdaBookAtomicLevelEntry- Returns:
- The time of the orderbook price level.
- See Also:
MamdaBookAtomicLevel.getPriceLevelTime()
-
getPriceLevelNumEntries
public double getPriceLevelNumEntries()
Description copied from interface:MamdaBookAtomicLevelNumber of order book entries at current price level.
Not supported for V5 entry book updates.- Specified by:
getPriceLevelNumEntriesin interfaceMamdaBookAtomicLevel- Specified by:
getPriceLevelNumEntriesin interfaceMamdaBookAtomicLevelEntry- Returns:
- The number of entries at the current price level.
- See Also:
MamdaBookAtomicLevel.getPriceLevelNumEntries()
-
setOrderType
public void setOrderType(char orderType)
-
getOrderType
public char getOrderType()
-
getHasMarketOrders
public boolean getHasMarketOrders()
-
setProcessMarketOrders
public void setProcessMarketOrders(boolean process)
-
getPriceLevelActNumEntries
public long getPriceLevelActNumEntries()
- Specified by:
getPriceLevelActNumEntriesin interfaceMamdaBookAtomicLevelEntry
-
getPriceLevelEntryAction
public char getPriceLevelEntryAction()
Description copied from interface:MamdaBookAtomicLevelEntryOrder book entry action to apply to the full order book. A : Add entry to the price level. U : Update existing entry in the price level. D : Delete existing entry from the price level.- Specified by:
getPriceLevelEntryActionin interfaceMamdaBookAtomicLevelEntry- Returns:
- The orderbook entry action.
-
getPriceLevelEntryReason
public char getPriceLevelEntryReason()
Description copied from interface:MamdaBookAtomicLevelEntryReason for order book entry.- Specified by:
getPriceLevelEntryReasonin interfaceMamdaBookAtomicLevelEntry- Returns:
- The orderbook entry reason.
-
getPriceLevelEntryId
public java.lang.String getPriceLevelEntryId()
Description copied from interface:MamdaBookAtomicLevelEntryOrder book entry Id. (order ID, participant ID, etc.)- Specified by:
getPriceLevelEntryIdin interfaceMamdaBookAtomicLevelEntry- Returns:
- The entry id
-
getPriceLevelEntrySize
public long getPriceLevelEntrySize()
Description copied from interface:MamdaBookAtomicLevelEntryReturn the order book entry size- Specified by:
getPriceLevelEntrySizein interfaceMamdaBookAtomicLevelEntry- Returns:
- Order book entry size
-
getPriceLevelEntryTime
public com.wombat.mama.MamaDateTime getPriceLevelEntryTime()
Description copied from interface:MamdaBookAtomicLevelEntryReturn the time of order book entry update.- Specified by:
getPriceLevelEntryTimein interfaceMamdaBookAtomicLevelEntry- Returns:
- Time of order book entry update.
-
getBeginGapSeqNum
public long getBeginGapSeqNum()
Description copied from interface:MamdaBookAtomicGapBeginning sequence number in a detected gap event.- Specified by:
getBeginGapSeqNumin interfaceMamdaBookAtomicGap
-
getEndGapSeqNum
public long getEndGapSeqNum()
Description copied from interface:MamdaBookAtomicGapEnding sequence number in a detected gap event.- Specified by:
getEndGapSeqNumin interfaceMamdaBookAtomicGap
-
setPriceLevel
public void setPriceLevel(long priceLevel)
-
isVisible
public boolean isVisible()
- Specified by:
isVisiblein interfaceMamdaBookAtomicLevelEntry
-
getSymbolFieldState
public short getSymbolFieldState()
- Specified by:
getSymbolFieldStatein interfaceMamdaBasicRecap- Returns:
- symbol Field State
-
getPartIdFieldState
public short getPartIdFieldState()
- Specified by:
getPartIdFieldStatein interfaceMamdaBasicRecap- Returns:
- participant ID Field State
-
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- Specified by:
getSrcTimeFieldStatein interfaceMamdaBasicRecap- Returns:
- source time Field State
-
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- Specified by:
getActivityTimeFieldStatein interfaceMamdaBasicRecap- Returns:
- activity time Field State
-
getLineTimeFieldState
public short getLineTimeFieldState()
- Specified by:
getLineTimeFieldStatein interfaceMamdaBasicRecap- Returns:
- line time Field State
-
getSendTimeFieldState
public short getSendTimeFieldState()
- Specified by:
getSendTimeFieldStatein interfaceMamdaBasicRecap- Returns:
- send time Field State
-
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
-
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
-
onMsg
public void onMsg(MamdaSubscription subscription, com.wombat.mama.MamaMsg msg, short msgType)
Description copied from interface:MamdaMsgListenerInvoked for each message received for the subscription to which the Listener is registered.- 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.
-
-