com.apama.md.user
Event TradeManagerInterface


The Trade Manager Interface allows the user to connect to and control the Trade datastream provided by the Source that was provided when the interface was created using the MDManagerFactory.

The Trade Manager Interface event provides a high-level interface on to the Trade Manager class. This interface allows the Manager to expose only those functions that are of direct use by the user, and masks those functions that are used internally by the Manager to provide the required functionality.
Since:
CMF 2.0.0

Member summary
 action<string, com.apama.session.CtrlParams, action<com.apama.session.SessionError>, action<com.apama.md.adapter.ConnectionKey>, action<com.apama.md.adapter.ConnectionKeycom.apama.md.client.Error>>connect

Connect to the Trade Manager Interface and create an instance of the Trade Manager.
 action<string, com.apama.session.CtrlParams, action<com.apama.session.SessionError>, action<com.apama.md.adapter.ConnectionKey>, action<com.apama.md.adapter.ConnectionKeycom.apama.md.client.Error>>connectWithoutCache

Connect to the Trade Manager Interface without cache and create an instance of the Trade Manager.
 action<com.apama.md.adapter.ConnectionKey, action<com.apama.md.adapter.ConnectionKey>, action<com.apama.md.adapter.ConnectionKeycom.apama.md.client.Error>>disconnect

Disconnect from the Trade Manager.
 action<com.apama.md.adapter.ConnectionKey, action<com.apama.md.client.CurrentTradeInterface>> returns integeraddUpdateCallback

Responds on every trade update associated with this interface.
 action<com.apama.md.adapter.ConnectionKey, integer> returns booleanremoveCallback

Provides the user a mechanism to remove the on all listeners.
 action<> returns com.apama.session.CtrlParamsSchemagetCtrlParamSchema

Provides the user a mechanism to access the control parameters that are returned from the data stream creation.
 action<com.apama.md.adapter.ConnectionKey> returns booleanhasData

This function allows the Manager object to determine whether any data has been received for this connection.
 action<com.apama.md.adapter.ConnectionKey> returns com.apama.md.client.CurrentTradeInterfacegetCurrentTrade

Returns the current Trade interface for the specified symbol.
 action<> returns sequence<com.apama.md.adapter.ConnectionKey>getConnectionList

Returns a sequence of the current connection keys.
 action<string> returns sequence<com.apama.md.adapter.ConnectionKey>getConnectionListForSymbol

Returns a sequence of the potential connection keys for any connections with a specified symbol name.
 
Member detail

addUpdateCallback

action<com.apama.md.adapter.ConnectionKey, action<com.apama.md.client.CurrentTradeInterface>> returns integer addUpdateCallback
Responds on every trade update associated with this interface.

The callback function returns a reference to the current Trade interface rather than the data itself. This means that if you store the returned CurrentTradeInterface reference and attempt to use it after a series of updates, the stored CurrentTradeInterface will refer to the last update.

Parameters:
connKey - The unique key for the connection to the datastream for which to add an update handler.
success - The action called each time a Trade is received.
Returns:
An integer reference ID which can be used to unregister the update callback.
See Also:
com.apama.md.user.TradeManager#addTradeUpdateCallback() - The implementation of the interface function.

connect

action<string, com.apama.session.CtrlParams, action<com.apama.session.SessionError>, action<com.apama.md.adapter.ConnectionKey>, action<com.apama.md.adapter.ConnectionKeycom.apama.md.client.Error>> connect
Connect to the Trade Manager Interface and create an instance of the Trade Manager.

Parameters:
symbol - The name of the symbol to create a connection for.
controlParams - Any control parameters that are required for this connection.
userOnSessionError - Callback action for session errors.
success - Callback action if the connection was successful.
failure - Callback action if the connection was unsuccessful.
See Also:
com.apama.md.user.TradeManager#connect() - The implementation of the interface function.

connectWithoutCache

action<string, com.apama.session.CtrlParams, action<com.apama.session.SessionError>, action<com.apama.md.adapter.ConnectionKey>, action<com.apama.md.adapter.ConnectionKeycom.apama.md.client.Error>> connectWithoutCache
Connect to the Trade Manager Interface without cache and create an instance of the Trade Manager.

Parameters:
symbol - The name of the symbol to create a connection for.
controlParams - Any control parameters that are required for this connection.
userOnSessionError - Callback action for session errors.
success - Callback action if the connection was successful.
failure - Callback action if the connection was unsuccessful.
See Also:
com.apama.md.user.TradeManager#connectWithoutCache() - The implementation of the interface function.

disconnect

action<com.apama.md.adapter.ConnectionKey, action<com.apama.md.adapter.ConnectionKey>, action<com.apama.md.adapter.ConnectionKeycom.apama.md.client.Error>> disconnect
Disconnect from the Trade Manager.

Parameters:
connKey - The unique key for the connection to the datastream for which to disconnect from.
success - Callback action if the disconnection was successful.
failure - Callback action if the disconnection was unsuccessful.
See Also:
com.apama.md.user.TradeManager#disconnect() - The implementation of the interface function.

getConnectionList

action<> returns sequence<com.apama.md.adapter.ConnectionKeygetConnectionList
Returns a sequence of the current connection keys.

Returns:
A sequence of the current connection keys.

getConnectionListForSymbol

action<string> returns sequence<com.apama.md.adapter.ConnectionKeygetConnectionListForSymbol
Returns a sequence of the potential connection keys for any connections with a specified symbol name.

Returns:
A sequence of the potential connection keys for any connections with a specified symbol name.

getCtrlParamSchema

action<> returns com.apama.session.CtrlParamsSchema getCtrlParamSchema
Provides the user a mechanism to access the control parameters that are returned from the data stream creation.

Returns:
The Control parameters associated with this connection.
See Also:
com.apama.md.user.TradeManager#getCtrlParamSchema() - The implementation of the interface function.

getCurrentTrade

action<com.apama.md.adapter.ConnectionKey> returns com.apama.md.client.CurrentTradeInterface getCurrentTrade
Returns the current Trade interface for the specified symbol.

Parameters:
symbol - The name of the symbol to request the current data for.
Returns:
The current Trade interface.
See Also:
com.apama.md.user.TradeManager#getCurrentTrade() - The implementation of the interface function.

hasData

action<com.apama.md.adapter.ConnectionKey> returns boolean hasData
This function allows the Manager object to determine whether any data has been received for this connection.

Parameters:
connKey - The unique key for the connection to the datastream for which to request the current data.
Returns:
true if data is available, false otherwise.

removeCallback

action<com.apama.md.adapter.ConnectionKey, integer> returns boolean removeCallback
Provides the user a mechanism to remove the on all listeners.

Parameters:
connKey - The unique key for the connection to the datastream for which to remove an update handler.
reference - The reference ID as returned from the call to "addUpdateCallback".
Returns:
true if successful, false otherwise.
See Also:
com.apama.md.user.TradeManager#removeTradeCallback() - The implementation of the interface function.