Caplin Trader 4.5.2

Interface: module:caplin/trading/service/TOBOUserService

module:caplin/trading/service/TOBOUserService

The TOBOUserService interface — this should never be constructed.

The TOBOUserService is the interface designed for managing the activities of a client user who is permissioned to trade on behalf of other (TOBO) users. The interface provides a way to obtain the list of TOBO users and their respective accounts which the logged-in user can trade upon, as well as querying and setting the current TOBO user and account selected. An interface is also provided to notify the service when a trade is started or ended so that the TOBOUserService can manage and alter the logged-in users's ability to trade, switch accounts, or perform other TOBO-related activities while a trade is ongoing.

Implementations of a TOBOUserService should be registered with the module:caplin/core/ServiceRegistry#registerService method.

Implementations:

Methods

addListener(oListener)

Adds a listener which will be notified when the TOBOUserService state is changed. The listener must be an instance of module:caplin/trading/service/TOBOUserServiceListener.
Parameters:
Name Type Description
oListener module:caplin/trading/service/TOBOUserServiceListener Listener object.
Implementations:

canPerformTrade()

This method can be used to query whether the logged-in user can perform a trade on behalf of the currently TOBO user.
Implementations:

canTradeOnBehalfOf()

This method can be used to query whether the logged-in user can trade on behalf of other users.
Implementations:

getAccount()

Returns the account of the currently selected TOBO user which is being used by the logged-in user.
Implementations:

getTradeOnBehalfOfUser()

Returns the TOBO user whom the logged-in user is trading on behalf of.
Implementations:

getUserType()

Returns the user type of the logged-in user. Used to query whether the user is a trader or a user who is allowed to trade on behalf of other users.
Implementations:

removeListener(oListener)

Removes a listener on the TOBOUserService.
Parameters:
Name Type Description
oListener module:caplin/trading/service/TOBOUserServiceListener Listener object.
Implementations:

setAccount()

Called to set the current TOBO user's account to be used for trading by the logged-in user.
Implementations:

setTradeOnBehalfOfUser()

Called to set the TOBO user whom the logged-in user wishes to trade on behalf of.
Implementations:

tradeFinished()

This method is called by the trading components to notify the TOBOUserService when a trade has finished.
Implementations:

tradeStarted()

This method is called by the trading components to notify the TOBOUserService when a trade has started.
Implementations: