Attributes | Name and Description |
---|---|
|
caplin.trading.testing.TradeMessageServiceStub()
Constructs an instance of |
Attributes | Name and Description |
---|---|
|
void
addEventLogger(Function fLogger)
This method registers an event logging function with this mock TradeMessageService. |
|
void
addTrade(caplin.trading.trademodel.Trade oTrade)
Assigns the trade as the subscriber to mocked trade messages. |
|
void
receiveServerTradeEvent(String sEventName, Map mData, sTradeID)
This method is called by a mock trade server to simulate the receipt of a trade event from Liberator via SL4B. |
|
void
receiveTradeChannelStatusChange(boolean bEnabled)
This method is called by a mock trade server to simulate a channel status change of the trade subscriber. |
|
void
removeTrade(caplin.trading.trademodel.Trade oTrade)
Unregisters the trade subscribed to mocked trade messages. |
|
void
sendTradeEvent(String sEventName, caplin.trading.trademodel.Trade oTrade, caplin.trading.trademodel.DataHolder oData)
This method is called by a caplin.trading.trademodel.Trade to simulate the sending of a trade event to Liberator via SL4B. |
►
caplin.trading.testing.TradeMessageServiceStub()
Constructs an instance of caplin.trading.testing.TradeMessageServiceStub
.
►
void
addEventLogger(Function fLogger)
This method registers an event logging function with this mock TradeMessageService. This function is called for all events Events being "sent" by a trade and "received" from a server mock. A component workbench or a mock server will typically register a logger in order to display or be informed of the mocked trade events. Callback functions must handle the following 3 parameters:
Function | fLogger | the callback function to log mock trade events |
►
void
addTrade(caplin.trading.trademodel.Trade oTrade)
Assigns the trade as the subscriber to mocked trade messages.
caplin.trading.trademodel.Trade | oTrade | the trade object. |
►
void
receiveServerTradeEvent(String sEventName, Map mData, sTradeID)
This method is called by a mock trade server to simulate the receipt of a trade event from Liberator via SL4B. The event is propagated to the Trade subscribed via this mock trade subscriber. This stub will print out the message to a logger if one has been defined.
String | sEventName | the event name that is being received from the server |
Map | mData | the data being received for this event |
sTradeID |
►
void
receiveTradeChannelStatusChange(boolean bEnabled)
This method is called by a mock trade server to simulate a channel status change of the trade subscriber. The change event is propagated to the Trade subscribed via this mock trade subscriber. The new subscriber status will be printed to a logger if one has been defined.
boolean | bEnabled | the new trading status received |
►
void
removeTrade(caplin.trading.trademodel.Trade oTrade)
Unregisters the trade subscribed to mocked trade messages.
caplin.trading.trademodel.Trade | oTrade | the trade object. |
►
void
sendTradeEvent(String sEventName, caplin.trading.trademodel.Trade oTrade, caplin.trading.trademodel.DataHolder oData)
This method is called by a caplin.trading.trademodel.Trade to simulate the sending of a trade event to Liberator via SL4B. This stub will print out the message to a logger if one has been defined.
String | sEventName | the event name that is being sent to the server. |
caplin.trading.trademodel.Trade | oTrade | the trade object. |
caplin.trading.trademodel.DataHolder | oData | the data being sent with this event. |