com.apama.marketdata
Event MarketDataKey


The market data key represents a source of market data. It stores information required to identify that data from that source as well as actions that perform those tests.

This event should always be used when subscribing to a source of tick or depth data. It is only possible to filter events based on symbol. All the other parameters e.g. service id are kept in the extra parameters. This event implements the test to see if the depth or tick event came from the source that was subscribed to. This is particularly important when more than one adapter publishes data for the same symbol.

The market data key is a utility event object that can be used to ensure that market data (i.e. depth/tick) subscriptions, unsubscriptions and events match the key of symbol, service, exchange and market as well as any other key extraParameters (e.g. for specifying aggregated vs. non aggregated depth). That key can be initialised from explicit parameters or those garnered from an example event.
Since:
CMF 1.1.0
Version:
10.2

Member summary
 com.apama.marketdata.InnerMarketDataKeykey

The symbol, service, exchange and market for this source of market data.
 dictionary<string, string>keyExtraParams

Any additional extra parameters that are part of the session IDentification.
 
Action summary
 string_toString()

This action returns a string representation of this key that is shorter than the standard toString action.
 com.apama.marketdata.SubscribeDepthgetDepthSubscription()

This action will construct a subscription event to subscribe to the source the key represents.
 stringgetExchange()

This action returns the exchange for this market data source.
 com.apama.marketdata.InnerMarketDataKeygetInnerKey()

This action returns the inner key, which does not contain key extra parameters. This is useful e.g. for using as a key in a dictionary.
 dictionary<string, string>getKeyExtraParams()

This action returns any key extra parameters for this market data source.
 stringgetMarket()

This action returns the market for this market data source.
 stringgetService()

This action returns the service for this market data source.
 stringgetSymbol()

This action returns the symbol for this market data source.
 com.apama.marketdata.SubscribeTickgetTickSubscription()

This action will construct a subscription event to subscribe to the source the key represents.
 com.apama.marketdata.UnsubscribeDepthgetUnsubscribeDepth()

This action will construct a unsubscription event to relinquish a subscription to the source the key represents.
 com.apama.marketdata.UnsubscribeTickgetUnsubscribeTick()

This action will construct a unsubscription event to relinquish a subscription to the source the key represents.
 booleanmatchesDepth(com.apama.marketdata.Depth depth)

This action tests a depth event to establish whether it came from the source the key represents.
 booleanmatchesDepthSub(com.apama.marketdata.SubscribeDepth sub)

This action tests if a subscription is for the source this key represents.
 booleanmatchesDepthUnsub(com.apama.marketdata.UnsubscribeDepth unsub)

This action tests if an unsubscription is for the source this key represents.
 booleanmatchesMarketDataKey(com.apama.marketdata.MarketDataKey otherKey)

Tests whether two market data keys are the same.
 booleanmatchesTick(com.apama.marketdata.Tick tick)

This action tests a tick event to establish whether it came from the source the key represents.
 booleanmatchesTickSub(com.apama.marketdata.SubscribeTick sub)

This action tests if a subscription is for the source this key represents.
 booleanmatchesTickUnsub(com.apama.marketdata.UnsubscribeTick unsub)

This action tests if an unsubscription is for the source this key represents.
 voidset(string symbol, string service, string exchange, string market, dictionary<string, string> keyExtraParams)

This constructor is used to set a market data key by specifying each field explicitly.
 voidsetFromDepth(com.apama.marketdata.Depth depth)

This constructor is used to set a market data key from a depth event by extracting the extra parameters from it.
 voidsetFromDepthSub(com.apama.marketdata.SubscribeDepth sub)

This constructor is used to set a market data key from a subscription event.
 voidsetFromDepthUnsub(com.apama.marketdata.UnsubscribeDepth unsub)

This constructor is used to set a market data key from an unsubscription event.
 voidsetFromTick(com.apama.marketdata.Tick tick)

This constructor is used to set a market data key from a tick event by extracting the extra parameters from it.
 voidsetFromTickSub(com.apama.marketdata.SubscribeTick sub)

This constructor is used to set a market data key from a subscription event.
 voidsetFromTickUnsub(com.apama.marketdata.UnsubscribeTick unsub)

This constructor is used to set a market data key from an unsubscription event.
 
Member detail

key

com.apama.marketdata.InnerMarketDataKey key
The symbol, service, exchange and market for this source of market data.

keyExtraParams

dictionary<string, string> keyExtraParams
Any additional extra parameters that are part of the session IDentification.

e.g. some adapters will use an extra parameter to indicate that a depth event contains market by order or market by price data. These two streams of data would be discriminated using that key extra parameter. The value of the extra param in the depth and tick events must match that in the key and should be sent in the subscription event too.
Action detail

_toString

string _toString()
This action returns a string representation of this key that is shorter than the standard toString action.
Returns:
The string representation

getDepthSubscription

com.apama.marketdata.SubscribeDepth getDepthSubscription()
This action will construct a subscription event to subscribe to the source the key represents.
Returns:
A subscription event you can use to subscribe to data from this source

getExchange

string getExchange()
This action returns the exchange for this market data source.
Returns:
The exchange

getInnerKey

