com.apama.marketdata
Event TickPublisher


This event can be used to add tick publishing capabilities to a service.

The tick publisher is a way of publishing tick data without having to worry about reference counting or adding the correct extraParameters
Since:
CMF 1.1.0
Version:
10.2
Routes:
com.apama.marketdata.Tick - This tick publisher publishes tick
com.apama.marketdata.TickRefCount0 - To indicate when the reference count for this tick source goes to 0. Many adapters will spawn new instances to handle a datasource, they will use this event to kill off those instances when no longer needed.
com.apama.marketdata.TickSubscriptionError - This event communicates status information about the tick source
Sends:
com.apama.marketdata.Tick - 
com.apama.marketdata.TickRefCount0 - 
com.apama.marketdata.TickSubscriptionError - 
Listens:
com.apama.marketdata.SubscribeTick - The tick publisher reference counts subscriptions to the tick data
com.apama.marketdata.SubscribeTickFromContext - 
com.apama.marketdata.UnsubscribeTick - The tick publisher reference counts subscriptions to the tick data
com.apama.marketdata.UnsubscribeTickFromContext - 

Member summary
 booleanrouteIt
 booleanisMultiContext
 dictionary<context, integer>outputContexts
 
Action summary
 voidcreatePublisher(com.apama.marketdata.TickKey key, boolean validData)

This constructor action will create a tick publisher for the source described by the tick key.
 voidcreatePublisherFromSubscription(com.apama.marketdata.SubscribeTick subscription, boolean validData)

This constructor action will create a tick publisher with a market data key set from a subscription event.
 voiddestroyPublisher()

This action can be used to destroy the publisher created by either constructor.
 com.apama.marketdata.TickKeygetKey()

This action gives access to the tick key containing the source details of the publisher.
 integergetSubscribers()

This action gives access to the number of current subscribers to the tick data.
 booleanisDataValid()

This action returns whether the data is currently valid.
 voidsetData(float price, integer quantity)

This action sets the tick data to be published.
 voidsetDataValid(boolean validData)

This action can be used to set whether the data is currently valid.
 voidsetDataWithExtraParams(float price, integer quantity, dictionary<string, string> extraParams)

This action sets the tick data to be published with extra parameters.
 voidsetPublisherStatus(boolean killPublisher, string status)

This action sets the publisher status. This is communicated using the TickSubscriptionError event.
 
Member detail

isMultiContext

boolean isMultiContext

outputContexts

dictionary<context, integer> outputContexts

routeIt

boolean routeIt

Action detail

createPublisher

void createPublisher(com.apama.marketdata.TickKey key, boolean validData)
This constructor action will create a tick publisher for the source described by the tick key.
Parameters:
key - The tick key containing the source details of this publisher
validData - This parameter determines whether the tick data is valid to begin with, if it isn't valid it wont be published.

createPublisherFromSubscription

void createPublisherFromSubscription(com.apama.marketdata.SubscribeTick subscription, boolean validData)
This constructor action will create a tick publisher with a market data key set from a subscription event.
Parameters:
subscription - The subscription is used to set the source details of the publisher
validData - This parameter determines whether the depth data is valid to begin with, if it isn't valid it wont be published.
See Also:
com.apama.marketdata.TickKey - The tick key is used to store the source details of this publisher

destroyPublisher

void destroyPublisher()
This action can be used to destroy the publisher created by either constructor.
See Also:
com.apama.marketdata.TickPublisher#createPublisher() - One constructor
com.apama.marketdata.TickPublisher#createPublisherFromSubscription() - The other constructor

getKey

com.apama.marketdata.TickKey getKey()
This action gives access to the tick key containing the source details of the publisher.
Returns:
The tick key

getSubscribers

integer getSubscribers()
This action gives access to the number of current subscribers to the tick data.
Returns:
The number of subscribers

isDataValid

boolean isDataValid()
This action returns whether the data is currently valid.
Returns:
Whether the data is currently valid

setData

void setData(float price, integer quantity)
This action sets the tick data to be published.
Parameters:
price - The price of the trade
quantity - The qty traded

setDataValid

void setDataValid(boolean validData)
This action can be used to set whether the data is currently valid.

When the data is invalid it is not published. This is useful if you want to apply a number of changes as one transaction before an update is sent. When the data is set to valid again, and if it has changed, a Tick event will be routed immediately.
Parameters:
validData - Whether the data should be marked valid or not.

setDataWithExtraParams

void setDataWithExtraParams(float price, integer quantity, dictionary<string, string> extraParams)
This action sets the tick data to be published with extra parameters.
Parameters:
price - The price of the trade
quantity - The qty traded
extraParams - The trade extra parameters

setPublisherStatus

void setPublisherStatus(boolean killPublisher, string status)
This action sets the publisher status. This is communicated using the TickSubscriptionError event.
Parameters:
killPublisher - Whether there has been an unrecoverable failure
status - The status message to publish
Routes:
com.apama.marketdata.TickSubscriptionError - The status data published
Sends:
com.apama.marketdata.TickSubscriptionError -