com.apama.marketdata.InnerMarketDataKey getInnerKey()
This action returns the inner key, which does not contain key extra parameters. This is useful e.g. for using as a key in a dictionary.
Returns:
The inner market data key

getKeyExtraParams

dictionary<string, string> getKeyExtraParams()
This action returns any key extra parameters for this market data source.
Returns:
The key extra parameters

getMarket

string getMarket()
This action returns the market for this market data source.
Returns:
The market

getService

string getService()
This action returns the service for this market data source.
Returns:
The service

getSymbol

string getSymbol()
This action returns the symbol for this market data source.
Returns:
The symbol

getTickSubscription

com.apama.marketdata.SubscribeTick getTickSubscription()
This action will construct a subscription event to subscribe to the source the key represents.
Returns:
A subscription event you can use to subscribe to data from this source

getUnsubscribeDepth

com.apama.marketdata.UnsubscribeDepth getUnsubscribeDepth()
This action will construct a unsubscription event to relinquish a subscription to the source the key represents.
Returns:
A subscription event you can use to unsubscribe from this source

getUnsubscribeTick

com.apama.marketdata.UnsubscribeTick getUnsubscribeTick()
This action will construct a unsubscription event to relinquish a subscription to the source the key represents.
Returns:
A subscription event you can use to unsubscribe from this source

matchesDepth

boolean matchesDepth(com.apama.marketdata.Depth depth)
This action tests a depth event to establish whether it came from the source the key represents.
Parameters:
depth - The depth event to test matches the key
Returns:
Whether the depth event matches the key

matchesDepthSub

boolean matchesDepthSub(com.apama.marketdata.SubscribeDepth sub)
This action tests if a subscription is for the source this key represents.
Parameters:
sub - The subscription
Returns:
Whether the depth subscription event matches the key
See Also:
com.apama.marketdata.DepthPublisher - which uses this action. If you are implementing a depth source, use that event to do so.

matchesDepthUnsub

boolean matchesDepthUnsub(com.apama.marketdata.UnsubscribeDepth unsub)
This action tests if an unsubscription is for the source this key represents.
Parameters:
unsub - The unsubscription
Returns:
Whether the depth unsubscription event matches the key
See Also:
com.apama.marketdata.DepthPublisher - which uses this action. If you are implementing a depth source, use that event to do so.

matchesMarketDataKey

boolean matchesMarketDataKey(com.apama.marketdata.MarketDataKey otherKey)
Tests whether two market data keys are the same.
Parameters:
otherKey - The other key
Returns:
Whether the keys represent the same source

matchesTick

boolean matchesTick(com.apama.marketdata.Tick tick)
This action tests a tick event to establish whether it came from the source the key represents.
Parameters:
tick - The tick event to test matches the key
Returns:
Whether the tick event matches the key

matchesTickSub

boolean matchesTickSub(com.apama.marketdata.SubscribeTick sub)
This action tests if a subscription is for the source this key represents.
Parameters:
sub - The subscription
Returns:
Whether the tick subscription event matches the key
See Also:
com.apama.marketdata.TickPublisher - which uses this action. If you are implementing a depth source, use that event to do so.

matchesTickUnsub

boolean matchesTickUnsub(com.apama.marketdata.UnsubscribeTick unsub)
This action tests if an unsubscription is for the source this key represents.
Parameters:
unsub - The unsubscription
Returns:
Whether the tick unsubscription event matches the key
See Also:
com.apama.marketdata.TickPublisher - which uses this action. If you are implementing a tick source, use that event to do so.

set

void set(string symbol, string service, string exchange, string market, dictionary<string, string> keyExtraParams)
This constructor is used to set a market data key by specifying each field explicitly.
Parameters:
symbol - The symbol for the source of market data
service - The service id of the market data source
exchange - The exchange id of the market data source
market - The market id of the market data source
keyExtraParams - Any additional key extra parameters that need to be used to discriminate a particular market data source

setFromDepth

void setFromDepth(com.apama.marketdata.Depth depth)
This constructor is used to set a market data key from a depth event by extracting the extra parameters from it.
Parameters:
depth - The depth event that acts as a template for the source

setFromDepthSub

void setFromDepthSub(com.apama.marketdata.SubscribeDepth sub)
This constructor is used to set a market data key from a subscription event.
Parameters:
sub - The subscription event that specifies the key fields

setFromDepthUnsub

void setFromDepthUnsub(com.apama.marketdata.UnsubscribeDepth unsub)
This constructor is used to set a market data key from an unsubscription event.
Parameters:
unsub - The unsubscription event that specifies the key fields

setFromTick

void setFromTick(com.apama.marketdata.Tick tick)
This constructor is used to set a market data key from a tick event by extracting the extra parameters from it.
Parameters:
tick - The tick event that acts as a template for the source

setFromTickSub

void setFromTickSub(com.apama.marketdata.SubscribeTick sub)
This constructor is used to set a market data key from a subscription event.
Parameters:
sub - The subscription event that specifies the key fields

setFromTickUnsub

void setFromTickUnsub(com.apama.marketdata.UnsubscribeTick unsub)
This constructor is used to set a market data key from an unsubscription event.
Parameters:
unsub - The unsubscription event that specifies the key fields